mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-15 03:11:36 +00:00
Master added (via PR #34754) a dirty bool to InternalNode/StemNode plus a CollectNodes short-circuit that skips clean subtrees — the arena branch diverged before that landed. Port the semantics onto the arena shape: - Add dirty bool to InternalNode and StemNode. - Wire dirty=true alongside every existing mustRecompute=true setter in node_store.go (newInternalRef, newStemRef) and store_ops.go (8 mutation sites across InsertSingle/insertSingleInternal/InsertValuesAtStem/ insertValuesAtStem/splitStemInsert/splitStemValuesInsert). - Add 'if !node.dirty { return nil }' gate at the top of CollectNodes for both KindInternal and KindStem; clear dirty after flushfn runs. - Plumb a dirty parameter through deserializeNode; DeserializeNode passes dirty=true (safe default), DeserializeNodeWithHash passes dirty=false (loaded from disk, blob matches). The arena test in trie_test.go that was auto-merged from master used master-shape struct literals (tr.root, NewBinaryNode) that don't exist on arena; delete those and replace with TestCommitSkipCleanSubtrees, an arena-native version that asserts first-Commit flushes all nodes, no-op Commit flushes none, and single-leaf Commit flushes only the root-to-leaf path. |
||
|---|---|---|
| .. | ||
| binary_node.go | ||
| binary_node_test.go | ||
| hashed_node.go | ||
| hashed_node_test.go | ||
| hasher.go | ||
| internal_node.go | ||
| internal_node_test.go | ||
| iterator.go | ||
| iterator_test.go | ||
| key_encoding.go | ||
| node_ref.go | ||
| node_store.go | ||
| stem_node.go | ||
| stem_node_test.go | ||
| store_commit.go | ||
| store_ops.go | ||
| trie.go | ||
| trie_test.go | ||