go-ethereum/trie/bintrie
Ng Wei Han 73eeee65bf
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772)
Replace 1-byte-per-bit path encoding with bit-packed `BitArray`,
reducing DB key size by 8x

Benchmark (sparse single-leaf write, M3 Pro):
```
                           │  Before (1B/bit)  │  After (BitArray)  │
                           │      sec/op       │  sec/op   vs base  │
CollectNodesSparseWrite-11        10.50µ ± 1%   9.78µ ± 1%  -6.86%
                           │       B/op        │   B/op    vs base  │
CollectNodesSparseWrite-11       5.50Ki ± 0%   5.09Ki ± 0%  -7.38%
                           │    allocs/op      │ allocs   vs base   │
CollectNodesSparseWrite-11          67 ± 0%       58 ± 0%  -13.43%
```

---------

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2026-06-22 22:26:17 +02:00
..
binary_node.go trie: group 2^N binary trie nodes in serialization (#34794) 2026-05-01 15:28:19 +02:00
binary_node_test.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
bitarray.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
bitarray_test.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
format_test.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
hashed_node.go trie/bintrie: replace BinaryNode interface with GC-free NodeRef arena (#34055) 2026-04-20 14:08:30 +02:00
hashed_node_test.go trie: group 2^N binary trie nodes in serialization (#34794) 2026-05-01 15:28:19 +02: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: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
internal_node_test.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
iterator.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
iterator_test.go trie/bintrie: replace BinaryNode interface with GC-free NodeRef arena (#34055) 2026-04-20 14:08:30 +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: replace BinaryNode interface with GC-free NodeRef arena (#34055) 2026-04-20 14:08:30 +02:00
node_store.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
recorder.go trie/bintrie: record inserted leaves for t8n (#34843) 2026-05-28 17:06:47 +02:00
recorder_test.go trie/bintrie: record inserted leaves for t8n (#34843) 2026-05-28 17:06:47 +02:00
stem_node.go trie/bintrie: replace BinaryNode interface with GC-free NodeRef arena (#34055) 2026-04-20 14:08:30 +02:00
stem_node_test.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
store_commit.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
store_ops.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
trie.go trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
trie_test.go trie: group 2^N binary trie nodes in serialization (#34794) 2026-05-01 15:28:19 +02:00