-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correct implementations of Encodable and Decodable for sidecars #1528
Conversation
a7b7e2c
to
1b42a07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit fixed 🫡
It appears to have been a hack to deal with the eip4844 2718 encoding when the sidecar is present. See #1496 for more cleanup around these APIs (this bug was found while working on that). The sketch is that 4844 specifies that the 2718 payload is More interestingly, do we have any use case in which a sidecar itself should be RLP encoded at all? We have to RLP encode it's fields, but when is a standalone sidecar rlp encoded or included as a sublist in another list? We could just delete these impls if there's not a use case |
not that I can recall, overall this PR looks good to me, but I'm wary of merging it mostly because I don't have a full overview of 4844 in reth, so I'd like to get either @mattsse or @Rjected to take a look since they worked on this and might know if there is such a usecase |
In the interest of fixing the logic bug, can we merge this as is, without deleting the impls? Reth's tests will easily flag reliance on the current faulty coding logic, and it's trivial to fix when reth bumps to a new alloy version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should definitely make the no-header functions not Encodable
/ Decodable
fns. Sidecars are basically never rlp encoded on their own. We can easily switch over the decoding fn to call, and we have blob tx encoding tests that would catch the behavior change
yeah @Rjected the trait impls in the sidecar we should remove |
Closes #1499
Motivation
current
Encodable
andDecodable
implementations do not RLP encode or RLP decode the sidecar. Instead they encode only the fields, without the header, producing incorrect RLP outputSolution
Current behavior has been moved into more-explicitly named functions and is used to construct correct RLP implementations
This is a breaking change as things that previously (incorrectly) deserialized now will not
PR Checklist