Commit graph

2 commits

Author SHA1 Message Date
weiihann
cb3e13d93d nomt/merkle: add Phase 7 parallel workers for trie updates
Parallelize the PageWalker trie update across multiple goroutines by
partitioning sorted operations by the root page's 64 child subtrees
(first 6 bits of each key path).

Each worker runs an independent PageWalker constrained to child pages
below the root (using parentPage mechanism), producing ChildPageRoots.
After all workers complete, a root walker places the child roots using
AdvanceAndPlaceNode and concludes with the final trie root.

Workers operate on disjoint page subtrees so no synchronization is
needed during computation — only sync.WaitGroup for goroutine join.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:37:42 +08:00
weiihann
cf10f3d997 nomt/db: add Phase 5 unified NOMT trie database
Implement the orchestration layer combining Bitbox storage with the
PageWalker merkle engine:
- DB.Open: creates/opens Bitbox HT file, runs WAL recovery
- DB.Update: sorts ops, runs PageWalker, persists via Bitbox sync
- DB.LoadPage: reads pages from Bitbox for NodeReader compatibility
- BitboxPageSet: PageSet implementation backed by on-disk Bitbox storage

The DB handles only trie structure (merkle pages). Flat key-value
storage stays on geth's PebbleDB via existing infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 17:18:31 +08:00