ethereum / py-evm

A Python implementation of the Ethereum Virtual Machine
https://py-evm.readthedocs.io/en/latest/
MIT License
2.26k stars 650 forks source link

Add a state comparison for blockchain tests if they fail in certain contexts #2154

Open fselmo opened 6 months ago

fselmo commented 6 months ago

If the only block header field mismatch is the state root, use the state.meta_witness and the postState of the test fixture to try to reconcile where there may be discrepancies. If running verify_state yields a success, it means we likely have an extra account in our state that isn't present in the postState of the test. Inspecting the meta_witness.accounts_queried can help elucidate if there are any extra accounts in the state that may need to be marked for deletion, thus giving us a different state root even though everything in the postState is accurate.