feat: completing partial notes in private#14533
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
benesjan
commented
May 27, 2025
benesjan
commented
May 27, 2025
| context.emit_private_log( | ||
| self.compute_note_completion_log_padded_for_private_log(value), | ||
| NOTE_COMPLETION_LOG_LENGTH, | ||
| ); |
Contributor
Author
There was a problem hiding this comment.
I find the emit_private_log API on context quite weird as we kinda pass a BoundedVec here but not really. Shall we just change it to use BoundedVec? Then I would not have to do the ugly manual padding here.
benesjan
commented
May 27, 2025
benesjan
commented
May 27, 2025
|
|
||
| fn compute_note_completion_log(self, value: u128) -> [Field; 2] { | ||
| /// Completes the partial note, creating a new note that can be used like any other UintNote. | ||
| pub fn complete_from_private(self, value: u128, context: &mut PrivateContext) { |
Contributor
Author
There was a problem hiding this comment.
I don't perform to zero value check here like in public since it looks like we have the info of real private log length and hence the 0 value should not get trimmed. Can write a test for this if the reviewer is not sure if it's correct.
benesjan
commented
May 27, 2025
noir-projects/noir-contracts/contracts/app/token_contract/src/main.nr
Outdated
Show resolved
Hide resolved
Closed
112559e to
fbdfabe
Compare
0610d9f to
6c8ce5d
Compare
c254b4a to
9d0b171
Compare
989ed05 to
0f7d2b1
Compare
2a63440 to
d752a3d
Compare
0f7d2b1 to
3b5017b
Compare
d752a3d to
4bceb75
Compare
3b5017b to
65f6141
Compare
4bceb75 to
20f0948
Compare
20f0948 to
6dc9bba
Compare
6dc9bba to
a71342f
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 28, 2025
Public logs are prefixed with contract address and we were returning it like that from `get_public_log_by_tag`. This was annoying as private logs are not prefixed with it forcing us to treat them differently in #14533. In this PR I drop the contract address and the tag from the return value of the oracle as it's not needed in `Aztec.nr`. Decided to drop the tag in the oracle response as opposed to dropping that in `Aztec.nr` as we directly map there `PublicLogWithTxData` from TS to Noir so dropping that in Noir would be weird. Fixes #10273 --------- Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
4df48b0 to
5ca9a2a
Compare
76050a2 to
ccdc5d5
Compare
0f55a96 to
982b0d2
Compare
benesjan
commented
May 29, 2025
982b0d2 to
4d1a1c6
Compare
0f856d3 to
3873ba1
Compare
nventuro
approved these changes
Jun 3, 2025
noir-projects/aztec-nr/aztec/src/messages/discovery/partial_notes.nr
Outdated
Show resolved
Hide resolved
| context.emit_private_log( | ||
| self.compute_note_completion_log_padded_for_private_log(value), | ||
| NOTE_COMPLETION_LOG_LENGTH, | ||
| ); |
noir-projects/noir-contracts/contracts/app/orderbook_contract/src/main.nr
Outdated
Show resolved
Hide resolved
3b43f78 to
f0e1778
Compare
…f public and private log lengths
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.

Fixes #14362
Implements partial note completion in private. This PR is quite big but I decided to just keep it like that because:
This prevented me from implementing the oracles, the partial note completion and Orderbook changes in 3 PRs as I needed them in one to verify it works.
UpdateMr. Nico said this is too ugly (😭) and that I should do #10273 firstThe above is addressed now.