refactor: remove addNullifiedNote from pxe#11822
Merged
Conversation
5c19733 to
69bec66
Compare
3370666 to
e3b3a76
Compare
cceedb2 to
c97f0ac
Compare
sklppy88
commented
Feb 18, 2025
| } | ||
|
|
||
| /** | ||
| * Computes the inner nullifier of a note. |
Contributor
Author
There was a problem hiding this comment.
Seems like this was stale from before
a80a79e to
ba81b83
Compare
sklppy88
commented
Feb 18, 2025
| await acirSimulator.computeNoteHash(contractAddress, newNote.storageSlot, newNote.noteTypeId, newNote.note), | ||
| await acirSimulator.computeNoteHashAndNullifier( | ||
| contractAddress, | ||
| Fr.ZERO, |
Contributor
Author
There was a problem hiding this comment.
Previously computeNoteHash, which we removed from the simulator, was just passing Fr.ZERO here anyways.
ba81b83 to
5109c01
Compare
TomAFrench
added a commit
that referenced
this pull request
Feb 19, 2025
* master: (245 commits) chore: Fix unbound CI variable on release image bootstrap (#12095) fix: dry run on grind (#12088) fix(spartan): eth-execution logging (#12094) fix: aws_handle_evict recovery & termination (#12086) chore: Use native acvm when available on orchestrator tests (#11560) refactor: function macros cleanup (#12066) refactor: remove `addNullifiedNote` from pxe (#11822) fix: `#[aztec]` macro warnings (#12038) refactor!: Notes implementing `Packable<N>` (#12004) chore(ops): add gcloud cli into devbox base image (#12082) fix: hotfix grinding fix: L1 deployment on reth (#12060) fix: Add missing bootstrap fast aliases (#12078) fix: hash_str caching (#12074) fix: Naive attempt to fix nightly deployments (#12079) fix: kind smoke (#12084) refactor!: nuking `NoteHeader` (#11942) fix: inject dockerhub creds (#12072) feat(docs): Note discovery concepts page (#11760) chore: cleanup libp2p logger (#12058) ...
nventuro
added a commit
that referenced
this pull request
Feb 21, 2025
This removes the `addNote` function from PXE (`addNullifiedNote` had been removed in #11822). With this change, PXE no longer needs to understand how to compute note hashes and perform nonce discovery, which means we can also get rid of all of that code, _plus_ we can delete the mandatory `compute_note_hash_and_optionally_a_nullifier` contract function, _plus_ all of the auxiliary code used to call those. Instead, contracts that wish to deliver notes to their recipients via offchain mechanisms (i.e. not the protocol logs) must create custom unconstrained functions that know how to construct said notes and add them to PXE. For cases such as `TransparentNote`, where all of the note contents are public already, this is quite simple: `aztec::discovery::process_private_log` can be leveraged to a great degree by mimicking the log encoding aztec-nr uses - see the TokenBlacklist and Test contracts for examples of this. More fine grained control could be achieved by calling `aztec::discovery::attempt_note_nonce_discovery` and then the `deliver_note` oracle (which is essentially what `process_private_log` does, sans the decoding). The removal of `compute_note_hash_and_optionally_a_nullifier` freed us from some legacy burdens in having to produce the 4 field array, dealing with optional nullifier computation, etc., which in turn allowed for the contract library method `_compute_note_hash_and_optionally_a_nullifier` to be streamlined and converted into the new `compute_note_hash_and_nullifier`, which matches `aztec::discovery::ComputeNoteHashAndNullifier` and hence results in much easier use of the discovery functions. Tagging @critesjosh since `addNote` was quite a basic and old primitive. Closes #11638.
nventuro
added a commit
that referenced
this pull request
Mar 7, 2025
We got rid of `addNullifiedNote` in #11822, I imagine it accidentally came back in the recent refactors. I also got rid of `addNote` since we always use `addNotes` anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR removes
addNullifiedNotefrom the PXE as it is unused.It was also suggested to rework
getNoteHashAndOptionallyANullifierintogetNoteHashAndNullifier, in TS as now the second case where we don't get a nullifier is almost trivially used.I have kept
get_note_hash_and_optionally_a_nullifierin nr intact as I wasn't sure this desired changing. If so, I will do that in another PR to keep things relatively isolated.Resolves #11821