mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-25 17:29:27 +00:00
The compact LSB-aligned encoding via ActiveBytes packed paths into ceil(len/8) bytes without recording the bit-length. Two distinct paths whose bit-lengths fell in the same byte-bucket and whose integer values matched produced identical bytes — e.g. the 1-bit path "1" and the 8-bit path "00000001" both encoded to [0x01], so two stems sitting at depths 1 and 8 on different branches could clobber each other in nodeset.AddNode. Replace ActiveBytes/PutActiveBytes with KeyBytes/PutKeyBytes, which append a uint8 bit-length byte after the active bytes. Postpend (rather than prepend) so nodes along a single root-to-leaf descent share leading path bytes, improving LSM block locality during traversal. The empty path is encoded as no bytes (not [0x00]): byteCount=0 is unique to len=0 so no disambiguation byte is needed. This keeps the root's DB key empty, matching the resolver's existing nil-path convention. |
||
|---|---|---|
| .. | ||
| binary_node.go | ||
| binary_node_test.go | ||
| bitarray.go | ||
| bitarray_test.go | ||
| hashed_node.go | ||
| hashed_node_test.go | ||
| hasher.go | ||
| internal_node.go | ||
| internal_node_test.go | ||
| iterator.go | ||
| iterator_test.go | ||
| key_encoding.go | ||
| node_ref.go | ||
| node_store.go | ||
| stem_node.go | ||
| stem_node_test.go | ||
| store_commit.go | ||
| store_ops.go | ||
| trie.go | ||
| trie_test.go | ||