-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: nuke unused getSiblingPath
oracle
#11090
Conversation
const [leafIndex] = await this.aztecNode.findLeavesIndexes(blockNumber, treeId, [leafValue]); | ||
return leafIndex; | ||
} | ||
|
||
public async getSiblingPath(blockNumber: number, treeId: MerkleTreeId, leafIndex: bigint): Promise<Fr[]> { | ||
public async getMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made sense to have just getMembershipWitness
exposed here as that's what the consumers of the API really wanted.
getSiblingPath
oracle
Docs PreviewHey there! 👋 You can check your preview at https://677ee7e76011d91702e67928--aztec-docs-dev.netlify.app |
534de00
to
3a0060d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by this - it seems this oracle is only called in the following way:
pub unconstrained fn get_membership_witness<let N: u32, let M: u32>(
block_number: u32,
tree_id: Field,
leaf_value: Field,
) -> MembershipWitness<N, M> {
let fields: [Field; M] = get_membership_witness_oracle(block_number, tree_id, leaf_value);
MembershipWitness { index: fields[0], path: array::subarray(fields, 1) }
}
If we discard the leaf anyway, shouldn't we delete getMemberShipWitness
and replace it for getSiblingPath
instead? What's the purpose of the leaf index?
@nventuro The leaf index is used to figure out from which side to start hashing the sibling path and it's used for example here. Where did you see that the index get discarded? I could not find a callsite of the oracle where that happens. |
8cad9b9
to
67d8302
Compare
You're right, I misread the very snippet I pasted 🤦 |
3799b13
to
58da308
Compare
Made sense to nuke it as it was unused.
getMembershipWitness
oracle was used instead.