feat(identify): implement signedPeerRecord#5785
Conversation
|
Oh CI will compile the protobuf code, didn't see that. |
|
you might rebase to main branch, as zlib license has added to ci, #5769 |
I think you might write some changelog text into this file, just like, the pr might be okay now. |
Thanks for the review! Working on tests right now. |
|
version |
CHANGELOG will be fixed with #5803, you can just add the new entry to |
elenaf9
left a comment
There was a problem hiding this comment.
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
signedPeerRecordis 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):
- Verify that the signature matches the remote's public key
- Deserialize the record, store the resulting addresses as
listen_addrs, and ignore the originallisten_addrs.
Wdyt?
There was a problem hiding this comment.
LGTM. Thanks @drHuangMHT for the follow-ups!
I'd still like to wait for a review from @jxs before merging this.
jxs
left a comment
There was a problem hiding this comment.
Hi Dr Huang, overall looks good to me, thanks fr your work on this!
let some comments
Description
May close #4017.
Notes & open questions
pb-rsnow usesCow<'_,T>for the compiled Rust structs. But with borrowed type in the struct,FramedReadcan no longer process frames correctly(trait bound not statisfied).Change checklist