Skip to content

feat!: make unused msg disco fns private#20831

Merged
nventuro merged 4 commits intomerge-train/fairiesfrom
nico/f-358-make-msg-discovery-functions-private
Feb 27, 2026
Merged

feat!: make unused msg disco fns private#20831
nventuro merged 4 commits intomerge-train/fairiesfrom
nico/f-358-make-msg-discovery-functions-private

Conversation

@nventuro
Copy link
Contributor

I adjusted some docs of public functions and made some that were pub into pub(crate), since users should not need to use them.

@benesjan benesjan marked this pull request as draft February 26, 2026 05:08
@@ -36,7 +36,7 @@ pub unconstrained fn process_private_note_msg<Env>(

/// Attempts discovery of a note given information about its contents and the transaction in which it is suspected the
/// note was created.
pub unconstrained fn attempt_note_discovery<Env>(
pub(crate) unconstrained fn attempt_note_discovery<Env>(
Copy link
Contributor

@benesjan benesjan Feb 26, 2026

Choose a reason for hiding this comment

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

I wanted to merge this PR but then after rebasing it did not compile. It turns out that this was broken to begin with because the token blacklist contract uses this function in the custom process_transparent_note method.

The transparent note flow is very archaic but it was kept around for demonstration purposes so I think it would be fine to just get rid of that.

But anyway makes sense to revert this smol change here and handle that in a followup if deemed desirable.

Did the revert of this change in eab8bd2

@benesjan benesjan force-pushed the nico/f-358-make-msg-discovery-functions-private branch from cf394d6 to eab8bd2 Compare February 26, 2026 05:21
Copy link
Contributor

benesjan commented Feb 26, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

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

LGTM

/// This is `None` if the nullifier cannot be computed (e.g., because the nullifier hiding key is not available).
/// The result of [`crate::note::note_interface::NoteHash::compute_nullifier_unconstrained`].
///
/// This value is unconstrained as all of message discovery is unconstrained. This is `None` if the nullifier
Copy link
Contributor

Choose a reason for hiding this comment

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

This change made the code un-compilable because the fields are directly used by generate_contract_library_method_compute_note_hash_and_nullifier.

Reverted this change as it makes sense to tackle in a followup.

/// The result of [`crate::note::note_interface::NoteHash::compute_nullifier_unconstrained`].
///
/// This value is unconstrained, as all of message discovery is unconstrained. It is `None` if the nullifier
/// cannot be computed (e.g. because the nullifier hiding key is not available).
Copy link
Contributor

Choose a reason for hiding this comment

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

I found it slightly confusing here that we mention that only this value is unconstrained even though whenever we use the NoteHashAndNullifier type even the note_hash is unconstrained.

I get what you mean though

@benesjan benesjan marked this pull request as ready for review February 26, 2026 05:52
@nventuro nventuro changed the base branch from next to merge-train/fairies February 26, 2026 19:43
@nventuro nventuro enabled auto-merge (squash) February 26, 2026 19:43
@nventuro nventuro merged commit 79e063f into merge-train/fairies Feb 27, 2026
11 checks passed
@nventuro nventuro deleted the nico/f-358-make-msg-discovery-functions-private branch February 27, 2026 21:07
@AztecBot
Copy link
Collaborator

❌ Failed to cherry-pick to v4 due to conflicts. Dispatching ClaudeBox to resolve. View backport run.

@AztecBot
Copy link
Collaborator

❌ Failed to cherry-pick to v4 due to conflicts. Dispatching ClaudeBox to resolve. View backport run.

johnathan79717 pushed a commit that referenced this pull request Mar 4, 2026
I adjusted some docs of public functions and made some that were `pub`
into `pub(crate)`, since users should not need to use them.

---------

Co-authored-by: benesjan <janbenes1234@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants