Skip to content

Conversation

@JereSalo
Copy link
Contributor

@JereSalo JereSalo commented Nov 25, 2025

Motivation

  • Fix debug_executionWitness endpoint

Description

  • 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.

@github-actions github-actions bot added L1 Ethereum client L2 Rollup client labels Nov 25, 2025
@github-actions
Copy link

Lines of code report

Total lines added: 0
Total lines removed: 3
Total lines changed: 3

Detailed view
+---------------------------------------------------------+-------+------+
| File                                                    | Lines | Diff |
+---------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/debug/execution_witness.rs | 207   | -3   |
+---------------------------------------------------------+-------+------+

@JereSalo JereSalo marked this pull request as ready for review November 25, 2025 18:53
Copilot AI review requested due to automatic review settings November 25, 2025 18:53
@JereSalo JereSalo requested a review from a team as a code owner November 25, 2025 18:53
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Nov 25, 2025
Copy link
Contributor

Copilot AI left a 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 RLPEncode import
  • 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.

@xqft xqft added this pull request to the merge queue Nov 25, 2025
Merged via the queue into main with commit dc83c60 Nov 25, 2025
64 checks passed
@xqft xqft deleted the fix_witness_rpc branch November 25, 2025 19:27
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 25, 2025
LeanSerra pushed a commit that referenced this pull request Nov 26, 2025
**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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client L2 Rollup client

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants