From 18f44a380c24a6a04708ad0c8ba38c91ef161c3f Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 7 Aug 2024 10:28:39 +0000 Subject: [PATCH] note and hash cleanup --- noir-projects/aztec-nr/aztec/src/note/note_and_hash.nr | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/noir-projects/aztec-nr/aztec/src/note/note_and_hash.nr b/noir-projects/aztec-nr/aztec/src/note/note_and_hash.nr index 4221e880a40..b9b6e49c744 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_and_hash.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_and_hash.nr @@ -1,6 +1,9 @@ -use crate::note::note_interface::NoteInterface; - +/// When obtaining notes via `get_notes(...)` a note hash is computed for each note when constraining it (and a read +/// request is created and passed to kernels). This same note hash (called note_hash_for_read_request) is needed when +/// removing notes. Since computing this hash is expensive and since it is needed when removing a note we return it +/// from the `get_notes(...)` function. The purpose of this struct is to couple the note and the note hash and make it +/// easier to pass these values around. struct NoteAndHash { note: Note, - hash: Field, + hash: Field, // (note_hash_for_read_request) }