Skip to content

Commit d21f058

Browse files
authored
Merge branch 'dev' into new_zaino-ci_docker
2 parents 3b5ec28 + d4d461b commit d21f058

26 files changed

+184
-186
lines changed

Diff for: .dockerignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ target/
55
.dockerignore
66
Dockerfile
77
*.md
8-
.env*
8+
.env*

Diff for: CONTRIBUTING.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ To get started using Zaino, please see our [use cases document](./docs/use_cases
1717
We welcome and appreciate contributions in the form of code, documentation, bug reports and feature requests. We also generally enjoy feedback and outreach efforts.
1818

1919
## How to Contribute
20-
Code and documentation are very helpful and the lifeblood of Free Software. To merge in code to this repo, one will have to have a [GitHub account](https://docs.github.com/en/account-and-profile), and the ability to cryptographically verify commits against this identity.
20+
Code and documentation are very helpful and the lifeblood of Free Software. To merge in code to this repo, one will have to have a [GitHub account](https://docs.github.com/en/account-and-profile), and the ability to cryptographically verify commits against this identity.
21+
2122
The best way to verify is using a GPG signature. See [this document about commit signature verification.](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
23+
2224
Code, being Rust, should be formatted using `rustfmt` and applying the `clippy` suggestions.
25+
2326
Code should be as complex as it needs to be, but no more.
24-
All code will be reviewed in public, as conversations on the pull request. It is very possible there will be requested changed or questions. This is not a sign of disrespect, but needed to keep code quality high in an important piece of software in the Zcash ecosystem.
27+
28+
All code will be reviewed in public, as conversations on the pull request. It is very possible there will be requested changes or questions. This is not a sign of disrespect, but is necessary to keep code quality high in an important piece of software in the Zcash ecosystem.
29+
2530
Documentation should be clear and accurate to the latest commit on `dev`.
31+
2632
These contributions must be [GitHub pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) opened _from a personal fork_ of the project, _to this repo, zingolabs/zaino_. Generally pull requests will be against `dev`, the development branch.
2733

2834
## Bug Reports and Feature Requests
@@ -75,5 +81,5 @@ Building upon the work of others,
7581
Better quality control,
7682

7783
Reduced maintenance costs.
78-
84+
7985
To read more, see [this document on wikibooks](https://en.wikibooks.org/wiki/FOSS_A_General_Introduction/Preface).

Diff for: Cargo.lock

+1-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ tonic-build = "0.12"
6565
prost = "0.13"
6666
serde = "1.0"
6767
serde_json = "1.0"
68-
jsonrpc-core = "18.0"
68+
jsonrpsee-core = "0.24"
6969
jsonrpsee-types = "0.24"
7070

7171
# Hashmaps, channels, DBs

Diff for: docs/internal_spec.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ The Zaino repo consists of several crates that collectively provide an indexing
3232

3333
**Runtime:**
3434
- tokio
35-
- tokio-stream
35+
- tokio-stream
3636

3737
**CLI:**
3838
- clap
3939

4040
**Tracing:**
41-
- tracing
41+
- tracing
4242
- tracing-subscriber
4343
- tracing-futures
4444

@@ -50,33 +50,33 @@ The Zaino repo consists of several crates that collectively provide an indexing
5050
- tonic
5151
- tonic-build
5252
- prost
53-
- serde
53+
- serde
5454
- serde_json
55-
- jsonrpc-core
55+
- jsonrpsee-core
5656
- jsonrpsee-types
5757

5858
**Hashmaps, channels, DBs:**
59-
- indexmap
59+
- indexmap
6060
- crossbeam-channel
61-
- dashmap
62-
- lmdb
61+
- dashmap
62+
- lmdb
6363

6464
**Async:**
65-
- async-stream
66-
- async-trait
67-
- futures
65+
- async-stream
66+
- async-trait
67+
- futures
6868

6969
**Utility:**
7070
- thiserror
7171
- lazy-regex
7272
- once_cell
73-
- ctrlc
73+
- ctrlc
7474
- chrono
75-
- which
76-
- whoami
75+
- which
76+
- whoami
7777

7878
**Formats:**
79-
- base64
79+
- base64
8080
- byteorder
8181
- sha2
8282
- hex

Diff for: docs/rpc_api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Zaino Currently Serves the following gRPC services as defined in the [LightWalle
2626
Zaino has also committed to taking over responsibility for serving all [Zcash RPC Services](https://zcash.github.io/rpc/) required by non-validator (miner) clients from Zcashd.
2727
A full specification of the Zcash RPC services served by Zaino, and their current state of development, can be seen [here](./Zaino-zcash-rpcs.pdf).
2828

29-
29+

Diff for: docs/testing.md

+18-13
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,37 @@
55
3) [Zcashd, Zcash-Cli](https://github.com/zcash/zcash)
66

77
### Tests
8-
1) Simlink or copy compiled `zebrad`, zcashd` and `zcash-cli` binaries to `$ zaino/test_binaries/bins/*`
8+
1) Symlink or copy compiled `zebrad`, `zcashd` and `zcash-cli` binaries to `zaino/test_binaries/bins/*`
9+
10+
**Chain Cache** _Several tests rely on a cached chain to run, for these tests to pass the chain must first be generated:_
911

10-
Chain Cache: Several tests rely on a cached chain to run, for these tests to pass the chain must first be generated:
1112
2) Generate the zcashd chain cache `cargo nextest run generate_zcashd_chain_cache --run-ignored ignored-only`
1213
3) Generate the zebrad chain cache `cargo nextest run generate_zebrad_large_chain_cache --run-ignored ignored-only`
1314

14-
Client Rpc Tests: For the client rpc tests to pass a Zaino release binary must be built and added to PATH:
15-
4) Build release binary `cargo build --release` and add to PATH. WARNING: these tests do not use the binary built by cargo nextest
15+
**Client Rpc Tests** _For the client rpc tests to pass a Zaino release binary must be built and added to PATH.
16+
WARNING: these tests do not use the binary built by cargo nextest._
17+
18+
4) Build release binary `cargo build --release` and add to PATH. For example, `export PATH=./target/release:$PATH`
1619

17-
5) Run `$ cargo nextest run`
20+
5) Run `cargo nextest run`
1821

1922
NOTE: The client rpc get_subtree_roots tests are currently ignored, to run them testnet and mainnet chains must first be generated.
20-
- To run client rpc test `get_subtree_roots_sapling`:
23+
24+
To run client rpc test `get_subtree_roots_sapling`:
2125
1) sync Zebrad testnet to at least 2 sapling shards
2226
2) copy the Zebrad testnet `state` cache to `zaino/integration-tests/chain_cache/get_subtree_roots_sapling` directory.
27+
2328
See the `get_subtree_roots_sapling` test fixture doc comments in infrastructure for more details.
2429

25-
- To run client rpc test `get_subtree_roots_orchard`:
30+
To run client rpc test `get_subtree_roots_orchard`:
2631
1) sync Zebrad mainnet to at least 2 orchard shards
2732
2) copy the Zebrad mainnet `state` cache to `zaino/integration-tests/chain_cache/get_subtree_roots_orchard` directory.
33+
2834
See the `get_subtree_roots_orchard` test fixture doc comments in infrastructure for more details.
2935

3036
- TESTNET TESTS:
31-
the testnet tests are temporary and will be replaced with regtest as soon as (https://github.com/zingolabs/zaino/issues/231) is resolved
32-
In the mean time, these tests can be ran, but it is a fiddly process. First, it needs a zebrad fully synced to testnet (depending
33-
on internet speed, etc., this could take 10+ hours). Then, the tests must be run 1 at a time (passing `--no-capture` will enforce this).
34-
Furthermore, due to https://github.com/zingolabs/infrastructure/issues/43, sometimes a zebrad will persist past the end of the test and
35-
hold a lock on the testnet cache, causing all remaining tests to fail. This process must be stopped manually, in order to allow testnet
36-
tests to work again.
37+
The testnet tests are temporary and will be replaced with regtest as soon as (https://github.com/zingolabs/zaino/issues/231) is resolved.
38+
In the mean time, these tests can be ran, but it is a fiddly process. First, it needs a zebrad fully synced to testnet (depending on internet speed, etc., this could take 10+ hours).
39+
To build the zebra testnet cache, the best way is to use zebra directly. With `zebrad` already in `$PATH` and from the `zaino/` directory run `zebrad --config ./zainod/zebrad.toml start`.
40+
Then, the tests must be run 1 at a time (passing `--no-capture` will enforce this).
41+
Furthermore, due to https://github.com/zingolabs/infrastructure/issues/43, sometimes a zebrad may persist past the end of the test and hold a lock on the testnet cache, causing remaining tests to fail. This process can be stopped manually, in order to allow testnet tests to work again.

Diff for: integration-tests/tests/fetch_service.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use futures::StreamExt as _;
2-
use zaino_fetch::jsonrpc::connector::{test_node_and_return_url, JsonRpcConnector};
2+
use zaino_fetch::jsonrpsee::connector::{test_node_and_return_url, JsonRpSeeConnector};
33
use zaino_proto::proto::service::{
44
AddressList, BlockId, BlockRange, Exclude, GetAddressUtxosArg, GetSubtreeRootsArg,
55
TransparentAddressBlockFilter, TxFilter,
@@ -221,7 +221,7 @@ async fn fetch_service_get_raw_mempool(validator: &str) {
221221
.as_ref()
222222
.expect("Clients are not initialized");
223223

224-
let json_service = JsonRpcConnector::new_with_basic_auth(
224+
let json_service = JsonRpSeeConnector::new_with_basic_auth(
225225
test_node_and_return_url(
226226
test_manager.zebrad_rpc_listen_address,
227227
false,
@@ -586,7 +586,7 @@ async fn fetch_service_get_latest_block(validator: &str) {
586586
test_manager.local_net.generate_blocks(1).await.unwrap();
587587
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
588588

589-
let json_service = JsonRpcConnector::new_with_basic_auth(
589+
let json_service = JsonRpSeeConnector::new_with_basic_auth(
590590
test_node_and_return_url(
591591
test_manager.zebrad_rpc_listen_address,
592592
false,

Diff for: integration-tests/tests/local_cache.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use core::panic;
2-
use zaino_fetch::jsonrpc::connector::{test_node_and_return_url, JsonRpcConnector};
2+
use zaino_fetch::jsonrpsee::connector::{test_node_and_return_url, JsonRpSeeConnector};
33
use zaino_state::{
44
config::BlockCacheConfig,
55
local_cache::{BlockCache, BlockCacheSubscriber},
@@ -18,7 +18,7 @@ async fn create_test_manager_and_block_cache(
1818
enable_clients: bool,
1919
) -> (
2020
TestManager,
21-
JsonRpcConnector,
21+
JsonRpSeeConnector,
2222
BlockCache,
2323
BlockCacheSubscriber,
2424
) {
@@ -34,7 +34,7 @@ async fn create_test_manager_and_block_cache(
3434
.await
3535
.unwrap();
3636

37-
let json_service = JsonRpcConnector::new_with_basic_auth(
37+
let json_service = JsonRpSeeConnector::new_with_basic_auth(
3838
test_node_and_return_url(
3939
test_manager.zebrad_rpc_listen_address,
4040
false,

Diff for: integration-tests/tests/wallet_to_validator.rs

+29-27
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use zingo_infra_testutils::services::validator::Validator;
88
use zingolib::testutils::lightclient::from_inputs;
99

1010
mod wallet_basic {
11-
use zaino_fetch::jsonrpc::connector::test_node_and_return_url;
11+
use zaino_fetch::jsonrpsee::connector::test_node_and_return_url;
1212

1313
use super::*;
1414

@@ -199,20 +199,21 @@ mod wallet_basic {
199199
test_manager.local_net.generate_blocks(1).await.unwrap();
200200
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
201201

202-
let fetch_service = zaino_fetch::jsonrpc::connector::JsonRpcConnector::new_with_basic_auth(
203-
test_node_and_return_url(
204-
test_manager.zebrad_rpc_listen_address,
205-
false,
206-
None,
207-
Some("xxxxxx".to_string()),
208-
Some("xxxxxx".to_string()),
202+
let fetch_service =
203+
zaino_fetch::jsonrpsee::connector::JsonRpSeeConnector::new_with_basic_auth(
204+
test_node_and_return_url(
205+
test_manager.zebrad_rpc_listen_address,
206+
false,
207+
None,
208+
Some("xxxxxx".to_string()),
209+
Some("xxxxxx".to_string()),
210+
)
211+
.await
212+
.unwrap(),
213+
"xxxxxx".to_string(),
214+
"xxxxxx".to_string(),
209215
)
210-
.await
211-
.unwrap(),
212-
"xxxxxx".to_string(),
213-
"xxxxxx".to_string(),
214-
)
215-
.unwrap();
216+
.unwrap();
216217

217218
println!("\n\nFetching Chain Height!\n");
218219

@@ -543,20 +544,21 @@ mod wallet_basic {
543544

544545
// test_manager.local_net.print_stdout();
545546

546-
let fetch_service = zaino_fetch::jsonrpc::connector::JsonRpcConnector::new_with_basic_auth(
547-
test_node_and_return_url(
548-
test_manager.zebrad_rpc_listen_address,
549-
false,
550-
None,
551-
Some("xxxxxx".to_string()),
552-
Some("xxxxxx".to_string()),
547+
let fetch_service =
548+
zaino_fetch::jsonrpsee::connector::JsonRpSeeConnector::new_with_basic_auth(
549+
test_node_and_return_url(
550+
test_manager.zebrad_rpc_listen_address,
551+
false,
552+
None,
553+
Some("xxxxxx".to_string()),
554+
Some("xxxxxx".to_string()),
555+
)
556+
.await
557+
.unwrap(),
558+
"xxxxxx".to_string(),
559+
"xxxxxx".to_string(),
553560
)
554-
.await
555-
.unwrap(),
556-
"xxxxxx".to_string(),
557-
"xxxxxx".to_string(),
558-
)
559-
.unwrap();
561+
.unwrap();
560562

561563
println!("\n\nFetching Raw Mempool!\n");
562564

Diff for: zaino-fetch/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ base64 = { workspace = true }
4040
byteorder = { workspace = true }
4141
sha2 = { workspace = true }
4242
jsonrpsee-types = { workspace = true }
43-
File renamed without changes.

0 commit comments

Comments
 (0)