Skip to content

Conversation

@drHuangMHT
Copy link
Contributor

@drHuangMHT drHuangMHT commented Dec 31, 2024

Description

May close #4017.

Notes & open questions

pb-rs now uses Cow<'_,T> for the compiled Rust structs. But with borrowed type in the struct, FramedRead can no longer process frames correctly(trait bound not statisfied).

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@drHuangMHT
Copy link
Contributor Author

drHuangMHT commented Dec 31, 2024

Oh CI will compile the protobuf code, didn't see that.
EDIT: Wait how does this work?

Copy link
Member

@dariusc93 dariusc93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments :)

@getong
Copy link

getong commented Jan 3, 2025

you might rebase to main branch, as zlib license has added to ci, #5769

@getong
Copy link

getong commented Jan 3, 2025

Files in /home/runner/work/rust-libp2p/rust-libp2p/protocols/identify have changed, please write a changelog entry in /home/runner/work/rust-libp2p/rust-libp2p/protocols/identify/CHANGELOG.md

I think you might write some changelog text into this file, just like,

implement signedPeerRecord

the pr might be okay now.

@drHuangMHT
Copy link
Contributor Author

the pr might be okay now.

Thanks for the review! Working on tests right now.

@drHuangMHT
Copy link
Contributor Author

version 0.45.1 of libp2p-identify hasn't been released on crates.io yet, I'm not sure whether I should add a changelog entry right now.

@drHuangMHT drHuangMHT marked this pull request as ready for review January 4, 2025 05:27
@elenaf9
Copy link
Member

elenaf9 commented Jan 9, 2025

version 0.45.1 of libp2p-identify hasn't been released on crates.io yet, I'm not sure whether I should add a changelog entry right now.

CHANGELOG will be fixed with #5803, you can just add the new entry to 0.46.0.

Copy link
Member

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @drHuangMHT! Looks like a great start.

I found a pending libp2p spec for signed peer records: libp2p/specs#630. Most of it matches this PR, just one thing is missing:

If the signedPeerRecord is present the implementation MUST use the data contained within it and ignore duplicated fields present in the main identify message

IMO that makes sense and should be added to this PR. So instead of copying the received record as it is in handle_incoming_info, I think we should instead (when an signed envelope is present):

  1. Verify that the signature matches the remote's public key
  2. Deserialize the record, store the resulting addresses as listen_addrs, and ignore the original listen_addrs.

Wdyt?

Copy link
Member

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @drHuangMHT for the follow-ups!

I'd still like to wait for a review from @jxs before merging this.

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Dr Huang, overall looks good to me, thanks fr your work on this!
let some comments

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks Dr Huang 🚀

@jxs jxs added the send-it label Mar 2, 2025
@mergify mergify bot merged commit 9907a94 into libp2p:master Mar 2, 2025
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

identify: implement SignedPeerRecord

5 participants