Skip to content

feat: completing partial notes in private#14533

Merged
benesjan merged 6 commits intonextfrom
05-26-feat_completing_partial_notes_in_private
Jun 3, 2025
Merged

feat: completing partial notes in private#14533
benesjan merged 6 commits intonextfrom
05-26-feat_completing_partial_notes_in_private

Conversation

@benesjan
Copy link
Copy Markdown
Contributor

@benesjan benesjan commented May 26, 2025

Fixes #14362

Implements partial note completion in private. This PR is quite big but I decided to just keep it like that because:

  1. we currently don't have a way to unit test oracles,
  2. testing partial notes flows in TXE test doesn't really work..

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.

Update

Mr. Nico said this is too ugly (😭) and that I should do #10273 first

The above is addressed now.

Copy link
Copy Markdown
Contributor Author

benesjan commented May 26, 2025

@benesjan benesjan changed the title feat:completing partial notes in private feat: completing partial notes in private May 26, 2025
context.emit_private_log(
self.compute_note_completion_log_padded_for_private_log(value),
NOTE_COMPLETION_LOG_LENGTH,
);
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 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Created #14709


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) {
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 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 benesjan mentioned this pull request May 27, 2025
@benesjan benesjan marked this pull request as ready for review May 27, 2025 10:16
@benesjan benesjan requested a review from nventuro May 27, 2025 10:51
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 112559e to fbdfabe Compare May 27, 2025 13:39
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from 0610d9f to 6c8ce5d Compare May 27, 2025 13:39
@benesjan benesjan marked this pull request as draft May 27, 2025 13:53
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch 2 times, most recently from c254b4a to 9d0b171 Compare May 27, 2025 14:27
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch 2 times, most recently from 989ed05 to 0f7d2b1 Compare May 27, 2025 14:37
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch 2 times, most recently from 2a63440 to d752a3d Compare May 27, 2025 14:47
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from 0f7d2b1 to 3b5017b Compare May 27, 2025 14:47
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from d752a3d to 4bceb75 Compare May 28, 2025 06:51
@benesjan benesjan force-pushed the 05-22-feat_simple_orderbook_dex branch from 3b5017b to 65f6141 Compare May 28, 2025 06:51
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 4bceb75 to 20f0948 Compare May 28, 2025 07:00
Base automatically changed from 05-22-feat_simple_orderbook_dex to next May 28, 2025 08:05
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 20f0948 to 6dc9bba Compare May 28, 2025 08:14
@benesjan benesjan changed the title feat: completing partial notes in private [NO MERGE] feat: completing partial notes in private May 28, 2025
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 6dc9bba to a71342f Compare May 28, 2025 14:21
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>
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 4df48b0 to 5ca9a2a Compare May 28, 2025 17:10
@benesjan benesjan changed the title [NO MERGE] feat: completing partial notes in private feat: completing partial notes in private May 28, 2025
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch 2 times, most recently from 76050a2 to ccdc5d5 Compare May 29, 2025 10:48
@benesjan benesjan marked this pull request as ready for review May 29, 2025 10:49
@benesjan benesjan marked this pull request as draft May 29, 2025 10:56
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 0f55a96 to 982b0d2 Compare May 29, 2025 11:38
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 982b0d2 to 4d1a1c6 Compare May 29, 2025 12:08
@benesjan benesjan marked this pull request as ready for review May 29, 2025 12:09
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 0f856d3 to 3873ba1 Compare June 2, 2025 07:53
context.emit_private_log(
self.compute_note_completion_log_padded_for_private_log(value),
NOTE_COMPLETION_LOG_LENGTH,
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Created #14709

@benesjan benesjan marked this pull request as draft June 3, 2025 06:28
@benesjan benesjan force-pushed the 05-26-feat_completing_partial_notes_in_private branch from 3b43f78 to f0e1778 Compare June 3, 2025 06:29
@benesjan benesjan marked this pull request as ready for review June 3, 2025 06:46
@benesjan benesjan enabled auto-merge June 3, 2025 06:48
@benesjan benesjan added this pull request to the merge queue Jun 3, 2025
Merged via the queue into next with commit 2078cf0 Jun 3, 2025
9 checks passed
@benesjan benesjan deleted the 05-26-feat_completing_partial_notes_in_private branch June 3, 2025 07:33
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.

Allow completing partial notes in private

2 participants