-
Notifications
You must be signed in to change notification settings - Fork 235
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
fix(merkle-tree): make sibling path generic over its length #647
Conversation
cleanup fix: missed occurences
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.
Tiny nits. Looks good to me.
🧚
|
||
// ensure the committed state is correct | ||
const initialSiblingPath = new SiblingPath([initialLeafHash, level1ZeroHash, level2ZeroHash]); | ||
const initialSiblingPath = new SiblingPath(3, [initialLeafHash, level1ZeroHash, level2ZeroHash]); |
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.
const initialSiblingPath = new SiblingPath(3, [initialLeafHash, level1ZeroHash, level2ZeroHash]); | |
const initialSiblingPath = new SiblingPath(TEST_TREE_DEPTH, [initialLeafHash, level1ZeroHash, level2ZeroHash]); |
height, | ||
), | ||
); | ||
return new MembershipWitness(height, index, assertLength(path.toFieldArray(), height)); |
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.
Do you know about this todo? Not fully clear to me what conversion it is related to.
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 dont think it applies anymore? The only number type here is the generic that will never be that big? @spalladino do you know if this is resolved?
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.
Yep, it seems it doesn't apply anymore. IIRC there was an explicit Number(bigintVariable)
here, but seems like it's gone (or moved elsewhere).
Description
Try to prevent: #639
More broadly part of: #645
Issues occurred when migrating the Nullifier Tree to a new location when the subtree and full tree heights were mixed up, leading to hard to decipher circuit messages.
This pr aims to prevent this issue by strongly typing the nullifier tree batch insertion method.
MembershipWitness
file in his msgpack work, SiblingPaths are now generic over their height and this height is checked.Buffer[]
->Fr[]
(path.data.map(f => Fr.fromBuffer(f))
yuck) have been replaced withSiblingPath.toFieldArray()
Checklist: