Skip to content

feat: use BitArray for bit-packed trie node path encoding#21

Draft
weiihann wants to merge 1 commit into
ethereum:mainfrom
weiihann:feat/binary-trie/bitarray
Draft

feat: use BitArray for bit-packed trie node path encoding#21
weiihann wants to merge 1 commit into
ethereum:mainfrom
weiihann:feat/binary-trie/bitarray

Conversation

@weiihann

Copy link
Copy Markdown

Port the key encoding optimization from go-ethereum's binary trie (go-ethereum@c01a0eaa) to state-actor. Trie node DB keys now use bit-packed paths (ceil(depth/8) bytes) instead of byte-per-bit (depth bytes), reducing key size up to 8x.

Changes:

  • makePath uses bintrie.BitArray for bit-packed path construction
  • regroupTrieNodes rewritten with DFS-based depth tracking and BitArray child navigation (bit-packed paths are depth-ambiguous)
  • Stem move batch ordering: deletes before puts to prevent key collisions across depths
  • go.mod: replace directive for local go-ethereum with BitArray
  • Rename EnableVerkleAtGenesis -> EnableUBTAtGenesis (upstream API)
  • Update golden hashes for upstream big-endian slot key hashing

Depends on ethereum/go-ethereum#34772

Port the key encoding optimization from go-ethereum's binary trie
(go-ethereum@c01a0eaa) to state-actor. Trie node DB keys now use
bit-packed paths (ceil(depth/8) bytes) instead of byte-per-bit
(depth bytes), reducing key size up to 8x.

Changes:
- makePath uses bintrie.BitArray for bit-packed path construction
- regroupTrieNodes rewritten with DFS-based depth tracking and
  BitArray child navigation (bit-packed paths are depth-ambiguous)
- Stem move batch ordering: deletes before puts to prevent key
  collisions across depths
- go.mod: replace directive for local go-ethereum with BitArray
- Rename EnableVerkleAtGenesis -> EnableUBTAtGenesis (upstream API)
- Update golden hashes for upstream big-endian slot key hashing
@weiihann weiihann marked this pull request as draft April 20, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant