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.
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
str4d
left a comment
There was a problem hiding this comment.
Flushing my review comments.
| string orchardTree = 6; // orchard commitment tree state | ||
| } | ||
|
|
||
| enum ShieldedProtocol { |
There was a problem hiding this comment.
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.
| assert_eq!(RangeOrdering::cmp(&(1..1), &(1..1)), Equal); | |
This is technically needed to cover all the cases, but it's non-blocking.
daira
left a comment
There was a problem hiding this comment.
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.
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
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
f679e56 to
c7b308b
Compare
ebfull
left a comment
There was a problem hiding this comment.
ACK and tested. I haven't thoroughly reviewed some parts but those appear to have been given plenty of attention by others.
daira
left a comment
There was a problem hiding this comment.
utACK; remaining suggestions are non-blocking.
…14868de..d978256a2 d978256a2 Merge pull request #1 from zcash/compact_tx_transparent 7eeb82e7c Merge pull request #4 from zcash/add_changelog a95359dc9 Apply suggestions from code review 592b637a8 Add transparent data to the `CompactBlock` format. 9d1fb2c41 Add a CHANGELOG.md that documents the evolution of the light client protocol. 180717dfa Merge pull request #3 from zcash/merge_librustzcash_history 450bd4181 Merge the history of the .proto files from `librustzcash` for complete history preservation. a4859d11d Move protobuf files into place for use in `zcash/lightwallet-protocol` 2e66cdd9e Update zcash_client_backend/proto/service.proto eda012519 fix comment f838d10ad Add gRPC LightdInfo Donation Address db12c0415 Merge pull request #1473 from nuttycom/wallet/enrichment_queue 698feba96 Apply suggestions from code review 20ce57ab3 zcash_client_backend: Add `block_height` argument to `decrypt_and_store_transaction` a6dea1da8 Merge pull request #1482 from zancas/doc_tweak 4d2d45fc9 fix incorrect doc-comment e826f4740 update CompactBlock doc-comment, to cover non-Sapling shielded notes, and addresses e9a6c00bf Various documentation improvements 988bc7214 Merge pull request #872 from nuttycom/feature/pre_dag_sync-suggest_scan_ranges 58d07d469 Implement `suggest_scan_ranges` and `update_chain_tip` a9222b338 Address comments from code review. e20310857 Rename proto::compact::{BlockMetadata => ChainMetadata} ac63418c5 Reorganize Sapling and Orchard note commitment tree sizes in CompactBlock. 0fdca14f1 zcash_client_backend: Add note commitment tree sizes to `CompactBlock` serialization. 2a0c2b8b7 zcash_client_backend: Add gRPC bindings behind feature flag 1342f0480 zcash_client_backend: Address compact_formats.proto comments 68aa4e01b zcash_client_backend: Bring in latest `compact_formats.proto` e712eb1bc Add prevHash field to CompactBlock 440384c3e Build protobufs for compact formats git-subtree-dir: zcash_client_backend/lightwallet-protocol git-subtree-split: d978256a2bf33bb5f83846d8994e7377512f5f05
…14868de..23f0768ea 23f0768ea Release lightwallet-protocol v0.4.0 41156c767 Merge pull request #11 from zcash/feature/get_mempool_tx_pools 7c130e883 Add `lightwalletProtocolVersion` field to `LightdInfo` struct. edbb726d7 Apply suggestion from code review 38fddd73b Apply suggestions from code review 0250f2720 Add pool type filtering to `GetMempoolTx` argument. 54ccaadd5 Change semantics of pool-based pruning of compact transactions from "may prune" to "must prune". b0667ec99 Merge pull request #9 from zcash/2025-11-doc-TransparentAddressBlockFilter f3fea7bd4 doc: TransparentAddressBlockFilter doesn't include mempool a67dd323a Merge pull request #8 from zcash/2025-11-lightdinfo-upgrade-info 11da4b7e3 add next upgrade info to LightdInfo structure (GetLightdInfo) 42cd8f720 Transparent data docs update (#7) c0cf957ac Merge pull request #5 from zcash/2025-11-comments 912fc3609 Minor clarification in GetBlockRange documentation. 6b03f2cce Documentation (comments) only d978256a2 Merge pull request #1 from zcash/compact_tx_transparent 7eeb82e7c Merge pull request #4 from zcash/add_changelog a95359dc9 Apply suggestions from code review 592b637a8 Add transparent data to the `CompactBlock` format. 9d1fb2c41 Add a CHANGELOG.md that documents the evolution of the light client protocol. 180717dfa Merge pull request #3 from zcash/merge_librustzcash_history 450bd4181 Merge the history of the .proto files from `librustzcash` for complete history preservation. a4859d11d Move protobuf files into place for use in `zcash/lightwallet-protocol` 2e66cdd9e Update zcash_client_backend/proto/service.proto eda012519 fix comment f838d10ad Add gRPC LightdInfo Donation Address db12c0415 Merge pull request #1473 from nuttycom/wallet/enrichment_queue 698feba96 Apply suggestions from code review 20ce57ab3 zcash_client_backend: Add `block_height` argument to `decrypt_and_store_transaction` a6dea1da8 Merge pull request #1482 from zancas/doc_tweak 4d2d45fc9 fix incorrect doc-comment e826f4740 update CompactBlock doc-comment, to cover non-Sapling shielded notes, and addresses e9a6c00bf Various documentation improvements 988bc7214 Merge pull request #872 from nuttycom/feature/pre_dag_sync-suggest_scan_ranges 58d07d469 Implement `suggest_scan_ranges` and `update_chain_tip` a9222b338 Address comments from code review. e20310857 Rename proto::compact::{BlockMetadata => ChainMetadata} ac63418c5 Reorganize Sapling and Orchard note commitment tree sizes in CompactBlock. 0fdca14f1 zcash_client_backend: Add note commitment tree sizes to `CompactBlock` serialization. 2a0c2b8b7 zcash_client_backend: Add gRPC bindings behind feature flag 1342f0480 zcash_client_backend: Address compact_formats.proto comments 68aa4e01b zcash_client_backend: Bring in latest `compact_formats.proto` e712eb1bc Add prevHash field to CompactBlock 440384c3e Build protobufs for compact formats git-subtree-dir: zcash_client_backend/lightwallet-protocol git-subtree-split: 23f0768ea4471b63285f3c0e9b6fbb361674aa2b
No description provided.