-
Notifications
You must be signed in to change notification settings - Fork 251
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
Migrations & data storage for pre-DAG-sync #831
Conversation
b9c1782
to
58412a1
Compare
59d712d
to
cea2917
Compare
e7bf6e1
to
785dd37
Compare
785dd37
to
a62a2e0
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.
Only cursory review so far.
0a75a07
to
e5c1386
Compare
e5c1386
to
cfd11f5
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #831 +/- ##
==========================================
+ Coverage 69.75% 70.23% +0.47%
==========================================
Files 124 127 +3
Lines 11618 11848 +230
==========================================
+ Hits 8104 8321 +217
- Misses 3514 3527 +13
☔ View full report in Codecov by Sentry. |
cfd11f5
to
5124572
Compare
Local chain validation will be performed internal to `scan_cached_blocks`, and as handling of chain reorgs will need to change to support out-of-order scanning, the `validate_chain` method will be superfluous. It is removed in advance of other changes in order to avoid updating it to reflect the forthcoming changes.
71ac466
to
c4e11e6
Compare
force-pushed to address comments from code review. |
In preparation for out-of-order range-based scanning, it is necessary to ensure that the size of the Sapling note commitment tree is carried along through the scan process and that stored blocks are always persisted with the updated note commitment tree size.
b2e742d
to
42ed6ba
Compare
force-pushed to fix an off-by-one error and fix |
}, | ||
)?; | ||
block_source.with_blocks::<_, DbT::Error>(scan_from, limit, |block: CompactBlock| { | ||
add_block_to_runner(params, block, &mut batch_runner); |
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.
It occurs to me that we should actually do the continuity check here, because there's no reason to add a block to the runner or continue the scan if the continuity check fails.
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've made this change in the forthcoming range-suggestions PR.
}; | ||
|
||
pub struct MockWalletDb { | ||
pub network: Network, | ||
pub sapling_tree: ShardTree< | ||
MemoryShardStore<sapling::Node, BlockHeight>, | ||
{ SAPLING_SHARD_HEIGHT * 2 }, |
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.
{ SAPLING_SHARD_HEIGHT * 2 }, | |
{ sapling::NOTE_COMMITMENT_TREE_DEPTH }, |
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.
Reviewed as of c363e71.
[patch.crates-io] | ||
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "082109deacf8611ee7917732e19b56158bda96d5" } | ||
shardtree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "082109deacf8611ee7917732e19b56158bda96d5" } | ||
orchard = { git = "https://github.com/zcash/orchard.git", rev = "5da41a6bbb44290e353ee4b38bcafe37ffe79ce8" } |
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 verified that this is the latest commit in zcash/orchard#398.
if expected_hash != block_hash { | ||
return Err(SqliteClientError::BlockConflict(block_height)); | ||
} |
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.
Reminding @daira to write hir comment.
zcash_client_sqlite/src/wallet/init/migrations/shardtree_support.rs
Outdated
Show resolved
Hide resolved
I would like to finish my review before this merges (which I should be able to do tonight). Edit: had a terrible migraine. It's fine that this merged, I'll finish my review post-hoc anyway though. |
e6676c6
to
c13c8c6
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 c13c8c6
I'm using c13c8c6 in zcash/lightwalletd#440; please do not rebase that commit. |
Based on #857