-
Notifications
You must be signed in to change notification settings - Fork 118
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
Store Sapling & Orchard note commitment trees in finalized and non-finalized state #3563
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hey team! Please add your planning poker estimate with ZenHub @conradoplg @dconnolly @gustavovalverde @jvff @oxarbitrage @teor2345 @upbqdn |
Aditya told us that ZecWallet requires every block's tree state for good performance. This will cost us about 1.5 GB for Sapling. |
Should the note commitment trees be included in the non-finalized state as well? |
I think so, since the non-finalized blocks can be queried too |
Note: We store and query Sprout note commitment trees by anchors, not heights. I updated the description of the issue so that it reflects this. Since #3156 will query the note commitment trees by heights, we will have to have two more column families in the database: I'm not going to include the Sprout note commitment trees because |
It looks like we already store sapling and orchard trees by height in the finalized state? zebra/zebra-state/src/service/finalized_state/zebra_db/shielded.rs Lines 260 to 270 in 699c062
|
I split out this optimisation task, because it's optional: But we might need it to get better performance. |
I realized I forgot to mention this issue in the corresponding PR, so it didn't get closed. Should we close this? |
Sure! I linked the PR and I'm closing this |
Motivation
For #3156 we need to be able to return a Sapling & Orchard tree state (a note commitment tree, represented as a frontier, like we already do) for multiple block heights.
However, while we do store the Sprout trees for every height, for Sapling and Orchard we only store it for the finalized tip (and also for non-finalized tips, in memory).ZecWallet Lite expects to have a tree state for every block from Sapling or Orchard activation, for good performance on first use.
We don't need to store them for every height sincez_gettreestate
supports askipHash
return value that requests the caller to look up a tree in a previous height. But we do need to store them every X blocks for some value of X.Designs
Follow Up Tasks
Optimisation:
The text was updated successfully, but these errors were encountered: