refactor: moving emit_note func, nuking redundant check#16889
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
benesjan
commented
Sep 9, 2025
| } | ||
|
|
||
| fn compute_ciphertext<Note>( | ||
| pub fn compute_note_message_ciphertext<Note>( |
Contributor
Author
There was a problem hiding this comment.
Renamed this function as now it's exposed and felt like it should be more descriptive. It uses "message ciphertext" naming that I just introduced in my other PR.
benesjan
commented
Sep 9, 2025
| } | ||
|
|
||
| // TODO(#16881): once partial notes support emission via an off-chain message we will most likely want to remove this. | ||
| pub fn compute_partial_note_log<Note>( |
Contributor
Author
There was a problem hiding this comment.
I expect this to be nuked once partial notes support message emission as an off-chain message as then, in the implementation of the partial note, we will need to handle the 2 delivery modes and that will result in us needing to control when to prefix the message ciphertext with tag and when not.
emit_note func, nuking redundant check
nventuro
approved these changes
Sep 9, 2025
As I mentioned [here](#16091 (comment)) makes sense to move the `emit_note` function directly to the `NoteEmission` struct as that was the only callsite of the function. This allowed me to nuke the old ugly `assert_note_exists` check in [this commit ](https://github.com/AztecProtocol/aztec-packages/pull/16889/commits/8570bd3e0d4d1fa04fad2b0e0437b2d84809ce12)as now the API guarantees that we are emitting a real note. This makes this change a huge win in my opinion. Closes #8589.
8570bd3 to
e986ade
Compare
ludamad
pushed a commit
that referenced
this pull request
Dec 16, 2025
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.

As I mentioned here makes sense to move the
emit_notefunction directly to theNoteEmissionstruct as that was the only callsite of the function. This allowed me to nuke the old uglyassert_note_existscheck in this commit as now the API guarantees that we are emitting a real note. This makes this change a huge win in my opinion.Closes #8589.