go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

all: collect MPT witnesseses+prestate for fully-executed blocks. rlp-encode and dump this information to disk.

Open jwasinger opened this issue 1 year ago • 3 comments

This PR is based on https://github.com/holiman/go-ethereum/tree/witness_experiments_2 .

It changes Geth to optionally write an RLP encoded block and witnesses required for stateless execution to disk during execution of each block.

A new debug namespace API method setWitnessRecording takes two parameters: a string path and a boolean flag to enable/disable witness recording. When this is enabled, an RLP-encoded object containing a block and witness data (block hashes, contract codes, trie intermediate nodes and values for storage/account tries) is written to disk.

jwasinger avatar Dec 04 '23 17:12 jwasinger

Pushed wip implementation of the stateless executor command. currently broken at the witness+block decoding step.

jwasinger avatar Dec 12 '23 18:12 jwasinger

So as we discussed, this PR will be broken up:

  • PR which implements witness gathering during block execution, the ability to dump said witnesses RLP-encoded to disk.
  • PR which implements a standalone stateless executer command which loads a block/witness, decodes it and executes/verifies it.

jwasinger avatar Dec 18 '23 14:12 jwasinger

https://github.com/ethereum/go-ethereum/blob/9dc20080d595da153e48e91204285bab3d6ff8a5/core/state/statedb.go#L1229

storage slots for selfdestructed accounts won't end up in the witness

jwasinger avatar Dec 20 '23 19:12 jwasinger