Skip to content
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

Read state service #140

Merged
merged 20 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,089 changes: 485 additions & 604 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ version = "0.1.1"

[workspace.dependencies]
# Zingolabs
# zingolib = { git = "https://github.com/zingolabs/zingolib.git", tag = "zaino_dep_002_091024_95e5b0d8f9d5ee0485c6141533da2f727aeafae2", features = ["zaino-test"] }
zingolib = { git = "https://github.com/Oscar-Pepper/zingolib.git", branch = "zaino_dep_002_091024_95e5b0d8f9d5ee0485c6141533da2f727aeafae2_with_output_ordering", features = [ "test-elevation" ] }
zingolib = { git = "https://github.com/zingolabs/zingolib.git", tag = "zaino_dep_004", features = [ "test-elevation" ] }

# Librustzcash
zcash_protocol = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zcash_client_sqlite-0.11.2_plus_zingolabs_changes-1-g7ad60b5d5-2-g121371a08" }
zcash_client_backend = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zcash_client_sqlite-0.11.2_plus_zingolabs_changes-1-g7ad60b5d5-2-g121371a08" }
zcash_client_backend = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2", features = [ "lightwalletd-tonic" ] }
zcash_protocol = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2" }


# Zebra
zebra-chain = { git = "https://github.com/ZcashFoundation/zebra.git", rev = "4eb285de50848f1a4dcebd0fbe353e4f150fd371" }
zebra-rpc = { git = "https://github.com/ZcashFoundation/zebra.git", rev = "4eb285de50848f1a4dcebd0fbe353e4f150fd371" }
zebra-chain = { git = "https://github.com/idky137/zebra.git", branch = "add_public_func_for_zaino_pt2" }
zebra-state = { git = "https://github.com/idky137/zebra.git", branch = "add_public_func_for_zaino_pt2" }
zebra-rpc = { git = "https://github.com/idky137/zebra.git", branch = "add_public_func_for_zaino_pt2" }

# Zcash-Local-Net
zcash_local_net = { git = "https://github.com/Oscar-Pepper/zcash-local-net.git", branch = "add_zebrad_basic_send_tests", features = [ "test_fixtures" ] }
zcash_local_net = { git = "https://github.com/zingolabs/zcash-local-net.git", rev = "92b509aa152baf7c5b336bed9462dd751799ae76", features = [ "test_fixtures" ] }

# Miscellaneous
tokio = { version = "1.38", features = ["full"] }
Expand Down Expand Up @@ -68,3 +69,7 @@ tracing-subscriber = "0.3.15"
url = "2.5"
which = "4"
whoami = "1.5"
tower = { version = "0.4", features = ["buffer", "util"] }
async-trait = "0.1"
chrono = "0.4"
jsonrpc-core = "18.0.0"
4 changes: 2 additions & 2 deletions docs/internal_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The main crates are:
- `tonic`
- `http`
- `thiserror`

Below is a detailed specification for each crate.

A full specification of the public functionality and RPC services available in Zaino is availabe in [Cargo Docs](https://zingolabs.github.io/zaino/index.html) and [RPC API Spec](./rpc_api.md).
Expand All @@ -30,7 +30,7 @@ A full specification of the public functionality and RPC services available in Z
- Parses command-line arguments and configuration files.
- Initializes the gRPC server and internal caching systems using components from `zaino-serve` and `zaino-state` (backed by `zaino-fetch`).
- Sets up logging and monitoring systems.

- Runtime Management:
- Manages the asynchronous runtime using `Tokio`.
- Handles graceful shutdowns and restarts.
Expand Down
2 changes: 2 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
3) Generate the zebrad chain cache `cargo nextest run generate_zebrad_large_chain_cache --run-ignored ignored-only`
4) Run `$ cargo nextest run tests`

*NOTE: As we currently have several bugs using Zebra's regtest mode for our tests, we are having to rely on loading cached chain-data instead of creating chain data dynamically. Due to this, and the fact that Zebra requires a lock on its chain cache, all unit tests in zaino-state (and any others relying on loading cached chain data) must be run sequentially. This can be done by running tests with the `--no-capture` flag. Eg. `cargo nextest run -p zaino-state --no-capture`.

### Wallet-to-Validator Tests
- To run Wallet-to-Validator tests:
1) Simlink or copy compiled `zcashd`, `zcash-cli` and `zebrad` binaries to `$ zaino/test_binaries/bins/*`
Expand Down
2 changes: 1 addition & 1 deletion docs/use_cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

- Then to launch Zaino: [in seperate terminals]:
3) Run `$ zebrad --config #PATH_TO_CONF/zebrad.toml start`
4) Run `$ zainod --config #PATH_TO_CONF/zindexer.toml`
4) Run `$ zainod --config #PATH_TO_CONF/zindexer.toml`

- To launch Zingo-Cli running through Zaino [from #PATH_TO/zingolib]:
5) Run `$ cargo run --release --package zingo-cli -- --chain "CHAIN_TYPE" --server "ZAINO_LISTEN_ADDR" --data-dir #PATH_TO_WALLET_DATA_DIR`
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repository = { workspace = true }
[dependencies]
# Test utility
zaino-testutils = { path = "../zaino-testutils" }
zaino-fetch = { path = "../zaino-fetch" }

# Test fixtures
zcash_local_net = { workspace = true, features = ["test_fixtures"] }
Expand All @@ -21,3 +22,6 @@ tokio = { workspace = true }

# Logging
tracing-subscriber = { workspace = true }

# Url
url = { workspace = true }
Loading
Loading