refactor(l1): decouple version-specific rlpx messages#4395
Merged
Conversation
Lines of code reportTotal lines added: Detailed view |
227231f to
36e2211
Compare
MegaRedHand
reviewed
Sep 15, 2025
| StatusMessage::StatusMessage69(msg) => msg.network_id, | ||
| } | ||
| } | ||
| pub trait StatusMessage { |
Collaborator
There was a problem hiding this comment.
This trait is implemented by both the 68 and 69 version status messages, but it isn't used anywhere else, right? In that case, we could drop it.
Contributor
Author
There was a problem hiding this comment.
Its used so that we don't have to duplicate the logic in validate_status
MegaRedHand
approved these changes
Sep 15, 2025
MegaRedHand
reviewed
Sep 15, 2025
|
|
||
| impl RLPxMessage for Receipts68 { | ||
| const CODE: u8 = 0x0F; | ||
| const CODE: u8 = 0x10; |
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.
Motivation
We already know which version of messages such as
StatusandReceiptswe are going to send/expecting to receive, so we should handle them separately instead of having unified logic for both eth/68 & eth/68 variants. This will save us from having overly-complicated logic when decoding these messages.Description
Receiptsenum message and instead useReceipts68&Receipts69directlyStatusenum message and instead useStatusMessage68&StatusMessage69directly. AddStatusMessagetrait to allow using pre-existing status validation logicCloses #3032