mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
This PR fixes an issue where `evm statetest` would not verify the post-state root hash if the test case expected an exception (e.g. invalid transaction). The fix involves: 1. Modifying `tests/state_test_util.go` in the `Run` method. 2. When an expected error occurs (`err != nil`), we now check if `post.Root` is defined. 3. If defined, we recalculate the intermediate root from the current state (which is reverted to the pre-transaction snapshot upon error). 4. We use `GetChainConfig` and `IsEIP158` to ensure the correct state clearing rules are applied when calculating the root, avoiding regressions on forks that require EIP-158 state clearing. 5. If the calculated root mismatches the expected root, the test now fails. This ensures that state tests are strictly verified against their expected post-state, even for failure scenarios. Fixes issue #33527 --------- Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de> |
||
|---|---|---|
| .. | ||
| evm-benchmarks@d8b88f4046 | ||
| fuzzers | ||
| solidity | ||
| testdata@81862e4848 | ||
| block_test.go | ||
| block_test_util.go | ||
| difficulty_test.go | ||
| difficulty_test_util.go | ||
| gen_btheader.go | ||
| gen_difficultytest.go | ||
| gen_stauthorization.go | ||
| gen_stenv.go | ||
| gen_sttransaction.go | ||
| init.go | ||
| init_test.go | ||
| rlp_test.go | ||
| rlp_test_util.go | ||
| state_test.go | ||
| state_test_util.go | ||
| transaction_test.go | ||
| transaction_test_util.go | ||