go-ethereum/eth
rjl493456442 5adf4adc8e
eth/protocols/snap: cleanup dangling account trie nodes due to incomplete storage (#30258)
This pull request fixes #30229.
 
During snap sync, large storage will be split into several pieces and
synchronized concurrently. Unfortunately, the tradeoff is that the respective
merkle trie of each storage chunk will be incomplete due to the incomplete
boundaries. The trie nodes on these boundaries will be discarded, and any
dangling nodes on disk will also be removed if they fall on these paths,
ensuring the state healer won't be blocked.

However, the dangling account trie nodes on the path from the root to the
associated account are left untouched. This means the dangling account trie
nodes could potentially stop the state healing and break the assumption that the
entire subtrie should exist if the subtrie root exists. We should consider the
account trie node as the ancestor of the corresponding storage trie node.

In the scenarios described in the above ticket, the state corruption could occur
if there is a dangling account trie node while some storage trie nodes are
removed due to synchronization redo.

The fixing idea is pretty straightforward, the trie nodes on the path from root
to account should all be explicitly removed if an incomplete storage trie
occurs. Therefore, a `delete` operation has been added into `gentrie` to
explicitly clear the account along with all nodes on this path. The special
thing is that it's a cross-trie clearing. In theory, there may be a dangling
node at any position on this account key and we have to clear all of them.
2024-08-12 10:43:54 +02:00
..
catalyst eth/catalyst: get params.ExcessBlobGas but check with params.BlobGasUsed (#30267) 2024-08-05 11:14:22 -06:00
downloader eth/downloader, core/types: take withdrawals-size into account in downloader queue (#30276) 2024-08-08 15:14:00 +02:00
ethconfig ethconfig: regenerate config (#29970) 2024-06-11 20:34:56 +08:00
fetcher eth/fetcher: using slices.Contains (#29383) 2024-04-02 21:17:34 +02:00
filters eth/filters: remove support for pending logs (#29574) 2024-04-22 10:31:17 +02:00
gasestimator eth/gasestimator: include blobs in virtual balance computation (#29703) 2024-05-07 14:27:14 +02:00
gasprice eth/gasprice: remove default from config (#30080) 2024-07-22 15:58:53 +08:00
protocols eth/protocols/snap: cleanup dangling account trie nodes due to incomplete storage (#30258) 2024-08-12 10:43:54 +02:00
tracers eth/tracers, internal/ethapi: remove unnecessary map pointer in state override (#30094) 2024-07-25 01:01:59 +02:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go eth: Add eth_blobBaseFee RPC and blob fields to eth_feeHistory (#29140) 2024-04-22 12:17:06 +02:00
api_debug_test.go all: remove dependency on golang.org/exp (#29314) 2024-03-25 07:50:18 +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_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go eth/gasprice: remove default from config (#30080) 2024-07-22 15:58:53 +08:00
bloombits.go eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
handler_eth_test.go eth: fix typo (#29320) 2024-03-25 10:16:44 +08: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_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
handler.go eth, eth/downloader: remove references to LightChain, LightSync (#29711) 2024-05-28 19:52:08 +02: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 eth, eth/tracers: process beacon root before transactions (#29402) 2024-04-24 07:58:05 +02:00
sync_test.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
sync.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00