go-ethereum/core
rjl493456442 a7f9523ae1
all: implement state history v2 (#30107)
This pull request delivers the new version of the state history, where
the raw storage key is used instead of the hash.

Before the cancun fork, it's supported by protocol to destruct a
specific account and therefore, all the storage slot owned by it should
be wiped in the same transition.

Technically, storage wiping should be performed through storage
iteration, and only the storage key hash will be available for traversal
if the state snapshot is not available. Therefore, the storage key hash
is chosen as the identifier in the old version state history.

Fortunately, account self-destruction has been deprecated by the
protocol since the Cancun fork, and there are no empty accounts eligible
for deletion under EIP-158. Therefore, we can conclude that no storage
wiping should occur after the Cancun fork. In this case, it makes no
sense to keep using hash.

Besides, another big reason for making this change is the current format
state history is unusable if verkle is activated. Verkle tree has a
different key derivation scheme (merkle uses keccak256), the preimage of
key hash must be provided in order to make verkle rollback functional.
This pull request is a prerequisite for landing verkle.

Additionally, the raw storage key is more human-friendly for those who
want to manually check the history, even though Solidity already
performs some hashing to derive the storage location.

---

This pull request doesn't bump the database version, as I believe the
database should still be compatible if users degrade from the new geth
version to old one, the only side effect is the persistent new version
state history will be unusable.

---------

Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2025-01-17 02:59:02 +01:00
..
asm core/vm, cmd/evm: implement eof validation (#30418) 2024-10-02 15:05:50 +02:00
bloombits all: fix typos in comments (#29873) 2024-05-29 12:24:10 +02:00
forkid all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
rawdb core/rawdb: fix panic in freezer (#30973) 2025-01-06 14:52:01 +08:00
state all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
stateless beacon, core, eth, miner: integrate witnesses into production Geth (#30069) 2024-09-20 16:43:42 +03:00
tracing core/tracing: document `OnCodeChange` now being called from SelfDestruct (#31007) 2025-01-16 15:58:16 +01:00
txpool all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
types core/types: change SetCodeTx.ChainID to uint256 (#30982) 2025-01-14 06:42:18 -07:00
vm all: fix some typos in comments and names (#31023) 2025-01-14 14:16:15 +01:00
.gitignore Renamed `chain` => `core` 2014-12-04 10:28:02 +01:00
bench_test.go all: implement eip-7702 set code tx (#30078) 2024-12-16 11:29:37 +01:00
block_validator.go core: switch EVM tx context in ApplyMessage (#30809) 2024-11-29 15:39:42 +01:00
block_validator_test.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
blockchain.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
blockchain_insert.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
blockchain_reader.go core/state: introduce code reader interface (#30816) 2024-11-29 15:32:45 +01:00
blockchain_repair_test.go core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
blockchain_sethead_test.go core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
blockchain_snapshot_test.go core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
blockchain_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
bloom_indexer.go core: preallocate batch size in bloomIndexer (#25289) 2022-08-03 17:02:09 +02:00
chain_indexer.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
chain_indexer_test.go all: improve some error strings (#29842) 2024-05-28 13:44:40 +02:00
chain_makers.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
chain_makers_test.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
dao_test.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
error.go all: implement eip-7702 set code tx (#30078) 2024-12-16 11:29:37 +01:00
events.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
evm.go all: use big.Sign to compare with zero (#29490) 2024-04-09 12:14:30 +02:00
gaspool.go core, miner: revert block gas counter in case of invalid transaction (#26799) 2023-03-07 05:23:52 -05:00
gen_genesis.go core: go fmt (#29544) 2024-04-16 15:42:16 +03:00
genesis.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
genesis_alloc.go all: clean up goerli flag and config (#30289) 2024-08-20 15:59:48 +02:00
genesis_test.go cmd, core, miner: rework genesis setup (#30907) 2025-01-14 11:49:30 +01:00
headerchain.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
headerchain_test.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
mkalloc.go accounts, cmd/geth, core: close opened files (#29598) 2024-04-30 15:47:21 +02:00
rlp_test.go core: move genesis alloc types to core/types (#29003) 2024-02-16 19:05:33 +01:00
sender_cacher.go core: use sync.Once for SenderCacher initialization (#31029) 2025-01-16 14:36:45 +01:00
state_prefetcher.go core: switch EVM tx context in ApplyMessage (#30809) 2024-11-29 15:39:42 +01:00
state_processor.go core/tracing: extends tracing.Hooks with OnSystemCallStartV2 (#30786) 2024-12-04 09:40:37 +01:00
state_processor_test.go core/types: updates for EIP-7702 API functions (#30933) 2024-12-18 19:10:53 +01:00
state_transition.go core/types: change SetCodeTx.ChainID to uint256 (#30982) 2025-01-14 06:42:18 -07:00
stateless.go cmd/evm: improve block/state test runner (#30633) 2024-12-02 15:18:02 +01:00
txindexer.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
txindexer_test.go core: use in-memory freezer for tests (#29720) 2024-05-08 09:43:33 +03:00
types.go all: implement flat deposit requests encoding (#30425) 2024-10-09 12:24:58 +02:00
verkle_witness_test.go cmd, core, miner: rework genesis setup (#30907) 2025-01-14 11:49:30 +01:00