-
Notifications
You must be signed in to change notification settings - Fork 260
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
zcash_client_sqlite: Ensure that Orchard and Sapling checkpoints are always available for the same block heights. #1262
zcash_client_sqlite: Ensure that Orchard and Sapling checkpoints are always available for the same block heights. #1262
Conversation
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.
Flushing review comments as of e1c0f25
47a7f1a
to
ae3f56d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1262 +/- ##
==========================================
+ Coverage 63.26% 63.57% +0.31%
==========================================
Files 121 121
Lines 13509 13646 +137
==========================================
+ Hits 8547 8676 +129
- Misses 4962 4970 +8 ☔ View full report in Codecov by Sentry. |
cbb01e5
to
47866a7
Compare
force-pushed to address comments from code review & disable tests that require test framework changes. |
…anned range. In order to support constructing the anchor for multiple pools with a common anchor height, we must be able to checkpoint each note commitment tree (and consequently compute the root) at that height. Since we may not have the information in the tree needed to do so, we require that it be provided. As a bonus, this change makes it possible to improve the UX around spendability, because we will no longer require subtree ranges below received notes to be fully scanned; the inserted frontier provides sufficient information to make them spendable.
47866a7
to
fb46ff9
Compare
force-pushed to rebase on |
…ork behind the `orchard` flag.
fb46ff9
to
a046088
Compare
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.
utACK a046088
'a, | ||
H, | ||
I: Iterator<Item = &'a BlockHeight>, |
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.
Minor nit: I think the 'a, I: ..
can be inlined by making the argument
checkpoint_heights: impl Iterator<Item = &'_ BlockHeight>,
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 fooled around with a couple of things and couldn't get it to work, so went with the simple thing. :)
Missing a CHANGELOG addition for this? Ideally it would include not just the changed APIs, but a brief explanation of how to come up with the new |
@AArnott thanks for noticing, I'll fix this up. The conversion you want is https://github.com/zcash/librustzcash/blob/main/zcash_client_backend/src/proto.rs#L297-L307 |
This fixes an error that was causing it to be impossible to make cross-pool transactions when an anchor was needed for each pool, but alternating blocks held only Sapling or only Orchard notes. Prior to this fix, checkpoints were only created in the note commitment tree for a block for whatever pool had activity within that block; for example, if a block contained Orchard actions but no Sapling inputs or outputs, only an Orchard checkpoint was being created.
The fix for this issue requires that the initial tree state for each pool be available for each range of scanned blocks, so that we can be sure that we know the correct note commitment tree to position to checkpoint in that pool for a block that contains no inputs or outputs for the pool. As an ancillary benefit, this then will make the implementation of #982 trivial.