go-ethereum/trie
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
..
bintrie trie/bintrie: use bitarray for path encoding + fix serialization issues (#34772) 2026-06-22 22:26:17 +02:00
transitiontrie cmd, core, trie, triedb: split CachingDB into merkle + binary dbs. (#34700) 2026-04-17 08:55:54 +08:00
trienode cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
bytepool.go core/types, trie: reduce allocations in derivesha (#30747) 2025-10-01 10:05:49 +02:00
committer.go trie/bintrie: add eip7864 binary trees and run its tests (#32365) 2025-09-01 21:06:51 +08:00
database_test.go trie: no need to store preimage if not enabled (#32012) 2025-06-13 15:04:24 +08:00
encoding.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
encoding_test.go trie: reduce allocs in recHash (#27770) 2023-08-18 22:41:19 +02:00
errors.go all: fix various typos (#29600) 2024-04-23 13:09:42 +03:00
hasher.go trie: reduce the memory allocation in trie hashing (#31902) 2025-08-01 10:23:23 +08:00
inspect.go cmd/geth: add inspect trie tool to analysis trie storage (#28892) 2026-02-24 10:56:00 -07:00
inspect_test.go cmd/geth: add inspect trie tool to analysis trie storage (#28892) 2026-02-24 10:56:00 -07:00
iterator.go trie: add sub-trie iterator support (#32520) 2025-09-17 22:07:02 +08:00
iterator_test.go all: fix all typos, as reported by crates-ci/typos (#35008) 2026-06-10 18:50:51 +02:00
levelstats.go core, miner, trie: relocate witness stats (#34106) 2026-03-27 17:06:46 +01:00
levelstats_test.go cmd/geth: add inspect trie tool to analysis trie storage (#28892) 2026-02-24 10:56:00 -07:00
list_hasher.go core/types, trie: reduce allocations in derivesha (#30747) 2025-10-01 10:05:49 +02:00
node.go triedb: reconcile stale storage roots in GenerateTrie, add cancel support (#34807) 2026-06-03 15:08:09 +08:00
node_enc.go trie: reduce the memory allocation in trie hashing (#31902) 2025-08-01 10:23:23 +08:00
node_test.go all: fix all typos, as reported by crates-ci/typos (#35008) 2026-06-10 18:50:51 +02:00
proof.go trie: error out for unexpected key-value pairs preceding the range (#33898) 2026-02-26 23:00:02 +08:00
proof_test.go trie: fix TestOneElementProof expected value message (#32738) 2025-09-24 18:57:01 -06:00
secure_trie.go cmd, core, trie, triedb: split CachingDB into merkle + binary dbs. (#34700) 2026-04-17 08:55:54 +08:00
secure_trie_test.go core/state, eth/protocols, trie, triedb/pathdb: remove unused error from trie Commit (#29869) 2024-06-12 12:23:16 +03:00
stacktrie.go triedb: reconcile stale storage roots in GenerateTrie, add cancel support (#34807) 2026-06-03 15:08:09 +08:00
stacktrie_fuzzer_test.go trie: do not expect ordering in stacktrie during fuzzing (#31170) 2025-02-18 10:48:42 +08:00
stacktrie_partial.go triedb: reconcile stale storage roots in GenerateTrie, add cancel support (#34807) 2026-06-03 15:08:09 +08:00
stacktrie_partial_test.go triedb: reconcile stale storage roots in GenerateTrie, add cancel support (#34807) 2026-06-03 15:08:09 +08:00
stacktrie_test.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
sync.go trie: cleaner array concatenation (#32756) 2025-10-02 17:32:20 +02:00
sync_test.go core, trie, triedb: minor changes from snapshot integration (#30599) 2024-10-18 17:06:31 +02:00
tracer.go trie/bintrie: add eip7864 binary trees and run its tests (#32365) 2025-09-01 21:06:51 +08:00
tracer_test.go trie, core/state: introduce trie Prefetch for optimizing preload (#32134) 2025-08-20 21:45:27 +08:00
trie.go core/types, trie: reduce allocations in derivesha (#30747) 2025-10-01 10:05:49 +02:00
trie_id.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
trie_reader.go trie/bintrie: add eip7864 binary trees and run its tests (#32365) 2025-09-01 21:06:51 +08:00
trie_test.go core, ethdb, triedb: add batch close (#33708) 2026-03-04 11:17:47 +01:00