Closed mrain closed 1 month ago
Change the verifications APIs to take a Merkle commitment instead of a simple root digest.
Why is this needed?
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
And make sure that users won't miss this check: https://github.com/EspressoSystems/zkrollup-integration/blob/89e86d0ea3f6ea25b92e310d131d177512b0ff80/sp1/program/src/main.rs#L82
Sorry but I don't understand this comment.
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. But I'm not quite sure whether it is necessary now. cc @alxiong
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.
True. Most of them are boilerplate. Changes in forget_internal()
and remember_internal()
may require additional care. But they are all covered by unit tests. And this is also kind of internal audit.
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. But I'm not quite sure whether it is necessary now. cc @alxiong
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 BlockMerkleTree::verify()
🤔
meanwhile, I agree it's unclear from API design that why we need this check outside, instead of being part of BlockMerkleTree::verify() 🤔
Therefore it's checked inside verify()
now.
My point is, as we are supplying the leaf information to verify()
, is the height check still necessary to prevent the extension attack?
- Why are we completely removing
namespaced_merkle_tree
?
Because it's no longer in use and takes too much efforts to refactor.
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? I thought might be useful to keep a NMT, if the effort is high, we can do it in a separate PR?
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? I thought might be useful to keep a NMT, if the effort is high, we can do it in a separate PR?
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.
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? I thought might be useful to keep a NMT, if the effort is high, we can do it in a separate PR?
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.
Also do you think we should merge #685 together? cc @alxiong @ggutoski
Also do you think we should merge https://github.com/EspressoSystems/jellyfish/pull/685 together?
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.
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