go-ethereum/trie/bintrie
CPerezz 939b36345f
trie/bintrie: port dirty flag + CollectNodes skip-clean from master
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.
2026-04-18 18:45:12 +02:00
..
binary_node.go fix: Strip group-depth from GC 2026-04-18 18:38:35 +02:00
binary_node_test.go fix: Strip group-depth from GC 2026-04-18 18:38:35 +02:00
hashed_node.go trie/bintrie: use type alias for HashedNode 2026-04-18 18:38:37 +02:00
hashed_node_test.go fix: Strip group-depth from GC 2026-04-18 18:38:35 +02:00
hasher.go Update trie/bintrie/hasher.go 2026-04-18 18:38:37 +02:00
internal_node.go trie/bintrie: port dirty flag + CollectNodes skip-clean from master 2026-04-18 18:45:12 +02:00
internal_node_test.go fix: Strip group-depth from GC 2026-04-18 18:38:35 +02:00
iterator.go trie/bintrie: restore load-bearing iterator doc comments 2026-04-18 18:38:38 +02:00
iterator_test.go trie/bintrie: gofmt 2026-04-18 18:38:37 +02:00
key_encoding.go trie/bintrie: spec change, big endian hashing of slot key (#34670) 2026-04-13 09:42:37 +02:00
node_ref.go trie/bintrie: update copyright year on newly added files 2026-04-18 18:38:37 +02:00
node_store.go trie/bintrie: port dirty flag + CollectNodes skip-clean from master 2026-04-18 18:45:12 +02:00
stem_node.go trie/bintrie: port dirty flag + CollectNodes skip-clean from master 2026-04-18 18:45:12 +02:00
stem_node_test.go fix: Strip group-depth from GC 2026-04-18 18:38:35 +02:00
store_commit.go trie/bintrie: port dirty flag + CollectNodes skip-clean from master 2026-04-18 18:45:12 +02:00
store_ops.go trie/bintrie: port dirty flag + CollectNodes skip-clean from master 2026-04-18 18:45:12 +02:00
trie.go trie/bintrie: gofmt 2026-04-18 18:38:37 +02:00
trie_test.go trie/bintrie: port dirty flag + CollectNodes skip-clean from master 2026-04-18 18:45:12 +02:00