go-ethereum/core/state
Daniel Liu 3eb198b1a5
refactor(core): storage journal entry should revert dirtyness too #29641 (#2078)
Currently our state journal tracks each storage update to a contract, having the ability to revert those changes to the previously set value.

For the very first modification however, it behaves a bit wonky. Reverting the update doesn't actually remove the dirty-ness of the slot, rather leaves it as "change this slot to it's original value". This can cause issues down the line with for example write witnesses needing to gather an unneeded proof.

This PR modifies the storageChange journal entry to not only track the previous value of a slot, but also whether there was any previous value at all set in the current execution context. In essence, the PR changes the semantic of storageChange so it does not simply track storage changes, rather it tracks dirty storage changes, an important distinction for being able to cleanly revert the journal item.

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2026-03-06 11:15:44 +05:30
..
access_list.go core/state: reduce one alloc #33024 (#1784) 2025-11-24 11:00:15 +05:30
database.go refactor(core): make signature of ContractCode hash-independent #27209 (#1169) 2026-02-13 09:11:43 +05:30
dump.go refactor(all): track state changes in state db #27349 (#1947) 2026-02-24 10:27:31 +05:30
iterator.go refactor(core): make signature of ContractCode hash-independent #27209 (#1169) 2026-02-13 09:11:43 +05:30
iterator_test.go all: port boring changes from pbss #27176 (#1158) 2026-01-26 11:21:46 +05:30
journal.go refactor(core): storage journal entry should revert dirtyness too #29641 (#2078) 2026-03-06 11:15:44 +05:30
metrics.go refactor(all): track state changes in state db #27349 (#1947) 2026-02-24 10:27:31 +05:30
state_object.go refactor(core): storage journal entry should revert dirtyness too #29641 (#2078) 2026-03-06 11:15:44 +05:30
state_object_test.go all: using testing.B.Loop (#1554) 2025-09-24 07:59:48 +08:00
state_reader.go new EVM Upgrade 2021-09-21 16:53:46 +05:30
state_test.go core/state: remove account reset operation v2 #29520 (#1934) 2026-02-24 14:17:27 +05:30
statedb.go core/state: remove account reset operation v2 #29520 (#1934) 2026-02-24 14:17:27 +05:30
statedb_fuzz_test.go core/state: remove account reset operation v2 #29520 (#1934) 2026-02-24 14:17:27 +05:30
statedb_hooked.go core/state: ensure deterministic hook emission order in Finalise #33644 (#1981) 2026-01-29 11:23:33 +05:30
statedb_hooked_test.go all: expose block number information to statedb #27753 (#1936) 2026-01-16 15:55:04 +05:30
statedb_test.go core/state: remove account reset operation v2 #29520 (#1934) 2026-02-24 14:17:27 +05:30
statedb_utils.go record total minted API v2 (#1769) 2025-12-09 19:43:19 +08:00
sync.go core, trie: prepare for path-based trie storage #26603 (#1126) 2025-11-18 11:20:00 +05:30
sync_test.go refactor(core): make signature of ContractCode hash-independent #27209 (#1169) 2026-02-13 09:11:43 +05:30
transient_storage.go all: implement EIP-1153 transient storage (#26003) 2024-11-15 19:39:18 +08:00
trc21_reader.go all: rework trc21 (#1777) 2025-11-18 11:24:56 +05:30