go-ethereum/trie/bintrie
CPerezz 2851f7b8c7
trie/bintrie: implement binaryNodeIterator.seek()
The bintrie node iterator previously discarded its `start` parameter,
forcing every iteration to begin at the root. This makes resumable
generators (snapshot/flat-state population) impossible — any
interruption restarts from scratch.

Implement seek(start []byte) by walking down the trie following start's
bit path, building the iterator stack as we go. When the chosen path
dead-ends (Empty, missing child, or a stem strictly less than start),
backtrack through the existing stack to find the next in-order subtree
and descend to its leftmost leaf.

Also wire BinaryTrie.NodeIterator(startKey) to actually pass startKey
through (was hardcoded to nil).

Tests cover: empty start (no-op), exact key match, between-keys,
into empty subtree, past end, within-stem offsets, resume simulation,
and deep tree.
2026-04-15 15:00:39 +02:00
..
binary_node.go trie/bintrie: cache hashes of clean nodes so as not to rehash the whole tree (#33961) 2026-03-06 18:06:24 +01:00
binary_node_test.go cmd/evm/internal/t8ntool, trie: support for verkle-at-genesis, use UBT, and move the transition tree to its own package (#32445) 2025-11-14 15:25:30 +01:00
empty.go trie/bintrie: cache hashes of clean nodes so as not to rehash the whole tree (#33961) 2026-03-06 18:06:24 +01:00
empty_test.go trie/bintrie: add eip7864 binary trees and run its tests (#32365) 2025-09-01 21:06:51 +08:00
hashed_node.go trie/bintrie: cache hashes of clean nodes so as not to rehash the whole tree (#33961) 2026-03-06 18:06:24 +01:00
hashed_node_test.go cmd/evm/internal/t8ntool, trie: support for verkle-at-genesis, use UBT, and move the transition tree to its own package (#32445) 2025-11-14 15:25:30 +01:00
hasher.go trie/bintrie: use a sync.Pool when hashing binary tree nodes (#33989) 2026-03-12 10:20:12 +01:00
internal_node.go trie/bintrie: parallelize InternalNode.Hash at shallow tree depths (#34032) 2026-03-18 13:54:23 +01:00
internal_node_test.go trie/bintrie: cache hashes of clean nodes so as not to rehash the whole tree (#33961) 2026-03-06 18:06:24 +01:00
iterator.go trie/bintrie: implement binaryNodeIterator.seek() 2026-04-15 15:00:39 +02:00
iterator_test.go trie/bintrie: implement binaryNodeIterator.seek() 2026-04-15 15:00:39 +02:00
key_encoding.go trie/bintrie: spec change, big endian hashing of slot key (#34670) 2026-04-13 09:42:37 +02:00
stem_node.go trie/bintrie: fix GetAccount/GetStorage non-membership — verify stem before returning values (#34690) 2026-04-10 19:43:48 +02:00
stem_node_test.go trie/bintrie: fix GetAccount/GetStorage non-membership — verify stem before returning values (#34690) 2026-04-10 19:43:48 +02:00
trie.go trie/bintrie: implement binaryNodeIterator.seek() 2026-04-15 15:00:39 +02:00
trie_test.go trie/bintrie: fix GetAccount/GetStorage non-membership — verify stem before returning values (#34690) 2026-04-10 19:43:48 +02:00