-
Notifications
You must be signed in to change notification settings - Fork 105
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
feat: refactor Merkle proof for ergonomics #692
Conversation
Why is this needed? |
I think it looks nicer. And make sure that users won't miss this check: https://github.com/EspressoSystems/zkrollup-integration/blob/89e86d0ea3f6ea25b92e310d131d177512b0ff80/sp1/program/src/main.rs#L82 |
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.
Thanks @mrain .
- I did not spot any issues but it's hard to follow the code from the diff.
- Anything specific to review with greater care? Seems like most changes are boilerplate: renaming variables, accommodating the removal of (index, element) from merkle proof, etc.
- @alxiong should review the gadget stuff. I'm unfamiliar with our gadget code.
Sorry but I don't understand this comment. |
This is an additional check that the height information is correct. With previous API users may forget. to do so.
True. Most of them are boilerplate. Changes in |
This is to ensure correct tree height is being used to prevent extension attack (i.e. find a root collision via much larger tree) meanwhile, I agree it's unclear from API design that why we need this check outside, instead of being part of |
Therefore it's checked inside |
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 agree with the trait changes.
- Why are we completely removing
namespaced_merkle_tree
?
Because it's no longer in use and takes too much efforts to refactor. |
wait, so we are not going to use them? are we sticking to using a normal MT with a Namespace table to delineate the boundary of different namespaces? |
No we are not. The namespace table now is just a plain vector with offsets @ggutoski I think it's better to bring back NMT on request. |
I was not even aware we have a NMT implementation. 😳 We don't need one IMO. We can revive it later if we find that we do need NMT. |
we should keep them as two PRs, but yeah, we can rebase that PR after this is merge and then got that one in as well. |
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.
In principle approval, LGTM. I'll let Gus have the final call.
closes: #642, #658
This PR:
MerkleProof
struct.This PR does not:
Key places to review:
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
CHANGELOG.md
of touched crates.Files changed
in the GitHub PR explorer