Skip to content

Subtree cleanups - #35

Merged
buffrr merged 3 commits into
spacesprotocol:mainfrom
buffrr:subtree-cleanups
Aug 4, 2026
Merged

Subtree cleanups#35
buffrr merged 3 commits into
spacesprotocol:mainfrom
buffrr:subtree-cleanups

Conversation

@buffrr

@buffrr buffrr commented Aug 4, 2026

Copy link
Copy Markdown
Member

No description provided.

buffrr added 3 commits August 4, 2026 11:50
Same bug as the main tree's prove_nodes: keys diverging from an
internal node's prefix with a 0 bit sort before the matching band,
so the one-sided partition_point dropped every matching key whenever
a diverge-left key came first, breaking chained proofs.
The non-aligned branch guarded the next-byte read with i < a.len()
while indexing a[i + 1], panicking whenever a comparison scanned to
self's last byte — e.g. any lookup in a tree where two keys share a
~255-bit prefix. Leaving the low bits zero is safe: a mismatch they
introduce lies beyond max_bit_len and is clamped away.
Delete now rejects keys diverging from an internal node's prefix with
KeyNotFound instead of descending and surfacing IncompleteProof at a
hash node. Merge no longer absorbs interior None nodes — a proof that
cannot compute its own root must not merge into a valid-looking one.
@buffrr
buffrr merged commit 8c2c986 into spacesprotocol:main Aug 4, 2026
8 checks passed
@buffrr
buffrr deleted the subtree-cleanups branch August 4, 2026 15:22
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