Skip to content

core/stateless, eth: add debug_executionWitnessByHash #32216

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gballet
Copy link
Member

@gballet gballet commented Jul 15, 2025

This is a request by @kevaundray.

This PR adds a new system call, which re-executes a block with stateless mode activated, so that the witness data are collected and returned.

This has some differences with the reth equivalent (list will likely :

  1. The returned block header is json-encoded and not rlp-encoded
  2. nil codes aren't added
  3. the keys field is present but is always empty - this is an agreement with Kev, that will be done in a later PR. The role of this PR is to find the disagreements with reth.

Note that, besides these issues, I still do find some differences with what reth returns, which is why this PR is in Draft mode.

gballet added 3 commits June 4, 2025 09:22
Signed-off-by: Guillaume Ballet <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
@gballet gballet added the zk label Jul 15, 2025
Signed-off-by: Guillaume Ballet <[email protected]>
@s1na
Copy link
Contributor

s1na commented Aug 19, 2025

I checked the difference in witness between geth and reth for block https://etherscan.io/block/23174550.
Find the results here: geth-witness-550-sorted.json
reth-witness-550-sorted.json

Apart from the differences noted above:

  • codes field seems to have a minor difference:
    • First, reth produces a duplicate code in 0x363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3
    • Geth returns 2 less codes. One is 0x. The other is a big contract 0x6080604052600436106100745760003560e01c8063ad5c46481161004e.... It seems wasteful to include an empty code so I'd say that should be changed in reth. But why the second code is missing is an interesting question.

In addition, good to clarify these in the spec:

  • Name of the method debug_executionWitness vs debug_executeWitnessByHash.
  • We only take block hash as parameter, reth only takes block number. Both are weird imo we should take block num or hash or go for 2 methods.

@jsign
Copy link
Contributor

jsign commented Aug 19, 2025

We only take block hash as parameter, reth only takes block number. Both are weird imo we should take block num or hash or go for 2 methods.

@s1na, reg this, Reth has both.

@rjl493456442
Copy link
Member

Does anyone know what Keys refers to?

@rjl493456442
Copy link
Member

rjl493456442 commented Aug 21, 2025

keys: this is a list of all the keys present in the state. It is particularly ordered first by address and then storage slot keys. e.g.,

<address1><address2><slot-1-address2><slot-2-address2><address3><sloat-1-address3>. etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants