Skip to content

fix: avoid collision in PartialAccountTree#2598

Merged
igamigo merged 3 commits intorelease/v0.14.0-betafrom
igamigo-fix-partial-smt
Mar 16, 2026
Merged

fix: avoid collision in PartialAccountTree#2598
igamigo merged 3 commits intorelease/v0.14.0-betafrom
igamigo-fix-partial-smt

Conversation

@igamigo
Copy link
Collaborator

@igamigo igamigo commented Mar 12, 2026

PartialSmt::get_leaf returns Ok(SmtLeaf::Empty) for a provably empty space, which was causing errors in the node. Seems this changed with the recent migration to plonky 3 (noticed here) but track_account was not rewritten to account for this.

Seems like the original change was reviewed here.

This PR basically uses the same pattern that insert() uses for catching real collision cases. A (maybe more correct) alternative could be to add something like PartialSmt::has_explicit_leaf(&key) but that requires crypto changes.

@igamigo igamigo changed the title fix: avoid collision fix: avoid collision in PartialAccountTree Mar 12, 2026
@igamigo igamigo force-pushed the igamigo-fix-partial-smt branch from 2acc5bc to ac28f6a Compare March 13, 2026 17:59
@igamigo igamigo force-pushed the igamigo-fix-partial-smt branch from ac28f6a to 49519f3 Compare March 13, 2026 18:00
@igamigo igamigo marked this pull request as ready for review March 13, 2026 18:50
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you!

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the fix!

@igamigo igamigo merged commit c1c8e88 into release/v0.14.0-beta Mar 16, 2026
17 checks passed
@igamigo igamigo deleted the igamigo-fix-partial-smt branch March 16, 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.

3 participants