-
Notifications
You must be signed in to change notification settings - Fork 106
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
ZIP-221: Integrate history merkle mountain range from librustzcash #2132
Comments
After studying the librustzcash implementation, I'm not sure what is the best approach here. I'm writing it down just to make it clearer but we can discuss it further in chat librustzcash only provides a mechanism to create a MMR tree from a vector of MMR peaks and to add/delete nodes to it. But it is not intended to be used as a data structure to keep around. zcash uses it like this, from what I could gather, when e.g. there is a new block to be added:
We could certainly use the same approach, but librustzcash will solve only part of the problem. Therefore, we need to decide what will be our approach in order for us to proceed on this issue... To be more concrete, regarding the tasks in the issue:
|
In general, we want to do the easiest thing that lets us to #2134 and #2135. But we can definitely chat about the details. |
Part of this (only the wrapper) was implemented in #2227 Another part (keeping track of what needs to be persisted) will be implemented in a separate PR (should we split the issue too?) |
👍
I moved the remaining persistent state task to #2134, which deals with the finalized state. So we can close this ticket when #2227 merges. |
Is your feature request related to a problem? Please describe.
Part of the work to implement ZIP-221 will involve integrating the history merkle mountain range (MMR) from librustzcash into Zebra.
The goal of this PR is to provide a Zebra-specific API for #2134 and #2135 with tests. (But we want to implement the state changes in #2134 and #2135 in separate PRs.)
Describe the solution you'd like
Create a
zebra_chain::primitives::zcash_history
moduleCreate a
zebra_chain::primitives::zcash_history
MMR data type:HashMap<u32, Entry>
Make functions for:
NodeData
from a ZebraBlock
zebra_chain::primitives::zcash_primitives
for the similar code for transactionszcash_history
MMR -Tree::new
Tree::append_leaf
Tree::truncate_leaf
Tree::root_node().data().hash()
Write tests for:
BLOCKS
test vectorsAdditional context
See #2091 (comment) for more details
The text was updated successfully, but these errors were encountered: