You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compute_hash_and_nullifier typically always attempts to produce a result, regardless of the validity of the inputs. While it's not possible to check if a given storage slot is valid due to how Maps dynamically allocate them, we can instead check the validity of note type ids (introduced in #4500) and error out on uknown ones, simplfying the debugging process.
An even more sophisticated version of this might try to check that the note type id and storage slot match, though this won't be doable for state variables such as maps.
The text was updated successfully, but these errors were encountered:
LHerskind
changed the title
Error out when computing hash for unknown notes
refactor(AztecMacro): Error out when computing hash for unknown notes
Mar 8, 2024
Closes#4520.
I did some work adding tests for this, but ultimately decided to go back
on it. We don't really have any tests for other parts of the `addNotes`
flow (such as the checks for note existence, inclusion in the provided
tx, non-nullification, etc.), and this didn't feel like the right place
to work on those.
We definitely should however. Part of the problem is that writing a
contract that allows for manual note creation, deletion and retrieval
from a test is quite annoying - I did some of this in `TestContract` for
#4238. For this we'd also need to have different functions for different
note types, and even then some of these notes can only be added
automatically via broadcast due to the random values in the note.
compute_hash_and_nullifier
typically always attempts to produce a result, regardless of the validity of the inputs. While it's not possible to check if a given storage slot is valid due to howMap
s dynamically allocate them, we can instead check the validity of note type ids (introduced in #4500) and error out on uknown ones, simplfying the debugging process.An even more sophisticated version of this might try to check that the note type id and storage slot match, though this won't be doable for state variables such as maps.
The text was updated successfully, but these errors were encountered: