diff --git a/yarn-project/aztec-nr/aztec/src/history/note_inclusion.nr b/yarn-project/aztec-nr/aztec/src/history/note_inclusion.nr index 599cb0cc727..b4170fde8c9 100644 --- a/yarn-project/aztec-nr/aztec/src/history/note_inclusion.nr +++ b/yarn-project/aztec-nr/aztec/src/history/note_inclusion.nr @@ -10,7 +10,7 @@ use crate::{ oracle::get_membership_witness::get_note_hash_membership_witness, }; -fn _note_inclusion(note: Note, header: Header) where Note: NoteInterface { +pub fn _note_inclusion(note: Note, header: Header) where Note: NoteInterface { // 1) Compute note_hash let note_hash = compute_note_hash_for_consumption(note); diff --git a/yarn-project/aztec-nr/aztec/src/history/note_validity.nr b/yarn-project/aztec-nr/aztec/src/history/note_validity.nr index 192c4c985d8..916e6ff16ef 100644 --- a/yarn-project/aztec-nr/aztec/src/history/note_validity.nr +++ b/yarn-project/aztec-nr/aztec/src/history/note_validity.nr @@ -2,11 +2,14 @@ use crate::{ context::PrivateContext, history::{ note_inclusion::prove_note_inclusion, - note_inclusion::prove_note_inclusion_at, + note_inclusion::_note_inclusion, nullifier_non_inclusion::prove_note_not_nullified, - nullifier_non_inclusion::prove_note_not_nullified_at, + nullifier_non_inclusion::_nullifier_non_inclusion, + }, + note::{ + utils::compute_siloed_nullifier, + note_interface::NoteInterface, }, - note::note_interface::NoteInterface, }; pub fn prove_note_validity(note: Note, context: &mut PrivateContext) where Note: NoteInterface { @@ -20,6 +23,10 @@ pub fn prove_note_validity_at( block_number: u32, context: &mut PrivateContext ) where Note: NoteInterface { - prove_note_inclusion_at(note, block_number, *context); - prove_note_not_nullified_at(note, block_number, context); + // We are calling the internal functions here because we want to avoid calling get_header_at twice + let header = context.get_header_at(block_number); + _note_inclusion(note, header); + + let nullifier = compute_siloed_nullifier(note, context); + _nullifier_non_inclusion(nullifier, header); } diff --git a/yarn-project/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr b/yarn-project/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr index 09c030da43e..5568321fbd2 100644 --- a/yarn-project/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr +++ b/yarn-project/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr @@ -14,7 +14,7 @@ use crate::{ }, }; -fn _nullifier_non_inclusion(nullifier: Field, header: Header) { +pub fn _nullifier_non_inclusion(nullifier: Field, header: Header) { // 1) Get the membership witness of a low nullifier of the nullifier let witness = get_low_nullifier_membership_witness(header.global_variables.block_number as u32, nullifier);