go-ethereum/triedb
Diego López León f74037c010
triedb/pathdb: skip duplicate-root layer insertion
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.
2026-04-02 19:39:33 -03:00
..
database trie: optimize memory allocation (#30932) 2025-03-25 14:59:44 +01:00
hashdb core, miner, tests: introduce codedb and simplify cachingDB (#33816) 2026-03-10 08:29:21 +01:00
pathdb triedb/pathdb: skip duplicate-root layer insertion 2026-04-02 19:39:33 -03:00
database.go core, eth, internal, triedb/pathdb: enable eth_getProofs for history (#32727) 2026-01-22 09:19:27 +08:00
history.go cmd, triedb: implement history inspection (#29267) 2024-03-22 20:12:10 +08:00
preimages.go all: remove the dependency from trie to triedb (#28824) 2024-02-13 14:49:53 +01:00
preimages_test.go triedb: add test suite for preimage store (#31574) 2025-05-05 14:01:53 +08:00
states.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00