Skip to content

Commit

Permalink
fix: handling low_nullifier.next_value equal to 0 (#3562)
Browse files Browse the repository at this point in the history
Fixes #3550
  • Loading branch information
benesjan committed Dec 5, 2023
1 parent 6c704a5 commit c800502
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ contract InclusionProofs {
GENERATOR_INDEX__PUBLIC_LEAF_INDEX,
},
oracle::{
get_block_header::get_block_header,
get_membership_witness::{
get_membership_witness,
MembershipWitness,
Expand Down Expand Up @@ -185,9 +184,9 @@ contract InclusionProofs {
);

// 5.c) Prove that the low nullifier is pointing "over" the nullifier to prove that the nullifier is not
// included in the nullifier tree
// included in the nullifier tree (or to 0 if the to-be-inserted nullifier is the largest of all)
assert(
full_field_greater_than(witness.leaf_data.next_value, nullifier),
full_field_greater_than(witness.leaf_data.next_value, nullifier) | (witness.leaf_data.next_index == 0),
"Proving nullifier non-inclusion failed: low_nullifier.next_value > nullifier.value check failed"
);

Expand Down

0 comments on commit c800502

Please sign in to comment.