diff --git a/Cargo.lock b/Cargo.lock index 57a35d062..fed208b45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1197,6 +1197,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "equihash" +version = "0.2.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "blake2b_simd", + "byteorder", +] + [[package]] name = "equihash" version = "0.2.1" @@ -1241,6 +1250,14 @@ dependencies = [ "blake2b_simd", ] +[[package]] +name = "f4jumble" +version = "0.1.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "blake2b_simd", +] + [[package]] name = "f4jumble" version = "0.1.1" @@ -5457,7 +5474,7 @@ dependencies = [ "tracing", "url", "zaino-proto", - "zcash_protocol 0.4.0", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zebra-chain 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git?branch=main)", "zebra-rpc 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git?branch=main)", "zebra-state 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git?branch=main)", @@ -5550,8 +5567,8 @@ dependencies = [ "zaino-fetch", "zaino-state", "zainod", - "zcash_client_backend", - "zcash_protocol 0.4.0", + "zcash_client_backend 0.14.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zebra-chain 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git?branch=main)", "zingo-infra-testutils", "zingolib", @@ -5584,9 +5601,21 @@ source = "git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sql dependencies = [ "bech32 0.9.1", "bs58", - "f4jumble 0.1.0", - "zcash_encoding 0.2.1", - "zcash_protocol 0.4.0", + "f4jumble 0.1.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_encoding 0.2.1 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", +] + +[[package]] +name = "zcash_address" +version = "0.6.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "bech32 0.9.1", + "bs58", + "f4jumble 0.1.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_encoding 0.2.1 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_protocol 0.4.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", ] [[package]] @@ -5638,14 +5667,55 @@ dependencies = [ "tonic-build", "tracing", "which", - "zcash_address 0.6.0", - "zcash_encoding 0.2.1", - "zcash_keys", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_encoding 0.2.1 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_keys 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_note_encryption", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", - "zcash_protocol 0.4.0", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zip32", + "zip321 0.2.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", +] + +[[package]] +name = "zcash_client_backend" +version = "0.14.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "base64 0.22.1", + "bech32 0.9.1", + "bls12_381", + "bs58", + "crossbeam-channel", + "document-features", + "group", + "hex", + "hyper-util", + "incrementalmerkletree", + "memuse", + "nom", + "nonempty", + "percent-encoding", + "prost", + "rand_core 0.6.4", + "rayon", + "sapling-crypto", + "secrecy", + "shardtree", + "subtle", + "time", + "tonic", + "tonic-build", + "tracing", + "which", + "zcash_address 0.6.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_encoding 0.2.1 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_keys 0.4.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_note_encryption", + "zcash_primitives 0.19.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_protocol 0.4.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", "zip32", - "zip321", + "zip321 0.2.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", ] [[package]] @@ -5657,6 +5727,15 @@ dependencies = [ "nonempty", ] +[[package]] +name = "zcash_encoding" +version = "0.2.1" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "byteorder", + "nonempty", +] + [[package]] name = "zcash_encoding" version = "0.2.2" @@ -5699,10 +5778,35 @@ dependencies = [ "secrecy", "subtle", "tracing", - "zcash_address 0.6.0", - "zcash_encoding 0.2.1", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_encoding 0.2.1 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", - "zcash_protocol 0.4.0", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zip32", +] + +[[package]] +name = "zcash_keys" +version = "0.4.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "bech32 0.9.1", + "blake2b_simd", + "bls12_381", + "bs58", + "document-features", + "group", + "memuse", + "nonempty", + "rand_core 0.6.4", + "sapling-crypto", + "secrecy", + "subtle", + "tracing", + "zcash_address 0.6.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_encoding 0.2.1 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_primitives 0.19.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_protocol 0.4.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", "zip32", ] @@ -5769,7 +5873,7 @@ dependencies = [ "bs58", "byteorder", "document-features", - "equihash 0.2.0", + "equihash 0.2.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "ff", "fpe", "group", @@ -5788,10 +5892,45 @@ dependencies = [ "sha2", "subtle", "tracing", - "zcash_address 0.6.0", - "zcash_encoding 0.2.1", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_encoding 0.2.1 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_note_encryption", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_spec", + "zip32", +] + +[[package]] +name = "zcash_primitives" +version = "0.19.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "aes", + "blake2b_simd", + "bs58", + "byteorder", + "document-features", + "equihash 0.2.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "ff", + "fpe", + "group", + "hex", + "incrementalmerkletree", + "jubjub", + "memuse", + "nonempty", + "orchard", + "rand 0.8.5", + "rand_core 0.6.4", + "redjubjub", + "sapling-crypto", + "sha2", + "subtle", + "tracing", + "zcash_address 0.6.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_encoding 0.2.1 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", "zcash_note_encryption", - "zcash_protocol 0.4.0", + "zcash_protocol 0.4.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", "zcash_spec", "zip32", ] @@ -5850,6 +5989,15 @@ dependencies = [ "memuse", ] +[[package]] +name = "zcash_protocol" +version = "0.4.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "document-features", + "memuse", +] + [[package]] name = "zcash_protocol" version = "0.4.3" @@ -6431,7 +6579,7 @@ dependencies = [ "tokio", "tracing", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", - "zcash_protocol 0.4.0", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zebra-chain 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git)", "zebra-node-services 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git)", "zebra-rpc 1.0.0-beta.45 (git+https://github.com/ZcashFoundation/zebra.git)", @@ -6451,9 +6599,9 @@ dependencies = [ "tokio-stream", "tonic", "tracing-subscriber", - "zcash_client_backend", + "zcash_client_backend 0.14.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", - "zcash_protocol 0.4.0", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zingo-infra-services", "zingo-netutils", "zingolib", @@ -6464,10 +6612,10 @@ name = "zingo-memo" version = "0.1.0" source = "git+https://github.com/zingolabs/zingolib.git?tag=zaino_dep_005#965e81228d3a1d99b76c1e3c71202d8fdbbd41dc" dependencies = [ - "zcash_address 0.6.0", - "zcash_client_backend", - "zcash_encoding 0.2.1", - "zcash_keys", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_client_backend 0.14.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_encoding 0.2.1 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_keys 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", ] @@ -6488,7 +6636,7 @@ dependencies = [ "tonic", "tower 0.5.2", "webpki-roots 0.25.4", - "zcash_client_backend", + "zcash_client_backend 0.14.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", ] [[package]] @@ -6519,9 +6667,9 @@ dependencies = [ "tokio", "tonic", "tracing", - "zcash_address 0.6.0", - "zcash_client_backend", - "zcash_keys", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_client_backend 0.14.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_keys 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_note_encryption", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zingo-memo", @@ -6587,10 +6735,10 @@ dependencies = [ "tokio", "tonic", "tracing-subscriber", - "zcash_address 0.6.0", - "zcash_client_backend", - "zcash_encoding 0.2.1", - "zcash_keys", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_client_backend 0.14.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_encoding 0.2.1 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_keys 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_note_encryption", "zcash_primitives 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", "zcash_proofs 0.19.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", @@ -6621,8 +6769,20 @@ dependencies = [ "base64 0.22.1", "nom", "percent-encoding", - "zcash_address 0.6.0", - "zcash_protocol 0.4.0", + "zcash_address 0.6.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", + "zcash_protocol 0.4.0 (git+https://github.com/zingolabs/librustzcash.git?tag=zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2)", +] + +[[package]] +name = "zip321" +version = "0.2.0" +source = "git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin#39bc39ee597afbaafb9cda3d7f6c25189bc66c99" +dependencies = [ + "base64 0.22.1", + "nom", + "percent-encoding", + "zcash_address 0.6.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", + "zcash_protocol 0.4.0 (git+https://github.com/zecrocks/librustzcash_zl.git?branch=zaino_pin)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 146369e66..491392322 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ zingolib = { git = "https://github.com/zingolabs/zingolib.git", tag = "zaino_dep testvectors = { git = "https://github.com/zingolabs/zingolib.git", tag = "zaino_dep_005" } # Librustzcash -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_client_backend = { git = "https://github.com/zecrocks/librustzcash_zl.git", branch = "zaino_pin", features = [ "lightwalletd-tonic" ] } zcash_protocol = { git = "https://github.com/zingolabs/librustzcash.git", tag = "zcash_client_sqlite-0.12.1_plus_zingolabs_changes-test_2" } diff --git a/zaino-proto/proto/service.proto b/zaino-proto/proto/service.proto index 094566147..ec25e42a2 100644 --- a/zaino-proto/proto/service.proto +++ b/zaino-proto/proto/service.proto @@ -70,6 +70,7 @@ message LightdInfo { uint64 estimatedHeight = 12; // less than tip height if zcashd is syncing string zcashdBuild = 13; // example: "v4.1.1-877212414" string zcashdSubversion = 14; // example: "/MagicBean:4.1.1/" + string donationAddress = 15; // Zcash donation UA address } // TransparentAddressBlockFilter restricts the results to the given address diff --git a/zaino-proto/src/proto/service.rs b/zaino-proto/src/proto/service.rs index 36834c1e2..98ac6073e 100644 --- a/zaino-proto/src/proto/service.rs +++ b/zaino-proto/src/proto/service.rs @@ -107,6 +107,9 @@ pub struct LightdInfo { /// example: "/MagicBean:4.1.1/" #[prost(string, tag = "14")] pub zcashd_subversion: ::prost::alloc::string::String, + /// Zcash donation UA address + #[prost(string, tag = "15")] + pub donation_address: ::prost::alloc::string::String, } /// TransparentAddressBlockFilter restricts the results to the given address /// or block range. diff --git a/zaino-state/src/config.rs b/zaino-state/src/config.rs index 42b5e9a61..5215726a6 100644 --- a/zaino-state/src/config.rs +++ b/zaino-state/src/config.rs @@ -89,6 +89,8 @@ pub struct FetchServiceConfig { /// Disables FinalisedState. /// Used for testing. pub no_db: bool, + /// Zcash donation UA address + pub donation_address: Option, } impl FetchServiceConfig { @@ -109,6 +111,7 @@ impl FetchServiceConfig { network: zebra_chain::parameters::Network, no_sync: bool, no_db: bool, + donation_address: Option, ) -> Self { FetchServiceConfig { validator_rpc_address, @@ -126,6 +129,7 @@ impl FetchServiceConfig { network, no_sync, no_db, + donation_address, } } } diff --git a/zaino-state/src/fetch.rs b/zaino-state/src/fetch.rs index 5e10338c5..3363f6d55 100644 --- a/zaino-state/src/fetch.rs +++ b/zaino-state/src/fetch.rs @@ -1696,6 +1696,7 @@ impl LightWalletIndexer for FetchServiceSubscriber { estimated_height: blockchain_info.estimated_height().0 as u64, zcashd_build: self.data.zebra_build(), zcashd_subversion: self.data.zebra_subversion(), + donation_address: self.config.donation_address.clone().unwrap_or_default(), }) } @@ -1777,6 +1778,7 @@ mod tests { Network::new_regtest(Some(1), Some(1)), true, true, + None, )) .await .unwrap(); diff --git a/zaino-testutils/src/lib.rs b/zaino-testutils/src/lib.rs index cd01968dc..24858d24b 100644 --- a/zaino-testutils/src/lib.rs +++ b/zaino-testutils/src/lib.rs @@ -383,6 +383,7 @@ impl TestManager { no_sync: zaino_no_sync, no_db: zaino_no_db, no_state: false, + donation_address: None, }; let handle = zainodlib::indexer::Indexer::spawn(indexer_config) .await diff --git a/zainod/src/config.rs b/zainod/src/config.rs index 8c55cbd49..79fa652e6 100644 --- a/zainod/src/config.rs +++ b/zainod/src/config.rs @@ -92,6 +92,8 @@ pub struct IndexerConfig { /// /// NOTE: Currently unimplemented as will require either a Tonic backend or a JsonRPC server. pub no_state: bool, + /// Zcash donation UA address + pub donation_address: Option, } impl IndexerConfig { @@ -212,6 +214,7 @@ impl Default for IndexerConfig { no_sync: false, no_db: false, no_state: false, + donation_address: None, } } } @@ -393,6 +396,13 @@ pub fn load_config(file_path: &std::path::PathBuf) -> Result Result Result>, IndexerError> { config.check_config()?; + if let Some(donation_address) = &config.donation_address { + if !donation_address.is_empty() { + info!("Instance donation address: {}", donation_address); + } + } info!("Checking connection with node.."); let zebrad_uri = test_node_and_return_url( config.validator_listen_address, @@ -69,6 +74,7 @@ impl Indexer { config.get_network()?, config.no_sync, config.no_db, + config.donation_address, )) .await?; @@ -214,7 +220,7 @@ fn startup_message() { Thank you for using ZingoLabs Zaino! - Donate to us at https://free2z.cash/zingolabs. - - Submit any security conserns to us at zingodisclosure@proton.me. + - Submit any security concerns to us at zingodisclosure@proton.me. ****** Please note Zaino is currently in development and should not be used to run mainnet nodes. ****** "#; diff --git a/zainod/zindexer.toml b/zainod/zindexer.toml index ef6230aff..345ae13a2 100644 --- a/zainod/zindexer.toml +++ b/zainod/zindexer.toml @@ -101,3 +101,7 @@ no_db = false # no_state = false +# Specify a Zcash donation UA address +# +# This is publicly shared with users to allow them to donate Zcash to support your Zaino instance. +# donation_address = ""