go-ethereum/eth
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
..
catalyst beacon/engine: check for empty requests (#31010) 2025-01-15 11:45:20 -07:00
downloader metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
ethconfig eth/downloader: move SyncMode to package eth/ethconfig (#30847) 2024-12-03 09:30:26 +01:00
fetcher eth/fetcher: fix blob transaction propagation (#30125) 2024-09-06 13:32:01 +03:00
filters core, eth, node: break rawdb -> {leveldb, pebble} dependency (#30689) 2024-10-29 10:31:04 +02:00
gasestimator internal/ethapi: add block override to estimateGas (#30695) 2024-12-12 12:39:03 +01:00
gasprice eth/gasprice: ensure cache purging goroutine terminates with subscription (#31025) 2025-01-14 16:26:24 +01:00
protocols eth/protocols/eth: prevent hanging dispatch (#30918) 2025-01-06 16:31:53 +01:00
tracers all: fix some typos in comments and names (#31023) 2025-01-14 14:16:15 +01:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go core, eth, internal, cmd: rework EVM constructor (#30745) 2024-11-20 12:35:52 +01:00
api_debug.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
api_debug_test.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go eth/downloader: move SyncMode to package eth/ethconfig (#30847) 2024-12-03 09:30:26 +01:00
bloombits.go eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
handler.go metrics, cmd/geth: change init-process of metrics (#30814) 2024-12-10 13:27:29 +01:00
handler_eth.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
handler_eth_test.go eth/downloader: move SyncMode to package eth/ethconfig (#30847) 2024-12-03 09:30:26 +01:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go eth/downloader: move SyncMode to package eth/ethconfig (#30847) 2024-12-03 09:30:26 +01:00
peer.go eth: remove admin.peers[i].eth.head and difficulty (#26804) 2023-03-06 09:27:46 +02:00
peerset.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
state_accessor.go all: implement state history v2 (#30107) 2025-01-17 02:59:02 +01:00
sync.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
sync_test.go eth/protocols/eth: prevent hanging dispatch (#30918) 2025-01-06 16:31:53 +01:00