-
Notifications
You must be signed in to change notification settings - Fork 131
fix(l1,l2): fix encoding of nodes in witness #5421
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
Conversation
Lines of code reportTotal lines added: Detailed view |
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.
Pull request overview
This PR fixes a double encoding bug in the debug_executionWitness RPC endpoint where trie nodes were being RLP-encoded twice before being returned in the witness response.
- Removes redundant RLP encoding of trie nodes in witness generation
- Cleans up unused
RLPEncodeimport - Ensures compatibility with ethrex-replay tool by returning properly encoded witness data
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
**Motivation** - Fix `debug_executionWitness` endpoint **Description** <!-- A clear and concise general description of the changes this PR introduces --> - When asking for the witness of a block the trie nodes were being encoded 2 times (double encoding). This just removes the additional encoding. This has been tested with ethrex-replay and now it works perfectly fine with ethrex nodes. We were getting errors decoding RLP before. How to test it? - Run L1 in dev mode - Request witness with debug_executionWitness See the response both in main and in this branch, you'll see that the nodes are "the same" but in main they are encoded one more time. Basically in main: `RLP(RLP(node))`, but here: `RLP(node)`. We want the latter.
Motivation
debug_executionWitnessendpointDescription
This has been tested with ethrex-replay and now it works perfectly fine with ethrex nodes. We were getting errors decoding RLP before.
How to test it?
See the response both in main and in this branch, you'll see that the nodes are "the same" but in main they are encoded one more time. Basically in main:
RLP(RLP(node)), but here:RLP(node). We want the latter.