Skip to content

Commit

Permalink
zcash_client_backend: Implement async wallet synchronization function
Browse files Browse the repository at this point in the history
This implements the necessary state machine for taking a wallet in some
arbitrary synchronization status, and fully scanning (the remainder of)
the chain.

Closes #1169.
  • Loading branch information
str4d committed Feb 9, 2024
1 parent 121438e commit c83b443
Showing 4 changed files with 443 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions zcash_client_backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -68,6 +68,11 @@ group.workspace = true
orchard = { workspace = true, optional = true }
sapling.workspace = true

# - Sync engine
anyhow = { version = "1", optional = true }
futures-util = { version = "0.3", optional = true }
tokio = { version = "1.21.0", optional = true, features = ["fs", "macros"] }

# - Note commitment trees
incrementalmerkletree.workspace = true
shardtree.workspace = true
@@ -122,6 +127,14 @@ transparent-inputs = [
## Enables receiving and spending Orchard funds.
orchard = ["dep:orchard", "zcash_keys/orchard"]

## Exposes a wallet synchronization function that implements the necessary state machine.
sync = [
"lightwalletd-tonic",
"dep:anyhow",
"dep:futures-util",
"dep:tokio",
]

## Exposes APIs that are useful for testing, such as `proptest` strategies.
test-dependencies = [
"dep:proptest",
3 changes: 3 additions & 0 deletions zcash_client_backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -73,6 +73,9 @@ pub mod scanning;
pub mod wallet;
pub mod zip321;

#[cfg(feature = "sync")]
pub mod sync;

#[cfg(feature = "unstable-serialization")]
pub mod serialization;

Loading

0 comments on commit c83b443

Please sign in to comment.