-
Notifications
You must be signed in to change notification settings - Fork 349
Implement suggest_scan_ranges and updated chain validation.
#872
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
Merged
str4d
merged 17 commits into
zcash:main
from
nuttycom:feature/pre_dag_sync-suggest_scan_ranges
Jul 19, 2023
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6fa0b46
Implement `suggest_scan_ranges` and `update_chain_tip`
nuttycom 6db4355
Fix an error in dominance calculation.
nuttycom 352e1c7
Add a test for `scan_complete` and `update_chain_tip`
nuttycom e3aeb63
Fix off-by-one bugs with `ScanRange` end bounds
str4d ed4b6dc
Fix bugs in `ScanRange::truncate_*`
str4d 2c0acac
Use explicit arguments for internal `suggest_scan_ranges` helper
str4d bb92034
Fix bug in `RightFirstDisjoint` insertion logic
str4d f7163e9
Code simplifications
str4d cb887ef
Use correct levels for cap nodes in `put_shard_roots`
str4d 281dbd5
Ensure that `extended_range` in `scan_complete` is a superset of `range`
str4d 5109447
Transactionally modify the wallet DB in `replace_queue_entries`
str4d 2a98f94
Add more debug and trace logging
str4d a87dca0
Documentation updates, fixes, and cleanups
str4d 98ea08e
Migrate to latest `shardtree` to improve performance
str4d 359ff55
Do nothing if `update_chain_tip` is given a tip lower than we can use
str4d e16aa41
Add test for join_nonoverlapping.
ebfull c7b308b
Rename `VALIDATION_DEPTH` constant to `VERIFY_LOOKAHEAD`
str4d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,22 @@ message TreeState { | |
| string orchardTree = 6; // orchard commitment tree state | ||
| } | ||
|
|
||
| enum ShieldedProtocol { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I confirmed that this matches the canonical state of |
||
| sapling = 0; | ||
| orchard = 1; | ||
| } | ||
|
|
||
| message GetSubtreeRootsArg { | ||
| uint32 startIndex = 1; // Index identifying where to start returning subtree roots | ||
| ShieldedProtocol shieldedProtocol = 2; // Shielded protocol to return subtree roots for | ||
| uint32 maxEntries = 3; // Maximum number of entries to return, or 0 for all entries. | ||
| } | ||
| message SubtreeRoot { | ||
| bytes rootHash = 2; // The 32-byte Merkle root of the subtree. | ||
| bytes completingBlockHash = 3; // The hash of the block that completed this subtree. | ||
| uint64 completingBlockHeight = 4; // The height of the block that completed this subtree in the main chain. | ||
| } | ||
|
|
||
| // Results are sorted by height, which makes it easy to issue another | ||
| // request that picks up from where the previous left off. | ||
| message GetAddressUtxosArg { | ||
|
|
@@ -142,8 +158,12 @@ service CompactTxStreamer { | |
| rpc GetLatestBlock(ChainSpec) returns (BlockID) {} | ||
| // Return the compact block corresponding to the given block identifier | ||
| rpc GetBlock(BlockID) returns (CompactBlock) {} | ||
| // Same as GetBlock except actions contain only nullifiers | ||
| rpc GetBlockNullifiers(BlockID) returns (CompactBlock) {} | ||
| // Return a list of consecutive compact blocks | ||
| rpc GetBlockRange(BlockRange) returns (stream CompactBlock) {} | ||
| // Same as GetBlockRange except actions contain only nullifiers | ||
| rpc GetBlockRangeNullifiers(BlockRange) returns (stream CompactBlock) {} | ||
|
|
||
| // Return the requested full (not compact) transaction (as from zcashd) | ||
| rpc GetTransaction(TxFilter) returns (RawTransaction) {} | ||
|
|
@@ -177,6 +197,10 @@ service CompactTxStreamer { | |
| rpc GetTreeState(BlockID) returns (TreeState) {} | ||
| rpc GetLatestTreeState(Empty) returns (TreeState) {} | ||
|
|
||
| // Returns a stream of information about roots of subtrees of the Sapling and Orchard | ||
| // note commitment trees. | ||
|
daira marked this conversation as resolved.
|
||
| rpc GetSubtreeRoots(GetSubtreeRootsArg) returns (stream SubtreeRoot) {} | ||
|
|
||
| rpc GetAddressUtxos(GetAddressUtxosArg) returns (GetAddressUtxosReplyList) {} | ||
| rpc GetAddressUtxosStream(GetAddressUtxosArg) returns (stream GetAddressUtxosReply) {} | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.