mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
…ytes SelfDestructRefundBytes iterates s.stateObjects and previously called IsNewContract / HasSelfDestructed on each entry to filter for accounts that were both created and selfdestructed in the current transaction. Both helpers go through StateDB.getStateObject, which unconditionally records an EIP-7928 account read via s.stateReadList.AddAccount(addr). The effect is that *every* live entry in the stateObjects cache gets added to the per-tx read list whenever a tx triggers the EIP-8037 selfdestruct refund check (i.e. on every successful tx post-Amsterdam). This pollutes the BAL with addresses the tx never actually touched. In the miner, the cache may contain accounts loaded by earlier failed-tx attempts (preCheck via getStateObject loaded them; RevertToSnapshot does not evict the cache because reads aren't journaled). Validators re-executing the sealed block don't have those cached entries, so they don't reproduce the reads. Result: BAL hash mismatch on otherwise deterministic execution. Use direct field access on the already-iterated *stateObject so the filter doesn't go through getStateObject. Functionally equivalent -- newContract and selfDestructed are the same fields the helpers consult -- but with no read-list side effect. |
||
|---|---|---|
| .. | ||
| pruner | ||
| snapshot | ||
| access_events.go | ||
| access_events_test.go | ||
| access_list.go | ||
| database.go | ||
| database_code.go | ||
| database_history.go | ||
| database_iterator.go | ||
| database_iterator_test.go | ||
| database_mpt.go | ||
| database_ubt.go | ||
| dump.go | ||
| iterator.go | ||
| iterator_test.go | ||
| journal.go | ||
| journal_test.go | ||
| metrics.go | ||
| reader.go | ||
| reader_stater.go | ||
| state_object.go | ||
| state_object_test.go | ||
| state_sizer.go | ||
| state_sizer_test.go | ||
| state_test.go | ||
| statedb.go | ||
| statedb_fuzz_test.go | ||
| statedb_hooked.go | ||
| statedb_hooked_test.go | ||
| statedb_test.go | ||
| stateupdate.go | ||
| sync.go | ||
| sync_test.go | ||
| transient_storage.go | ||
| trie_prefetcher.go | ||
| trie_prefetcher_test.go | ||