Add BIP324 V2 p2p network message support#3792
Merged
apoelstra merged 1 commit intoJan 9, 2025
Merged
Conversation
nyonson
commented
Dec 19, 2024
Contributor
Author
There was a problem hiding this comment.
Ideally this error returned the unknown short ID, but I think this requires a change to the encode::ParseError which lives over in the concensus module...not sure if we want to touch that API at the moment with all the refactoring.
Member
There was a problem hiding this comment.
Good decision. The consensus::ParseErrror is horrible, I linked to this comment in #3795.
06067ee to
ba99a07
Compare
Pull Request Test Coverage Report for Build 12645318125Details
💛 - Coveralls |
tcharding
previously approved these changes
Jan 6, 2025
tcharding
left a comment
Member
There was a problem hiding this comment.
ACK ba99a078ac9014bb402d510b4daac22ca8987973
tcharding
reviewed
Jan 6, 2025
ba99a07 to
bd39623
Compare
Member
|
Formatting changes have snuck in mate (and stable ones at that :) |
BIP324 introduced the second version of p2p network messages which are designed to be used with the new encrypted transport. This patch adds a V2NetworkMessage type which wraps a NetworkMessage and handles the V2 encoding and decoding. It is a parallel of the existing RawNetworkMessage type (which may be better described as V1NetworkMessage). A priority of this patch was to not re-invent any wheels and try to use the existing patterns as much as possible.
bd39623 to
e09bdb5
Compare
Contributor
Author
Oof my bad, iron'd out. |
tcharding
approved these changes
Jan 7, 2025
Member
|
Thanks man, nice one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrating over the BIP324's library's V2 network message encoding and decoding. As discussed over in #2959, this is probably the natural home for it and also cleans up some gross copy/pasta of some of the encoding/decoding chain logic.
This patch adds
V2NetworkMessagewhich wraps aNetworkMessage, but handles the V2 encoding and decoding. It is a parallel of the existingRawNetworkMessage(which mentioned before, may be better described asV1NetworkMessage#3157). A priority of this patch was to not re-invent any wheels and try to use the existing patterns as much as possible.