From 5b5287194270089e9cdaa9e6f8e050d512983b6a Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 5 Dec 2023 08:17:16 +0000 Subject: [PATCH 1/3] fix --- .../src/contracts/inclusion_proofs_contract/src/main.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr index 462f95091be..4e9c6306cf7 100644 --- a/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr @@ -187,7 +187,7 @@ 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 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_value == 0), "Proving nullifier non-inclusion failed: low_nullifier.next_value > nullifier.value check failed" ); From b2b8d861c5e992f17995ee9b34c6b491b4d6bc77 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 5 Dec 2023 09:28:13 +0000 Subject: [PATCH 2/3] import cleanup --- .../src/contracts/inclusion_proofs_contract/src/main.nr | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr index 4e9c6306cf7..9139d0b1a71 100644 --- a/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr @@ -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, From 275784ed8076d34756d2d026a57b5dc7dd00d819 Mon Sep 17 00:00:00 2001 From: benesjan Date: Tue, 5 Dec 2023 09:33:46 +0000 Subject: [PATCH 3/3] improved consistency --- .../src/contracts/inclusion_proofs_contract/src/main.nr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr index 9139d0b1a71..97121b4d577 100644 --- a/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/inclusion_proofs_contract/src/main.nr @@ -184,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) | (witness.leaf_data.next_value == 0), + 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" );