-
Notifications
You must be signed in to change notification settings - Fork 257
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
Implement suggest_scan_ranges
and updated chain validation.
#872
Implement suggest_scan_ranges
and updated chain validation.
#872
Conversation
12e182d
to
86a4af7
Compare
suggest_scan_ranges
and updated chain validation.suggest_scan_ranges
and updated chain validation.
86a4af7
to
ea5faa0
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #872 +/- ##
==========================================
+ Coverage 69.85% 70.12% +0.27%
==========================================
Files 127 129 +2
Lines 12006 12480 +474
==========================================
+ Hits 8387 8752 +365
- Misses 3619 3728 +109
☔ View full report in Codecov by Sentry. |
4d775aa
to
c5a8609
Compare
a7b59bb
to
caea5da
Compare
); | ||
insert_into_cache(&db_cache, &cb); | ||
|
||
for i in 1..=10 { |
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.
This should be an exclusive end, or the 11th block should either be scanned, or expected not to be scanned (and noted as such somewhere).
This implements a priority queue backed by the wallet database for scan range ordering. The scan queue is updated on each call to `put_blocks` or to `update_chain_tip`.
caea5da
to
352e1c7
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.
Flushing my review comments.
@@ -118,6 +118,22 @@ message TreeState { | |||
string orchardTree = 6; // orchard commitment tree state | |||
} | |||
|
|||
enum ShieldedProtocol { |
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 confirmed that this matches the canonical state of service.proto
as of zcash/lightwalletd@ab90099.
use super::RangeOrdering::*; | ||
// Equal | ||
assert_eq!(RangeOrdering::cmp(&(0..1), &(0..1)), Equal); | ||
|
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.
assert_eq!(RangeOrdering::cmp(&(1..1), &(1..1)), Equal); | |
This is technically needed to cover all the cases, but it's non-blocking.
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 with blocking comments (the questions about ordering of inputs to ScanRange::from_parts
).
LeftFirstOverlap => { | ||
let split_point = left.span().end; | ||
if split_point > to_insert.block_range().start { | ||
Self::from_split(*left, *right, to_insert, split_point) |
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 think we should pay attention to the check warnings saying that some of these cases are not covered by tests. If you disagree, I won't block on it.
89d5661
to
fa8b135
Compare
fa8b135
to
1a5bc86
Compare
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Previously it would panic due to constructing invalid `ScanRange`s.
2cb284f
to
e16aa41
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
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
f679e56
to
c7b308b
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.
ACK and tested. I haven't thoroughly reviewed some parts but those appear to have been given plenty of attention by others.
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; remaining suggestions are non-blocking.
No description provided.