go-ethereum/core
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
..
asm all: pre-allocate memory for slices and maps, close XFN-148 (#1714) 2025-11-14 20:13:36 +05:30
bloombits all: use WaigGroup.Go() to simplify code (#1699) 2025-11-29 17:17:08 +05:30
rawdb refactor(crypto): vendor in golang.org/x/crypto/sha3 #33323 (#2046) 2026-02-28 17:23:57 +04:00
state refactor(core): storage journal entry should revert dirtyness too #29641 (#2078) 2026-03-06 11:15:44 +05:30
tracing feat(core): extends tracing.Hooks with OnSystemCallStartV2 #30786 (#2073) 2026-02-28 16:55:51 +04:00
txpool refactor(crypto): vendor in golang.org/x/crypto/sha3 #33323 (#2046) 2026-02-28 17:23:57 +04:00
types refactor(crypto): vendor in golang.org/x/crypto/sha3 #33323 (#2046) 2026-02-28 17:23:57 +04:00
vm core/state: remove account reset operation v2 #29520 (#1934) 2026-02-24 14:17:27 +05:30
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
block_validator.go all: set gas limit dynamically (#1945) 2026-01-21 10:49:20 +05:30
block_validator_test.go refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
blockchain.go refactor(all): remove term whitelist and blacklist (#1994) 2026-02-10 17:09:21 +05:30
blockchain_insert.go all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
blockchain_reader.go refactor(core): make signature of ContractCode hash-independent #27209 (#1169) 2026-02-13 09:11:43 +05:30
blockchain_test.go refactor(all): remove term whitelist and blacklist (#1994) 2026-02-10 17:09:21 +05:30
blocks.go new EVM Upgrade 2021-09-21 16:53:46 +05:30
chain_indexer.go core: refactor read and write valid sections (#1808) 2025-12-08 15:07:33 +05:30
chain_indexer_test.go light: CHT and bloom trie indexers working in light mode (#16534) 2025-03-06 15:30:48 +08:00
chain_makers.go refactor(core): remove unnecessary parameters #30776 (#2068) 2026-02-20 13:51:30 +05:30
chain_makers_test.go refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
dao_test.go refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
error.go refactor(all): remove term whitelist and blacklist (#1994) 2026-02-10 17:09:21 +05:30
events.go eth/filters: remove use of event.TypeMux for pending logs (#20312) 2024-08-03 10:03:22 +08:00
evm.go perf(core): use uint256 in state #28598 (#1977) 2026-02-05 13:59:23 +05:30
gaspool.go core, miner: log gas limit error when pack transactions (#1905) 2026-01-04 17:21:34 +05:30
gen_genesis.go all: format golang files (#1548) 2025-09-21 19:41:54 +08:00
genesis.go feat(core): implement EIP-2935 #29465 #30924 (#2033) 2026-02-12 09:01:26 +05:30
genesis_alloc_devnet.go all: format golang files (#1548) 2025-09-21 19:41:54 +08:00
genesis_alloc_mainnet.go core: tidy up genesis alloc 2025-02-19 14:15:09 +08:00
genesis_alloc_testnet.go core: tidy up genesis alloc 2025-02-19 14:15:09 +08:00
genesis_test.go refactor(all): move genesis initialization to blockchain #25523 (#2018) 2026-02-10 16:56:34 +05:30
headerchain.go refactor(all): remove term whitelist and blacklist (#1994) 2026-02-10 17:09:21 +05:30
mkalloc.go core: use slices package for sorting #27489 #27909 (#1701) 2025-12-07 15:43:24 +05:30
sender_cacher.go all: refactor txpool into it's own package in prep for 4844 (#26038) 2024-11-01 11:36:53 +08:00
state_prefetcher.go refactor(all): rework EVM constructor #30745 (#2065) 2026-02-17 14:35:18 +05:30
state_processor.go feat(core): extends tracing.Hooks with OnSystemCallStartV2 #30786 (#2073) 2026-02-28 16:55:51 +04:00
state_processor_test.go refactor(crypto): vendor in golang.org/x/crypto/sha3 #33323 (#2046) 2026-02-28 17:23:57 +04:00
state_transition.go refactor(core): clean up EVM environmental structure #31061 (#1985) 2026-02-10 16:40:54 +05:30
token_validator.go refactor(all): rework EVM constructor #30745 (#2065) 2026-02-17 14:35:18 +05:30
types.go core: use atomic type #27011 2025-04-28 16:57:56 +08:00