Skip to content

fix(proof): reject truncated exclusion proofs#134

Open
mablr wants to merge 1 commit intoalloy-rs:mainfrom
mablr:fix/reject_truncated_exclusion_proofs
Open

fix(proof): reject truncated exclusion proofs#134
mablr wants to merge 1 commit intoalloy-rs:mainfrom
mablr:fix/reject_truncated_exclusion_proofs

Conversation

@mablr
Copy link
Copy Markdown
Contributor

@mablr mablr commented Feb 26, 2026

Problem

proof::verify_proof wrongly accepts a truncated proof as a valid proof-of-exclusion for a key that actually exists in the trie, because an incomplete path walk causes the remaining child-hash to be filtered to None, which then matches the None expected value.

Fix

Early return error if the walked path is a strict prefix of the key and there is still a pending node or value.

Added unit test.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Feb 26, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing mablr:fix/reject_truncated_exclusion_proofs (622ae9c) with main (e906098)

Open in CodSpeed

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