refactor: deduplicate MembershipWitness struct#21244
Merged
benesjan merged 1 commit intomerge-train/fairiesfrom Mar 10, 2026
Merged
refactor: deduplicate MembershipWitness struct#21244benesjan merged 1 commit intomerge-train/fairiesfrom
benesjan merged 1 commit intomerge-train/fairiesfrom
Conversation
…definition Remove the duplicate `MembershipWitness` struct from the aztec-nr oracle module and reuse the canonical one from `noir-protocol-circuits/types/merkle_tree/membership`. This also drops the unnecessary `M` generic parameter that was a workaround for a Noir type-system limitation that no longer exists. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
benesjan
commented
Mar 9, 2026
| @@ -17,8 +17,12 @@ unconstrained fn get_low_nullifier_membership_witness_oracle( | |||
| _nullifier: Field, | |||
| ) -> NullifierMembershipWitness {} | |||
Contributor
Author
There was a problem hiding this comment.
Unrelated change but the motivation for this was that the comment above get_nullifier_membership_witness was an incorrect copy from the comment above get_low_nullifier_membership_witness.
Contributor
Author
|
@LeilaWang is it fine to modify the circuits code here? Asking in case the code was already frozen or something. Thanks |
ludamad
pushed a commit
that referenced
this pull request
Mar 11, 2026
Collaborator
|
backport-later handled: cherry-picked to v4-next in #21341 |
Collaborator
|
❌ Failed to cherry-pick to |
AztecBot
pushed a commit
that referenced
this pull request
Mar 11, 2026
AztecBot
added a commit
that referenced
this pull request
Mar 11, 2026
The cherry-pick of #21244 only resolved the conflict region (first oracle name), but missed renaming utilityGetBlockHashMembershipWitness to aztec_utl_getBlockHashMembershipWitness.
benesjan
added a commit
that referenced
this pull request
Mar 11, 2026
This was referenced Mar 11, 2026
benesjan
added a commit
that referenced
this pull request
Mar 12, 2026
ludamad
pushed a commit
that referenced
this pull request
Mar 12, 2026
nventuro
added a commit
that referenced
this pull request
Mar 13, 2026
## Summary - Backports 5 PRs from `merge-train/fairies` related to oracle changes: - #21101 - feat: improve oracle name prefixes - #21349 - fix: skip oracle version check for pinned protocol contracts - #21244 - refactor: deduplicate MembershipWitness struct - #21176 - feat(pxe)!: pass BoundedVec sizes as oracle params - #21209 - refactor!: cleaning up public call and tx phase related oracles ## Test plan - CI passes on backport branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Nicolas Chamo <nicolas@chamo.com.ar> Co-authored-by: benesjan <benesjan@users.noreply.github.com>
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.
We had a superfluous generic param
Mdefined onMembershipWitnesstype that was there probably because of some old Noir issue. Dropping it now resulted in the code normally compiling. Given that we already hadMembershipWitnessdefined in protocol types I dropped the Aztec.nr version and use just the one from types.Tackling this now as I am going through the oracles cleanup that is tracked by this issue.
AI Summary
MembershipWitness<N, M>struct fromaztec-nr/oracle/get_membership_witness.nrand reuse the canonicalMembershipWitness<N>fromnoir-protocol-circuits/types/merkle_tree/membershipMgeneric parameter (was a workaround for a Noir limitation that no longer exists)Deserialize/Serializederives to the protocol-circuitsMembershipWitnessso it works with oracle deserialization