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
If SmallerNote is modified and has more entries than BiggerNote, then the preimage length needs to be changed. This is, afaik, undocumented, a bit bizarre, and leads to "Error: Mandatory implementation of "compute_note_hash_and_nullifier" missing" while it isn’t, in fact, missing:
unconstrained fncompute_note_hash_and_nullifier(contract_address:Field,nonce:Field,storage_slot:Field,preimage:[Field;BIGGER_NOTE_LEN]) -> [Field;4]{let note_header = NoteHeader::new(contract_address, nonce, storage_slot);if(storage_slot == 1){// BiggerNote has BIGGER_NOTE_LEN elements
note_utils::compute_note_hash_and_nullifier(BiggerNoteMethods, note_header, preimage)}else{// If this note "grows", 'preimage: [Field, BIGGER_NOTE_LEN]' isn't correct anymore
note_utils::compute_note_hash_and_nullifier(SmallerNoteMethods, note_header, preimage)}}
Closes#3012
# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Reported by @0xShaito from Wonderland
The text was updated successfully, but these errors were encountered: