Skip to content

refactor: moving emit_note func, nuking redundant check#16889

Merged
benesjan merged 1 commit into
nextfrom
09-09-refactor_moving_emit_note_func
Sep 9, 2025
Merged

refactor: moving emit_note func, nuking redundant check#16889
benesjan merged 1 commit into
nextfrom
09-09-refactor_moving_emit_note_func

Conversation

@benesjan

@benesjan benesjan commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

As I mentioned here 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 as now the API guarantees that we are emitting a real note. This makes this change a huge win in my opinion.

Closes #8589.

benesjan commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

}

fn compute_ciphertext<Note>(
pub fn compute_note_message_ciphertext<Note>(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

}

// 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>(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@benesjan benesjan marked this pull request as ready for review September 9, 2025 10:35
@benesjan benesjan changed the title refactor: moving emit_note func refactor: moving emit_note func, nuking redundant check Sep 9, 2025
@fcarreiro fcarreiro removed their request for review September 9, 2025 11:16
@benesjan benesjan changed the title refactor: moving emit_note func, nuking redundant check refactor: moving emit_note func, nuking redundant check Sep 9, 2025
@benesjan benesjan requested review from Thunkar and nventuro September 9, 2025 13:18
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.
@AztecBot AztecBot force-pushed the 09-09-refactor_moving_emit_note_func branch from 8570bd3 to e986ade Compare September 9, 2025 13:39
@benesjan benesjan added this pull request to the merge queue Sep 9, 2025
Merged via the queue into next with commit a24d1b9 Sep 9, 2025
16 checks passed
@benesjan benesjan deleted the 09-09-refactor_moving_emit_note_func branch September 9, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use type system to skip "note has been inserted" check

3 participants