go-ethereum
go-ethereum copied to clipboard
proof: verify keys, pre-state and post-state
This PR improves the proof verification code in many ways:
- We now check that the claimed keys in the proof actually match what we computed during the EVM block execution using the access witness.
- Same with the pre-state values, which we weren't checking.
- The post-state values validation now doesn't require building the post-state tree. What we do is use
trie.VerkleTrieAPIs to collect all tree-writes while StateDB dumps the dirty objects into the tree to calculate the new root. We then use these tree writes to figure which are the correct post-state values.
More about each point in comments.
TODO:
- [x] Extra test doing a proof gen+verif replaying of existing Kaustinen from genesis.