go-ethereum
go-ethereum copied to clipboard
all: collect MPT witnesseses+prestate for fully-executed blocks. rlp-encode and dump this information to disk.
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.
Pushed wip implementation of the stateless executor command. currently broken at the witness+block decoding step.
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.
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