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

proof: verify keys, pre-state and post-state

Open jsign opened this issue 2 years ago • 0 comments

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.VerkleTrie APIs 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.

jsign avatar Oct 26 '23 16:10 jsign