mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 18:01:36 +00:00
PathDB keys diff layers by state root, not by block hash. A side-chain block can legitimately collide with an existing canonical diff layer when both blocks produce the same post-state (same parent, same coinbase, no txs). layerTree.add blindly overwrites tree.layers[root] in this case, corrupting the parent chain for any child layers already built on top of the existing one and appending a duplicate root to the lookup indices so that accountTip/storageTip resolve the wrong diff layer. Make duplicate-root inserts idempotent: a second layer with an already- present state root carries no new retrievable state, so keeping the original layer preserves the existing parent chain and avoids polluting the lookup history. |
||
|---|---|---|
| .. | ||
| database | ||
| hashdb | ||
| pathdb | ||
| database.go | ||
| history.go | ||
| preimages.go | ||
| preimages_test.go | ||
| states.go | ||