From 46c5e93afe2d95e08ff076af7daf14ff502e8691 Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 08:44:50 -0700 Subject: [PATCH 1/8] bump deps --- Cargo.lock | 130 ++++++++++++++++++----------------------------------- Cargo.toml | 17 ++++--- 2 files changed, 52 insertions(+), 95 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8398f82f9..e6ed72c67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,26 +306,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bindgen" -version = "0.69.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" -dependencies = [ - "bitflags 2.13.0", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", - "proc-macro2", - "quote", - "regex", - "rustc-hash 1.1.0", - "shlex 1.3.0", - "syn 2.0.118", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -339,7 +319,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash 2.1.2", + "rustc-hash", "shlex 1.3.0", "syn 2.0.118", ] @@ -2247,15 +2227,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -2374,7 +2345,7 @@ dependencies = [ "jsonrpsee-types", "parking_lot", "rand 0.8.6", - "rustc-hash 2.1.2", + "rustc-hash", "serde", "serde_json", "thiserror 1.0.69", @@ -2481,12 +2452,6 @@ dependencies = [ "spin", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "left-right" version = "0.11.7" @@ -2531,14 +2496,13 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.16.0+8.10.0" +version = "0.17.3+10.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3d60bc059831dc1c83903fb45c103f75db65c5a7bf22272764d9cc683e348c" +checksum = "cef2a00ee60fe526157c9023edab23943fae1ce2ab6f4abb2a807c1746835de9" dependencies = [ - "bindgen 0.69.5", + "bindgen", "bzip2-sys", "cc", - "glob", "libc", "libz-sys", "lz4-sys", @@ -2561,7 +2525,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8ce05b56f3cbc65ec7d0908adb308ed91281e022f61c8c3a0c9388b5380b17" dependencies = [ - "bindgen 0.72.1", + "bindgen", "cc", "thiserror 2.0.18", "tracing", @@ -2953,9 +2917,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchard" -version = "0.15.0-pre.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e277dd4b46f5d06deae3ffb8af1a951e8622368f028c2a4d6fe59339566403" +checksum = "cca2ede6a4a77bd729eed3be9303d98a08b217edc85190dcf4dbe004086d5a65" dependencies = [ "aes", "bitvec", @@ -3473,7 +3437,7 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.2", + "rustc-hash", "rustls", "socket2", "thiserror 2.0.18", @@ -3493,7 +3457,7 @@ dependencies = [ "lru-slab", "rand 0.9.4", "ring", - "rustc-hash 2.1.2", + "rustc-hash", "rustls", "rustls-pki-types", "slab", @@ -3936,9 +3900,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd13e55d6d7b8cd0ea569161127567cd587676c99f4472f779a0279aa60a7a7" +checksum = "ddb7af00d2b17dbd07d82c0063e25411959748ff03e8d4f96134c2ff41fce34f" dependencies = [ "libc", "librocksdb-sys", @@ -3956,12 +3920,6 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.2" @@ -5016,9 +4974,9 @@ dependencies = [ [[package]] name = "tower-batch-control" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6cf52578f98b4da47335c26c4f883f7993b1a9b9d2f5420eb8dbfd5dd19a28" +checksum = "0a49cdaf2b00c1150c93a8dbbb63cae193573903a3c9a07b5d4d61251b9e32f0" dependencies = [ "futures", "futures-core", @@ -5033,9 +4991,9 @@ dependencies = [ [[package]] name = "tower-fallback" -version = "0.2.41" +version = "0.2.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434e19ee996ee5c6aa42f11463a355138452592e5c5b5b73b6f0f19534556af" +checksum = "700cd6732c9c9e2c77501cc663708b2229abc9e8fa27d3deae15126330a1ed87" dependencies = [ "futures-core", "pin-project", @@ -6116,9 +6074,9 @@ dependencies = [ [[package]] name = "zcash_address" -version = "0.13.0-pre.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2918e73eff76388cda87695a6e7398f96a2e3383a0de7b77729a204ec00a0" +checksum = "5a854b28c07dba372f4410ea8ad62b4bf7d5c2bf8be32fc4b31bc0db6521a975" dependencies = [ "bech32", "bs58", @@ -6141,9 +6099,9 @@ dependencies = [ [[package]] name = "zcash_history" -version = "0.5.0-pre.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e8634d011026cb181cb67b2a412e601dc344a2827b9c576fe3a727fdebf441" +checksum = "69d2ed9a9fa7b466a7adedab1ad5a21f8330e4943756912fc776cf7f3beae32b" dependencies = [ "blake2b_simd", "byteorder", @@ -6152,9 +6110,9 @@ dependencies = [ [[package]] name = "zcash_keys" -version = "0.15.0-pre.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0bac3a9e5b0d954684ba1f07386d55b5ae4588b3ba2d93cad05ee09f3e0947" +checksum = "36391ebfce7df2510c6564f79e608ed93f1c0692c6464e2397b248e06dae3912" dependencies = [ "bech32", "blake2b_simd", @@ -6211,9 +6169,9 @@ dependencies = [ [[package]] name = "zcash_primitives" -version = "0.29.0-pre.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7bfe66975658f44dba87d535f9ebb9fb4c9c0c4fecca3f5c40cbe1583dece6" +checksum = "bdbeccc05bfe63b6dee9e989c6ff5027421741562a4853c36504dd621f6a81b1" dependencies = [ "blake2b_simd", "block-buffer 0.11.0-rc.3", @@ -6242,9 +6200,9 @@ dependencies = [ [[package]] name = "zcash_proofs" -version = "0.29.0-pre.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39b90964ffe6bdc314368c7b849aaa6dcc2b495249a3bf1b9bfbdc92ba4e4f6" +checksum = "b91fb0b420fb66a765f1fa92ab7a6b631aa54c08415415ef6185256826e74fbd" dependencies = [ "bellman", "blake2b_simd", @@ -6265,9 +6223,9 @@ dependencies = [ [[package]] name = "zcash_protocol" -version = "0.10.0-pre.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97f339a9801c7f70295732a5cf822346f194202cea6425fc2fc14a5af679b004" +checksum = "2973d210e74ebd81adc50828fbbb284ab6aaa099308097c42c47dc63cf3420fc" dependencies = [ "corez", "document-features", @@ -6304,9 +6262,9 @@ dependencies = [ [[package]] name = "zcash_transparent" -version = "0.9.0-pre.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e941230f67056aad41c8fa9b926f9cc4d9d1a321f32e95c39c0b0e38e85f79b" +checksum = "72e0f8c142bed366ed5886dcfa8772ec90b5420cc127e6cdb76b6744c53a287b" dependencies = [ "bip32", "bs58", @@ -6329,9 +6287,9 @@ dependencies = [ [[package]] name = "zebra-chain" -version = "11.0.0" +version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600a4c35ee81350384226f8178fab2b088e38d5e0a9f6cb0b1051caba30702d7" +checksum = "014adde138ea00b1cf6c873aaf56aacb5aa0d55b8e5451a3e3b1b06c461bd107" dependencies = [ "bech32", "bitflags 2.13.0", @@ -6398,9 +6356,9 @@ dependencies = [ [[package]] name = "zebra-consensus" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa2b2678c4ce6d18172bad73a9b72b24a4b3a65af4c2a5e9120a1470c3fc402" +checksum = "4481ced3223226db18e33b9fb2e8eab7f7cefeae1681f4e8d8d7e3c2285a5c4d" dependencies = [ "bellman", "blake2b_simd", @@ -6441,9 +6399,9 @@ dependencies = [ [[package]] name = "zebra-network" -version = "10.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36b1e6ca4687bc8d128553ca04bb82cc38701c4dac7107f3e56717b39d4b18da" +checksum = "9a59dc9e9ac723c4c01d985a5ecf3ddd85c0f1681574457d52173c43263905f2" dependencies = [ "bitflags 2.13.0", "byteorder", @@ -6479,9 +6437,9 @@ dependencies = [ [[package]] name = "zebra-node-services" -version = "9.0.0" +version = "9.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4446db9b576c0de14ff91c7fd7b38a59d340c1969a1604787185a52b8b7f53a6" +checksum = "006992c62b9c4742a13a306f2e7443646fa0b5b884aac63a6fba5b0be273f864" dependencies = [ "color-eyre", "jsonrpsee-types", @@ -6495,9 +6453,9 @@ dependencies = [ [[package]] name = "zebra-rpc" -version = "11.0.0" +version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb180542f1ffc0f66c20e1cd66c7741662053ccda588e3847a8ed2df8c83dae7" +checksum = "4d071b177740cdc1107f90dd50fac67e1b440a84c8509ae1529b3609fb6f801d" dependencies = [ "base64", "chrono", @@ -6556,9 +6514,9 @@ dependencies = [ [[package]] name = "zebra-script" -version = "10.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8648c201e3dadb1c95022eb7605d528de4bf94b6c0cebf76537805849aee76c5" +checksum = "f7c967badb1bb99573dba430948c98fbca940daf23915f2e9736e1a1d2a166f3" dependencies = [ "libzcash_script", "rand 0.8.6", @@ -6570,9 +6528,9 @@ dependencies = [ [[package]] name = "zebra-state" -version = "10.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b95b81181253a46885e3254cc5a20e4d82b5258116c9e43db5c8e9660c6b973" +checksum = "39295d344c1cc56ed725646cfc7bb7e16f8edae7518ea5a9e599665f979e9cf6" dependencies = [ "bincode", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 8578ba5ff..0b6ece458 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,17 +40,16 @@ license = "Apache-2.0" # Librustzcash incrementalmerkletree = "0.8" -zcash_address = "0.13.0-pre.0" -zcash_keys = "0.15.0-pre.0" -zcash_protocol = "0.10.0-pre.0" -zcash_primitives = "0.29.0-pre.0" -zcash_transparent = "0.9.0-pre.0" -zcash_client_backend = "0.24.0-pre.0" +zcash_address = "0.13" +zcash_keys = "0.15" +zcash_protocol = "0.10" +zcash_primitives = "0.29" +zcash_transparent = "0.9" # Zebra -zebra-chain = "11.0" -zebra-state = "10.0" -zebra-rpc = "11.0" +zebra-chain = "11.1" +zebra-state = "10.1" +zebra-rpc = "11.1" # Runtime tokio = { version = "1.38", features = ["full"] } From 1a795db91daee239df4562f6653ec70bf33edd60 Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 08:58:40 -0700 Subject: [PATCH 2/8] build(zainod): drop the unused zebra-chain dependency An audit of every zebra* and zcash* dependency edge (cargo machete, the compiler's unused_crate_dependencies lint, and inspection of each remaining single-reference hit) found exactly one dead edge: zainod declared zebra-chain but never referenced it. Remove it. Every other declared edge is genuinely used; zebra-chain remains the type backbone of the workspace, with some 350 references in zaino-state alone. Co-Authored-By: Claude Fable 5 --- Cargo.lock | 1 - packages/zainod/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6ed72c67..d919c5245 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6068,7 +6068,6 @@ dependencies = [ "zaino-state", "zcash_address", "zcash_protocol", - "zebra-chain", "zebra-state", ] diff --git a/packages/zainod/Cargo.toml b/packages/zainod/Cargo.toml index 4fc9a786d..bc9d0b938 100644 --- a/packages/zainod/Cargo.toml +++ b/packages/zainod/Cargo.toml @@ -70,7 +70,6 @@ zaino-state = { workspace = true } zaino-serve = { workspace = true } # Zebra -zebra-chain = { workspace = true } zebra-state = { workspace = true } # Runtime From 1e255d083b2ab92974a98485d1ff457261ded587 Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 08:58:40 -0700 Subject: [PATCH 3/8] build: advance ZEBRA_VERSION to the 6.0.0 final release Advance ZEBRA_VERSION in .env.testing-artifacts from 6.0.0-rc.0 to the final 6.0.0 release. Zebrad 6.0.0 depends on zebra-chain ^11.1.0, the same crate generation the workspace now pins, so the zebrad binary the live tests run against and the zebra libraries zaino links are once again from a single release. The makers check-matching-zebras guard passes. Co-Authored-By: Claude Fable 5 --- .env.testing-artifacts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.testing-artifacts b/.env.testing-artifacts index 92b2fbae2..e1e14d228 100644 --- a/.env.testing-artifacts +++ b/.env.testing-artifacts @@ -5,7 +5,7 @@ # zcashd Git tag (https://github.com/zcash/zcash/releases) ZCASH_VERSION=6.20.0 -ZEBRA_VERSION=6.0.0-rc.0 +ZEBRA_VERSION=6.0.0 # zcash-devtool git ref (https://github.com/zingolabs/zcash-devtool) — # the wallet client driven by wallet-tests via zcash_local_net, built From 483a6ca17612638b0c5bf6906921b4d3b41dfb0b Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 09:12:38 -0700 Subject: [PATCH 4/8] build: remove unused dependency edges across the workspace A workspace-wide unused-dependency audit (the compiler's unused_crate_dependencies lint analyzed per target, cross-checked with cargo machete and a text search of every candidate's package, including feature-gated code) found twelve dead edges. Remove them: prost, bs58, nonempty, derive_more, and once_cell from zaino-state; tracing-subscriber from zainod; and tracing, corez, serde_json, tempfile, tower, and zip32 from clientless. The bs58, nonempty, and zip32 entries in [workspace.dependencies] lost their last inheritors and are removed with them. One edge that looks dead is kept deliberately: clientless does not import zainod in any test source, but its transparent_address_history_experimental feature forwards to zainod/transparent_address_history_experimental, and cargo rejects a feature forward to a non-dependency. A comment in the manifest now records that. Co-Authored-By: Claude Fable 5 --- Cargo.lock | 28 +++++----------------------- Cargo.toml | 3 --- live-tests/clientless/Cargo.toml | 9 +++------ packages/zaino-state/Cargo.toml | 5 ----- packages/zainod/Cargo.toml | 1 - 5 files changed, 8 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d919c5245..798fd33aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -669,14 +669,9 @@ name = "clientless" version = "0.2.0" dependencies = [ "anyhow", - "corez", "futures", "hex", - "serde_json", - "tempfile", "tokio", - "tower 0.4.13", - "tracing", "wire_serialized_transaction_test_data", "zaino-common", "zaino-fetch", @@ -688,7 +683,6 @@ dependencies = [ "zebra-chain", "zebra-rpc", "zebra-state", - "zip32", ] [[package]] @@ -2773,12 +2767,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549e471b99ccaf2f89101bec68f4d244457d5a95a9c3d0672e9564124397741d" -[[package]] -name = "nonempty" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9737e026353e5cd0736f98eddae28665118eb6f6600902a7f50db585621fecb6" - [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -2936,7 +2924,7 @@ dependencies = [ "incrementalmerkletree", "lazy_static", "memuse", - "nonempty 0.11.0", + "nonempty", "pasta_curves", "rand 0.8.6", "rand_core 0.6.4", @@ -5976,11 +5964,9 @@ dependencies = [ "arc-swap", "bitflags 2.13.0", "blake2", - "bs58", "chrono", "corez", "dashmap", - "derive_more", "futures", "hex", "incrementalmerkletree", @@ -5988,11 +5974,8 @@ dependencies = [ "lmdb", "lmdb-sys", "metrics", - "nonempty 0.12.0", - "once_cell", "primitive-types 0.14.0", "proptest", - "prost", "rand 0.10.1", "reqwest 0.13.1", "sapling-crypto", @@ -6061,7 +6044,6 @@ dependencies = [ "tokio", "toml", "tracing", - "tracing-subscriber", "zaino-common", "zaino-fetch", "zaino-serve", @@ -6093,7 +6075,7 @@ checksum = "1440921903cdb86133fb9e2fe800be488015db2939a30bedb413078a1acb0306" dependencies = [ "corez", "hex", - "nonempty 0.11.0", + "nonempty", ] [[package]] @@ -6121,7 +6103,7 @@ dependencies = [ "document-features", "group", "memuse", - "nonempty 0.11.0", + "nonempty", "orchard", "rand_core 0.6.4", "sapling-crypto", @@ -6183,7 +6165,7 @@ dependencies = [ "incrementalmerkletree", "jubjub", "memuse", - "nonempty 0.11.0", + "nonempty", "orchard", "rand_core 0.6.4", "redjubjub", @@ -6271,7 +6253,7 @@ dependencies = [ "document-features", "getset", "hex", - "nonempty 0.11.0", + "nonempty", "ripemd 0.1.3", "secp256k1", "sha2 0.10.9", diff --git a/Cargo.toml b/Cargo.toml index 0b6ece458..e13a29ac6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,7 +114,6 @@ blake2 = "0.10" hex = "0.4" toml = "1.1" primitive-types = "0.14" -bs58 = "0.5" bitflags = "2.9" # Test @@ -146,9 +145,7 @@ zcash_local_net = { git = "https://github.com/zingolabs/infrastructure.git", rev wire_serialized_transaction_test_data = "1.0.0" config = { version = "0.15", default-features = false, features = ["toml"] } -nonempty = "0.12.0" proptest = "~1.11" -zip32 = "0.2.1" anyhow = "1.0" arc-swap = "1.7.1" derive_more = "2.0.1" diff --git a/live-tests/clientless/Cargo.toml b/live-tests/clientless/Cargo.toml index ba912e690..c8945a81a 100644 --- a/live-tests/clientless/Cargo.toml +++ b/live-tests/clientless/Cargo.toml @@ -36,7 +36,6 @@ zaino-fetch = { workspace = true } zaino-testutils = { workspace = true } # The lib's z_validate helper calls `ZcashIndexer::z_validate_address`. zaino-state = { workspace = true, features = ["test_dependencies"] } -tracing.workspace = true [dev-dependencies] anyhow = { workspace = true } @@ -46,6 +45,9 @@ anyhow = { workspace = true } zaino-state = { workspace = true, features = ["fast-test-seam"] } # Test utility +# Not imported by any test source; present so the +# transparent_address_history_experimental feature can forward to +# zainod/transparent_address_history_experimental in the spawned daemon. zainod = { workspace = true } zaino-testutils = { workspace = true } zaino-fetch = { workspace = true } @@ -55,13 +57,8 @@ wire_serialized_transaction_test_data = { workspace = true } zebra-chain = { workspace = true } zebra-state = { workspace = true } zebra-rpc = { workspace = true } -zip32 = { workspace = true } -corez = { workspace = true } -serde_json = { workspace = true } futures = { workspace = true } -tempfile = { workspace = true } -tower = { workspace = true } hex = { workspace = true } # Runtime diff --git a/packages/zaino-state/Cargo.toml b/packages/zaino-state/Cargo.toml index 4f96dbe9f..6b341c1c9 100644 --- a/packages/zaino-state/Cargo.toml +++ b/packages/zaino-state/Cargo.toml @@ -83,22 +83,17 @@ lmdb = { workspace = true } lmdb-sys = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["preserve_order"] } -prost = { workspace = true } primitive-types = { workspace = true } blake2 = { workspace = true } sha2 = { workspace = true } corez = { workspace = true } -bs58 = { workspace = true } -nonempty = { workspace = true } arc-swap = { workspace = true } reqwest.workspace = true bitflags = { workspace = true } -derive_more = { workspace = true, features = ["from"] } [dev-dependencies] tempfile = { workspace = true } tracing-subscriber = { workspace = true } -once_cell = { workspace = true } zebra-chain = { workspace = true, features = ["proptest-impl"] } proptest.workspace = true incrementalmerkletree = "0.8.2" diff --git a/packages/zainod/Cargo.toml b/packages/zainod/Cargo.toml index bc9d0b938..c3a54016e 100644 --- a/packages/zainod/Cargo.toml +++ b/packages/zainod/Cargo.toml @@ -80,7 +80,6 @@ clap = { workspace = true, features = ["derive"] } # Tracing tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["fmt", "env-filter", "time"] } # Network / RPC http = { workspace = true } From 46d18c623b993e4394436017be2c37a89f7c00b0 Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 09:13:11 -0700 Subject: [PATCH 5/8] build: demote test-only dependencies to dev-dependencies The same audit that removed the dead edges found three dependencies that are real but used exclusively under #[cfg(test)]: primitive-types in zaino-state (the legacy_chainwork_reference round-trip tests), tempfile in zainod (the config tests), and tonic in zaino-testutils (the cfg(test)-gated build_client helper). Move each from [dependencies] to [dev-dependencies] so shipped builds stop linking them. The lockfile is unchanged: dependency kind does not affect resolution. Co-Authored-By: Claude Fable 5 --- live-tests/zaino-testutils/Cargo.toml | 4 +++- packages/zaino-state/Cargo.toml | 2 +- packages/zainod/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/live-tests/zaino-testutils/Cargo.toml b/live-tests/zaino-testutils/Cargo.toml index 38f2ef883..09b132e9f 100644 --- a/live-tests/zaino-testutils/Cargo.toml +++ b/live-tests/zaino-testutils/Cargo.toml @@ -65,5 +65,7 @@ futures = { workspace = true } http = { workspace = true } once_cell = { workspace = true } tokio = { workspace = true } -tonic.workspace = true tracing.workspace = true + +[dev-dependencies] +tonic.workspace = true diff --git a/packages/zaino-state/Cargo.toml b/packages/zaino-state/Cargo.toml index 6b341c1c9..0f60eab31 100644 --- a/packages/zaino-state/Cargo.toml +++ b/packages/zaino-state/Cargo.toml @@ -83,7 +83,6 @@ lmdb = { workspace = true } lmdb-sys = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["preserve_order"] } -primitive-types = { workspace = true } blake2 = { workspace = true } sha2 = { workspace = true } corez = { workspace = true } @@ -94,6 +93,7 @@ bitflags = { workspace = true } [dev-dependencies] tempfile = { workspace = true } tracing-subscriber = { workspace = true } +primitive-types = { workspace = true } zebra-chain = { workspace = true, features = ["proptest-impl"] } proptest.workspace = true incrementalmerkletree = "0.8.2" diff --git a/packages/zainod/Cargo.toml b/packages/zainod/Cargo.toml index c3a54016e..beba27ad9 100644 --- a/packages/zainod/Cargo.toml +++ b/packages/zainod/Cargo.toml @@ -95,8 +95,8 @@ thiserror = { workspace = true } # Formats toml = { workspace = true } config = { workspace = true } -tempfile = { workspace = true } [dev-dependencies] +tempfile = { workspace = true } zcash_address = { workspace = true } zcash_protocol = { workspace = true } From 4141a5d4dceb4e1705a196348b3b774e5114bb1b Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 09:19:18 -0700 Subject: [PATCH 6/8] feat(test-runner): add a packages row and per-suite timing to the summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `makers test all` previously ran the packages set outside the summary runner, so the closing table covered only the two live partitions. The `all` branch now delegates to `live-summary --all`, which runs `makers container-test` first and prints its tallies as a `packages:` row above `clientless:`, `e2e:`, and `TOTAL:`, under a "test summary" header. `makers test live` is unchanged apart from the new column. The old contract is preserved: every set runs even when an earlier one fails, and the runner exits non-zero if any set did. Each row also gains a wall-clock time column, parsed from the nextest summary line's `[ 510.718s]` stamp. Durations are held as integer milliseconds in a u64 — whole seconds and a right-padded three-digit fraction parsed digit-by-digit, no floating point — and the TOTAL row sums them, which reads as true wall time because the suites run sequentially. Six new unit tests cover the parser (padding, short and absent fractions, and propagation through parse_summary), and the pre-existing `filter(..).last()` on a double-ended iterator is tightened to `rfind(..)` per clippy. Co-Authored-By: Claude Fable 5 --- Makefile.toml | 10 +- tools/test-runner/src/bin/live-summary.rs | 127 +++++++++++++++++++--- 2 files changed, 118 insertions(+), 19 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 83e1c47ea..2bcaec624 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -182,12 +182,10 @@ case "$set" in clientless) exec makers live-clientless "$@" ;; live) exec cargo run -q --manifest-path tools/test-runner/Cargo.toml --bin live-summary -- "$@" ;; all) - # Run both even if the first fails, then fail if either did, so the - # omnibus reflects the whole suite. - rc=0 - makers container-test "$@" || rc=1 - cargo run -q --manifest-path tools/test-runner/Cargo.toml --bin live-summary -- "$@" || rc=1 - exit "$rc" ;; + # The summary runner's --all mode runs the packages set and both live + # partitions (each set runs even when an earlier one fails, and the exit + # code reflects any failure), so the combined table covers everything. + exec cargo run -q --manifest-path tools/test-runner/Cargo.toml --bin live-summary -- --all "$@" ;; ironwood) # The one definition of the ironwood selection: the two dedicated test # binaries, plus every test whose name carries the pool's name (the diff --git a/tools/test-runner/src/bin/live-summary.rs b/tools/test-runner/src/bin/live-summary.rs index 47d3ff3bd..3af1d56ed 100644 --- a/tools/test-runner/src/bin/live-summary.rs +++ b/tools/test-runner/src/bin/live-summary.rs @@ -1,10 +1,12 @@ -//! `live-summary` — run both live-test partitions and print a combined summary. +//! `live-summary` — run the test partitions and print a combined summary. //! -//! Invoked from `makers test live` (and `makers test all`) as -//! `cargo run --bin live-summary -- `. Runs the `clientless` then `e2e` -//! partition (each in its own CI container via its own `makers` task), streams -//! each run's output while capturing it, parses the nextest summary line, and -//! aggregates the totals. +//! Invoked from `makers test live` as `cargo run --bin live-summary -- ` +//! and from `makers test all` with the extra `--all` flag. The live set runs +//! the `clientless` then `e2e` partition (each in its own CI container via its +//! own `makers` task); `--all` first runs the `packages` set (`makers +//! container-test`) and adds its row to the table. The runner streams each +//! run's output while capturing it, parses the nextest summary line (tallies +//! and wall-clock duration), and aggregates the totals. //! //! Unlike a cargo-make `dependencies` list (which is fail-fast), this runs BOTH //! partitions even when the first fails, so the summary reflects the whole @@ -19,6 +21,14 @@ use std::error::Error; use std::io::{BufRead, BufReader}; use std::process::{Command, Stdio}; +/// Which partitions this invocation runs and summarizes. +enum TestSet { + /// The two live partitions (`makers test live`). + Live, + /// The packages set plus the two live partitions (`makers test all`). + All, +} + /// One nextest run's tallies, zero where the summary line was absent. #[derive(Default)] struct Summary { @@ -26,6 +36,8 @@ struct Summary { passed: u64, failed: u64, skipped: u64, + /// Wall-clock milliseconds from the summary line's `[ 510.718s]` stamp. + millis: u64, } impl Summary { @@ -35,6 +47,7 @@ impl Summary { passed: self.passed + other.passed, failed: self.failed + other.failed, skipped: self.skipped + other.skipped, + millis: self.millis + other.millis, } } } @@ -104,6 +117,25 @@ fn count_before(line: &str, marker: &str) -> u64 { head[head.len() - digit_count..].parse().unwrap_or(0) } +/// The wall-clock milliseconds from the summary line's `[ 510.718s]` stamp, +/// or 0 if absent. Parsed as integers (whole seconds and up to three +/// fractional digits) — no floating point. +fn duration_millis(line: &str) -> u64 { + let Some(idx) = line.find("s]") else { + return 0; + }; + let head = &line[..idx]; + let start = head + .rfind(|c: char| !(c.is_ascii_digit() || c == '.')) + .map_or(0, |i| i + 1); + let stamp = &head[start..]; + let (whole, frac) = stamp.split_once('.').unwrap_or((stamp, "")); + let whole: u64 = whole.parse().unwrap_or(0); + // Right-pad the fraction to exactly three digits ("7" -> 700ms). + let frac: u64 = format!("{frac:0<3.3}").parse().unwrap_or(0); + whole * 1000 + frac +} + /// Parse the last nextest summary line out of a captured run. /// /// nextest prints e.g.: @@ -115,8 +147,7 @@ fn parse_summary(log: &str) -> Summary { let line = log .lines() .map(strip_ansi) - .filter(|l| l.contains("run:") && l.contains("test")) - .last() + .rfind(|l| l.contains("run:") && l.contains("test")) .unwrap_or_default(); Summary { @@ -125,18 +156,34 @@ fn parse_summary(log: &str) -> Summary { passed: count_before(&line, "passed"), failed: count_before(&line, "failed"), skipped: count_before(&line, "skipped"), + millis: duration_millis(&line), } } fn print_row(label: &str, s: &Summary) { + let secs = format!("{}.{:03}", s.millis / 1000, s.millis % 1000); println!( - " {label:<18} {:>4} run, {:>4} passed, {:>4} failed, {:>4} skipped", + " {label:<18} {:>4} run, {:>4} passed, {:>4} failed, {:>4} skipped, {secs:>10}s", s.run, s.passed, s.failed, s.skipped ); } fn main() -> Result<(), Box> { let with_zcashd = std::env::args().any(|a| a == "--with-zcashd"); + let set = if std::env::args().any(|a| a == "--all") { + TestSet::All + } else { + TestSet::Live + }; + + let packages = match set { + TestSet::All => { + println!(">>> all: running packages set"); + let (rc, log) = run_partition("container-test", with_zcashd)?; + Some((rc, parse_summary(&log))) + } + TestSet::Live => None, + }; println!(">>> live: running clientless partition"); let (cl_rc, cl_log) = run_partition("live-clientless", with_zcashd)?; @@ -147,15 +194,32 @@ fn main() -> Result<(), Box> { let cl = parse_summary(&cl_log); let e2e = parse_summary(&e2e_log); + let header = match packages { + Some(_) => "test summary", + None => "live summary", + }; + let mut total = cl.add(&e2e); + if let Some((_, p)) = &packages { + total = total.add(p); + } + println!(); - println!("====================== live summary =========================="); + println!("====================== {header} =========================="); + if let Some((_, p)) = &packages { + print_row("packages:", p); + } print_row("clientless:", &cl); print_row("e2e:", &e2e); - print_row("TOTAL:", &cl.add(&e2e)); + print_row("TOTAL:", &total); println!("=============================================================="); // A partition that errored without producing a summary line likely failed // to build; call it out so the zeros above aren't read as "all clear". + if let Some((pkg_rc, p)) = &packages { + if *pkg_rc != 0 && p.run == 0 { + println!(" warning: packages produced no nextest summary (build failure?) — see output above."); + } + } if cl_rc != 0 && cl.run == 0 { println!(" warning: clientless produced no nextest summary (build failure?) — see output above."); } @@ -163,8 +227,9 @@ fn main() -> Result<(), Box> { println!(" warning: e2e produced no nextest summary (build failure?) — see output above."); } - // Fail the front door if either partition failed. - if cl_rc != 0 || e2e_rc != 0 { + // Fail the front door if any set failed. + let pkg_rc = packages.map_or(0, |(rc, _)| rc); + if pkg_rc != 0 || cl_rc != 0 || e2e_rc != 0 { std::process::exit(1); } Ok(()) @@ -215,3 +280,39 @@ mod parse_summary { check(log, 9, 7, 1, 1); } } + +#[cfg(test)] +mod duration_millis { + use super::*; + + #[test] + fn fractional_seconds_with_padding() { + assert_eq!(duration_millis("Summary [ 73.207s] 8 tests run: 8 passed"), 73_207); + } + + #[test] + fn no_padding() { + assert_eq!(duration_millis("Summary [510.718s] 29 tests run: 23 passed"), 510_718); + } + + #[test] + fn short_fraction_is_right_padded() { + assert_eq!(duration_millis("Summary [2.7s] 1 test run: 1 passed"), 2_700); + } + + #[test] + fn whole_seconds_without_fraction() { + assert_eq!(duration_millis("Summary [2s] 1 test run: 1 passed"), 2_000); + } + + #[test] + fn missing_stamp_is_zero() { + assert_eq!(duration_millis("no summary line here"), 0); + } + + #[test] + fn survives_through_parse_summary() { + let s = parse_summary("Summary [ 1.795s] 1 test run: 0 passed, 1 failed, 114 skipped"); + assert_eq!(s.millis, 1_795); + } +} From 2f3541a4a85352bfed928453ed71b38354051373 Mon Sep 17 00:00:00 2001 From: zancas Date: Mon, 13 Jul 2026 09:37:25 -0700 Subject: [PATCH 7/8] fix(ci): refresh the trixie apt pins the point release superseded The test-environment image rebuild (first since the ZEBRA_VERSION bump changed the image tag) failed because Debian trixie point updates replaced two pinned package versions, and the archive does not keep superseded versions: protobuf-compiler 3.21.12-11 -> 3.21.12-11+deb13u1 (all three build stages) and curl 8.14.1-2+deb13u3 -> 8.14.1-2+deb13u4 (both stages). Every other pin in the Containerfile still matches the archive; verified against qa.debian.org/madison and a live trixie-slim container. Co-Authored-By: Claude Fable 5 --- live-tests/test_environment/Containerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/live-tests/test_environment/Containerfile b/live-tests/test_environment/Containerfile index dabb4dea2..a6a19c7fd 100644 --- a/live-tests/test_environment/Containerfile +++ b/live-tests/test_environment/Containerfile @@ -46,7 +46,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ clang=1:19.0-63 \ cmake=3.31.6-2 \ pkg-config=1.8.1-4 \ - protobuf-compiler=3.21.12-11 \ + protobuf-compiler=3.21.12-11+deb13u1 \ libstdc++6=14.2.0-19 WORKDIR /zebra # Single RUN (DL3059): clone, checkout, build, and stage the binary. @@ -71,7 +71,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ autoconf=2.72-3.1 \ libtool=2.5.4-4 \ bsdmainutils=12.1.8 \ - curl=8.14.1-2+deb13u3 \ + curl=8.14.1-2+deb13u4 \ ca-certificates=20250419 \ netbase=6.5 @@ -99,7 +99,7 @@ ARG DEVTOOL_REV RUN apt-get update && apt-get install -y --no-install-recommends \ git=1:2.47.3-0+deb13u1 \ pkg-config=1.8.1-4 \ - protobuf-compiler=3.21.12-11 \ + protobuf-compiler=3.21.12-11+deb13u1 \ libsqlite3-dev=3.46.1-7+deb13u1 WORKDIR /devtool # Single RUN (DL3059): clone, checkout, build, and stage the binary. The @@ -140,12 +140,12 @@ LABEL org.zaino.test-artifacts.versions.rust="${RUST_VERSION}" # Versions pinned (DL3008) to the candidates in rust:1.95.0-trixie; bump # together with the base image (query with `apt-cache policy `). RUN apt-get update && apt-get install -y --no-install-recommends \ - curl=8.14.1-2+deb13u3 \ + curl=8.14.1-2+deb13u4 \ libclang-dev=1:19.0-63 \ build-essential=12.12 \ cmake=3.31.6-2 \ librocksdb-dev=9.10.0-1+b1 \ - protobuf-compiler=3.21.12-11 \ + protobuf-compiler=3.21.12-11+deb13u1 \ && rm -rf /var/lib/apt/lists/* # Create container_user. The GID may already belong to a base-image group From 92e5d35605b8e23a3961ebc1c6aa58c73c4a535d Mon Sep 17 00:00:00 2001 From: zancas Date: Thu, 9 Jul 2026 13:41:33 -0700 Subject: [PATCH 8/8] feat!: remove zcashd support entirely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zcashd support was gated behind the opt-in zcashd_support feature (docs/adr/0001, 0005) as a staging post on the deprecation path. This takes the final step, recorded in docs/adr/0008: the feature and everything it gated are deleted — the zcashd-shaped getpeerinfo parsing in zaino-fetch, the zcashd validator launchers and ValidatorKind::Zcashd in zaino-testutils, and the zcashd-backed live suites (json_server, devtool_zcashd, and the zcashd arms of the shared suites). Zebra (or another Zaino) is the only supported backing validator. The test-environment image no longer downloads or builds zcashd: the ZCASH_VERSION pin, the zcashd Containerfile stages, and the zcashd-conditional image targets are gone, collapsing the build matrix to final-prebuilt and final-zebrad-source, and the image tag no longer embeds a zcashd version. The --with-zcashd flag, the zcashd_test task, and the check-no-zcashd guard family are deleted; the guard is moot now that the no-zcashd build is the only build. Zaino still serves the zcashd-compatible RPC surface to its own clients. That wire contract — field names, error codes, response shapes, the zcashd_build/zcashd_subversion protobuf fields — is Zaino's product and is unaffected by which validator backs the index, so the comments citing zcashd RPC semantics for the serving surface stay. Co-Authored-By: Claude Fable 5 --- .env.testing-artifacts | 3 - .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/workflows/build-n-push-ci-image.yaml | 6 +- .github/workflows/ci.yml | 39 +- .github/workflows/compute-tag.yml | 2 +- CONTRIBUTING.md | 2 +- Cargo.toml | 7 - Makefile.toml | 43 +- README.md | 11 +- docs/adr/0001-zcashd-support-feature-gate.md | 7 +- docs/adr/0005-zcashd-support-default-off.md | 4 +- docs/adr/0008-remove-zcashd-support.md | 57 ++ docs/internal_spec.md | 2 +- docs/testing.md | 18 +- docs/use_cases.md | 4 +- live-tests/CONTEXT.md | 8 +- live-tests/clientless/Cargo.toml | 5 - live-tests/clientless/src/lib.rs | 4 +- live-tests/clientless/tests/chain_cache.rs | 71 -- live-tests/clientless/tests/fetch_service.rs | 163 ----- live-tests/clientless/tests/json_server.rs | 484 ------------- live-tests/clientless/tests/state_service.rs | 2 +- live-tests/e2e/Cargo.toml | 12 - live-tests/e2e/tests/devtool.rs | 7 +- live-tests/e2e/tests/devtool_zcashd.rs | 672 ------------------ live-tests/quick_test.txt | 35 - live-tests/test_environment/Containerfile | 70 -- live-tests/test_environment/entrypoint.sh | 24 +- live-tests/zaino-testutils/Cargo.toml | 12 - live-tests/zaino-testutils/src/lib.rs | 236 +----- packages/zaino-common/src/config/validator.rs | 2 +- packages/zaino-fetch/Cargo.toml | 6 - .../zaino-fetch/src/jsonrpsee/connector.rs | 4 +- .../src/jsonrpsee/response/peer_info.rs | 343 +-------- packages/zaino-fetch/src/lib.rs | 2 +- packages/zaino-serve/Cargo.toml | 5 - packages/zaino-state/Cargo.toml | 5 - packages/zaino-state/src/chain_index.rs | 4 +- packages/zaino-state/src/config.rs | 2 +- .../src/indexer/node_backed_indexer.rs | 2 +- packages/zaino-state/src/lib.rs | 2 +- packages/zainod/Cargo.toml | 10 - packages/zainod/README.md | 2 +- packages/zainod/src/config.rs | 2 +- tools/scripts/build-image.sh | 3 +- tools/scripts/check-zaino-proto-heavy.rs | 78 -- tools/scripts/get-ci-image-tag.sh | 4 +- tools/scripts/help.sh | 2 +- tools/scripts/helpers.sh | 11 +- tools/scripts/validate-makefile-tasks.rs | 2 +- tools/scripts/verify-all.sh | 10 +- tools/test-runner/src/bin/container-test.rs | 31 +- tools/test-runner/src/bin/live-summary.rs | 20 +- 53 files changed, 145 insertions(+), 2419 deletions(-) create mode 100644 docs/adr/0008-remove-zcashd-support.md delete mode 100644 live-tests/clientless/tests/json_server.rs delete mode 100644 live-tests/e2e/tests/devtool_zcashd.rs delete mode 100644 tools/scripts/check-zaino-proto-heavy.rs diff --git a/.env.testing-artifacts b/.env.testing-artifacts index e1e14d228..cc46b4b45 100644 --- a/.env.testing-artifacts +++ b/.env.testing-artifacts @@ -2,9 +2,6 @@ # rust-toolchain.toml's `channel`; consumers derive it via # the workbench get-rust-version bin. -# zcashd Git tag (https://github.com/zcash/zcash/releases) -ZCASH_VERSION=6.20.0 - ZEBRA_VERSION=6.0.0 # zcash-devtool git ref (https://github.com/zingolabs/zcash-devtool) — diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index f2a1fe794..505cd0ac4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -70,7 +70,7 @@ body: description: | Please include: - Zaino version or commit hash - - Backend version (zebra/zcashd) + - Backend version (zebra) - OS and platform placeholder: | Zaino: v0.x.x or commit abc123 diff --git a/.github/workflows/build-n-push-ci-image.yaml b/.github/workflows/build-n-push-ci-image.yaml index e29b963f2..cc596557c 100644 --- a/.github/workflows/build-n-push-ci-image.yaml +++ b/.github/workflows/build-n-push-ci-image.yaml @@ -38,7 +38,7 @@ jobs: run: | source .env.testing-artifacts RUST_VERSION=$(cargo run -q --manifest-path tools/workbench/Cargo.toml --bin get-rust-version) - export RUST_VERSION ZCASH_VERSION ZEBRA_VERSION DEVTOOL_VERSION + export RUST_VERSION ZEBRA_VERSION DEVTOOL_VERSION TAG=$(./tools/scripts/get-ci-image-tag.sh) echo "tag=$TAG" >> "$GITHUB_OUTPUT" @@ -55,7 +55,6 @@ jobs: ZEBRA_GIT_REF=$(cargo run -q --manifest-path tools/workbench/Cargo.toml --bin get-zebra-git-ref -- "$ZEBRA_VERSION") echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" echo "RUST_VERSION=$RUST_VERSION" >> "$GITHUB_ENV" - echo "ZCASH_VERSION=$ZCASH_VERSION" >> "$GITHUB_ENV" echo "ZEBRA_VERSION=$ZEBRA_VERSION" >> "$GITHUB_ENV" echo "ZEBRA_GIT_REF=$ZEBRA_GIT_REF" >> "$GITHUB_ENV" echo "DEVTOOL_VERSION=$DEVTOOL_VERSION" >> "$GITHUB_ENV" @@ -65,7 +64,7 @@ jobs: run: | set -a source ./tools/scripts/helpers.sh - TARGET=$(resolve_build_target ${{ env.ZCASH_VERSION }} ${{ env.ZEBRA_VERSION }}) + TARGET=$(resolve_build_target ${{ env.ZEBRA_VERSION }}) echo "target=$TARGET" >> "$GITHUB_OUTPUT" - name: Build and Push Docker Image @@ -82,7 +81,6 @@ jobs: push: ${{ github.event_name != 'workflow_dispatch' || inputs.push }} build-args: | RUST_VERSION=${{ env.RUST_VERSION }} - ZCASH_VERSION=${{ env.ZCASH_VERSION }} ZEBRA_VERSION=${{ env.ZEBRA_VERSION }} ZEBRA_GIT_REF=${{ env.ZEBRA_GIT_REF }} DEVTOOL_VERSION=${{ env.DEVTOOL_VERSION }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c25f006d2..fe2d0bf83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,38 +101,6 @@ jobs: compute-tag: uses: ./.github/workflows/compute-tag.yml - no-zcashd-build: - name: No-zcashd build (--no-default-features) - # The default-on `zcashd_support` feature is being deprecated; its OFF - # state must keep compiling or the deprecation path bit-rots. Runs in the - # CI container (toolchain + git deps + cargo cache) like the build job, so - # it is skipped on PRs until a self-hosted runner is available — same as the - # other compiling jobs. See docs/adr/0001-zcashd-support-feature-gate.md. - needs: compute-tag - container: - image: docker.io/zingodevops/zaino-ci:${{ needs.compute-tag.outputs.image-tag }} - runs-on: arc-sh-runners - if: github.event_name != 'pull_request' && github.event.pull_request.draft == false - steps: - - name: Checkout repository - uses: actions/checkout@v7 - - - name: Restore cargo dependencies - uses: tespkg/actions-cache/restore@v1 - with: - endpoint: ${{ env.CACHE_ENDPOINT }} - port: ${{ env.CACHE_PORT }} - bucket: ${{ env.CACHE_BUCKET }} - insecure: ${{ env.INSECURE_CACHE }} - key: cargo-deps-${{ hashFiles('**/Cargo.lock') }} - restore-keys: cargo-deps- - path: | - ~/.cargo - target/debug/deps - - - name: Check no-zcashd build across all three workspaces - run: makers check-no-zcashd - build-test-artifacts: name: Build test artifacts needs: compute-tag @@ -166,8 +134,6 @@ jobs: # test crates' own dependency declarations and survive feature # unification, so the harness still functions. This deliberately omits # the product features `--all-features` was speculatively enabling: - # - zcashd_support (opt-in; docs/adr/0001, 0005): zcashd is being - # deprecated; zcashd-backed tests cfg out and are not executed in CI. # - experimental_features / transparent_address_history_experimental: # not shipped on by default; CI should not gate on a non-release combo. # - prometheus. @@ -211,11 +177,10 @@ jobs: # - "clientless::chain_cache" # disabled: timeouts/hangs pending chain-index # integration; re-enable per https://github.com/zingolabs/zaino/issues/1312 - "clientless::fetch_service" - - "clientless::json_server" - "clientless::state_service" - "clientless::test_vectors" - # NOTE: the e2e partition (e2e::devtool, e2e::devtool_zcashd, - # e2e::test_vectors) now lives in the unified --workspace archive and + # NOTE: the e2e partition (e2e::devtool, e2e::test_vectors) now + # lives in the unified --workspace archive and # is compiled every run, but is intentionally NOT executed here — # adding the validator-heavy e2e suite to this job is a CI-capacity # decision tracked in https://github.com/zingolabs/zaino/issues/1308. diff --git a/.github/workflows/compute-tag.yml b/.github/workflows/compute-tag.yml index c7d279f10..bc3ab30e3 100644 --- a/.github/workflows/compute-tag.yml +++ b/.github/workflows/compute-tag.yml @@ -22,7 +22,7 @@ jobs: run: | source .env.testing-artifacts RUST_VERSION=$(cargo run -q --manifest-path tools/workbench/Cargo.toml --bin get-rust-version) - export RUST_VERSION ZCASH_VERSION ZEBRA_VERSION DEVTOOL_VERSION DOCKER_DIR_HASH + export RUST_VERSION ZEBRA_VERSION DEVTOOL_VERSION DOCKER_DIR_HASH TAG=$(./tools/scripts/get-ci-image-tag.sh) echo "TAG=$TAG" echo "tag=$TAG" >> "$GITHUB_OUTPUT" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb3f09e2f..01f91e9c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,7 +77,7 @@ Error handling must be included and expose underlying information as much as and Merges must minimally reflect the zcash RPC spec and include a link to the relevant zcash C++ implementation (URLs that point at the analogous logic), OR reflect the C++ implementation. -Tests are encouraged that show parity bewteen responses from `zcash-cli` + `zcashd` and `zaino`+ a `zebra` backend, and the local cache. +Tests are encouraged that show parity between responses from `zaino` + a `zebra` backend and the local cache. ## Local Testing Local testing requires a system with ample resources, particularly RAM. diff --git a/Cargo.toml b/Cargo.toml index e13a29ac6..e670a783b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,15 +118,8 @@ bitflags = "2.9" # Test tempfile = "3.2" -# `zcashd_support` is opt-in, not a default (docs/adr/0005), so these path deps -# no longer need `default-features = false` to drop it: their default feature -# set is already empty. Enable zcashd end-to-end with `--features zcashd_support`. zainod = { path = "packages/zainod" } zaino-common = { path = "packages/zaino-common", version = "0.2.0" } -# default-features = false so the default-on `zcashd_support` feature can be -# dropped end-to-end via `--no-default-features`; each consumer re-enables it -# by forwarding `zcashd_support` in its own `default`. See -# docs/adr/0001-zcashd-support-feature-gate.md. zaino-fetch = { path = "packages/zaino-fetch", version = "0.2.1", default-features = false } zaino-proto = { path = "packages/zaino-proto", version = "0.1.3" } zaino-state = { path = "packages/zaino-state", version = "0.3.1", default-features = false } diff --git a/Makefile.toml b/Makefile.toml index 2bcaec624..b37b1f5c4 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -93,9 +93,9 @@ script.main = 'source "./tools/scripts/push-image.sh"' [tasks.container-test] clear = true -description = "Engine: run nextest in the local CI container, forwarding args (zcashd_support OFF by default; --with-zcashd adds --features zcashd_support). Devs use `makers test [packages|e2e|clientless|live|all]`; live-clientless / live-e2e and the `test` front door call this." +description = "Engine: run nextest in the local CI container, forwarding args. Devs use `makers test [packages|e2e|clientless|live|all]`; live-clientless / live-e2e and the `test` front door call this." # This task runs tests inside the container built from live-tests/test_environment. -# The entrypoint.sh script in the container sets up test binaries (zcashd, zebrad, zcash-cli) +# The entrypoint.sh script in the container sets up test binaries (zebrad, zcash-devtool) # by creating symlinks from /home/container_user/artifacts to the expected live-tests/test_binaries/bins location. dependencies = ["init-podman-volumes", "ensure-image-exists"] script_runner = "bash" @@ -142,15 +142,14 @@ script.main = 'source "./tools/scripts/container-nextest-workspace.sh"' # SET names mirror the crate/dir names (`e2e`, `clientless`); `packages`, # `live`, and `all` are the groupings. `live` = all non-packages tests; `all` # = `packages` + `live` (see live-tests/CONTEXT.md). Each set delegates to an -# existing engine rather than re-implementing a run. `--with-zcashd` (handled -# by the engines) adds the zcashd-backed tests to any set. +# existing engine rather than re-implementing a run. # =================================================================== [tasks.test] # clear = true fully replaces cargo-make's built-in `test` task (which runs # `cargo test`); without it our `script` would merge with the builtin `command`. clear = true -description = "Run a test set: `makers test [packages|e2e|clientless|live|all|ironwood]` (default: packages). Pass --with-zcashd for the zcashd-backed tests." +description = "Run a test set: `makers test [packages|e2e|clientless|live|all|ironwood]` (default: packages)." script_runner = "bash" script = ''' set -uo pipefail @@ -165,9 +164,8 @@ usage() { } # A non-flag first arg selects the set and must be a known name; a flag first -# arg (or none) keeps the default `packages` and is forwarded to nextest. So -# `makers test --with-zcashd` runs packages with the flag, while a mistyped set -# name errors instead of silently running the default. +# arg (or none) keeps the default `packages` and is forwarded to nextest, while +# a mistyped set name errors instead of silently running the default. set="packages" if [ "$#" -gt 0 ] && [ "${1#-}" = "$1" ]; then case "$1" in @@ -206,15 +204,6 @@ esac # ------------------------------------------------------------------- -[tasks.zcashd_test] -description = "Convenience: the whole suite with the zcashd-backed tests (`makers test all --with-zcashd`)" -# Delegates to the `test all` front door with the explicit flag — there is no -# implicit/env-var path to enable zcashd (docs/adr/0005). -script_runner = "bash" -script = 'exec makers test all --with-zcashd' - -# ------------------------------------------------------------------- - [tasks.check-matching-zebras] description = "Check that zebra versions in .env.testing-artifacts match what's in Cargo.toml" extend = "base-script" @@ -272,23 +261,3 @@ script = 'source "./tools/scripts/verify-all.sh"' # ------------------------------------------------------------------- -# Verify the no-zcashd build compiles: `zcashd_support` is opt-in and being -# deprecated (docs/adr/0001, 0005), so the default --no-default-features build -# must stay green or it bit-rots. The reunified workspace (production + -# live-test crates) is checked in a single pass. -[tasks.check-no-zcashd-packages] -description = "cargo check --no-default-features across the whole workspace (zcashd_support off)" -command = "cargo" -args = ["check", "--workspace", "--all-targets", "--no-default-features"] - -[tasks.check-zaino-proto-heavy] -description = "Guard: zaino-proto `heavy` must stay enabled under --no-default-features (else the no-zcashd test build silently loses zebra-state/zebra-chain/which)" -script_runner = "@rust" -script = { file = "tools/scripts/check-zaino-proto-heavy.rs" } - -[tasks.check-no-zcashd] -description = "Verify the no-zcashd (--no-default-features) build compiles across the workspace, and that zaino-proto `heavy` survives it" -dependencies = [ - "check-zaino-proto-heavy", - "check-no-zcashd-packages", -] diff --git a/README.md b/README.md index 0b8ca92f4..1c181a6af 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Zaino Zaino is an indexer for the Zcash blockchain implemented in Rust. -Zaino provides all necessary functionality for "light" clients (wallets and other applications that don't rely on the complete history of blockchain) and "full" clients / wallets and block explorers providing access to both the finalized chain and the non-finalized best chain and mempool held by either a Zebra or Zcashd full validator. +Zaino provides all necessary functionality for "light" clients (wallets and other applications that don't rely on the complete history of blockchain) and "full" clients / wallets and block explorers providing access to both the finalized chain and the non-finalized best chain and mempool held by a Zebra full validator. ### Motivations @@ -38,11 +38,11 @@ packages/ Cargo workspace member crates zaino-serve/ gRPC server (CompactTxStreamer) zainod/ Daemon binary -live-tests/ Live-test suite — root-workspace members, run against zcashd/zebrad +live-tests/ Live-test suite — root-workspace members, run against zebrad e2e/ End-to-end partition (wallet client -> Zaino -> validator) clientless/ Clientless partition (Zaino services -> live validator, no client) zaino-testutils/ Shared test harness and utilities - test_binaries/ Symlinked zcashd/zebrad/zcash-cli binaries + test_binaries/ Symlinked zebrad/zcash-devtool binaries test_environment/ Container build context Containerfile CI/test container image definition entrypoint.sh Container entrypoint (binary symlink setup) @@ -61,7 +61,7 @@ Cargo.lock Resolved dependency graph (committed) Makefile.toml cargo-make task definitions rust-toolchain.toml Pinned Rust toolchain deny.toml cargo-deny policy (licenses, advisories) -.env.testing-artifacts Version pins for test container (Rust, zcashd, zebrad) +.env.testing-artifacts Version pins for test container (Rust, zebrad, devtool) Dockerfile Production container image entrypoint.sh Production container entrypoint @@ -109,8 +109,7 @@ makers test live # both live partitions (clientless + e2e) + combined summ makers test all # everything: packages then live ``` -zcashd-backed tests are **off by default**; add `--with-zcashd` to include them -(there is no implicit or env-var path — see docs/adr/0005). On lower-resource machines you +On lower-resource machines you may hit occasional contention flakes under full parallelism — re-run, or lower `test-threads` in the nextest config. See [docs/testing.md](./docs/testing.md) for full instructions. diff --git a/docs/adr/0001-zcashd-support-feature-gate.md b/docs/adr/0001-zcashd-support-feature-gate.md index 2698c6617..cf5e48b23 100644 --- a/docs/adr/0001-zcashd-support-feature-gate.md +++ b/docs/adr/0001-zcashd-support-feature-gate.md @@ -2,10 +2,9 @@ ## Status -accepted — the **default-on** choice is superseded by -[ADR-0005](0005-zcashd-support-default-off.md): `zcashd_support` is now -**opt-in** (`default = []`). The feature, its additive semantics, its name, and -what it gates (below) all still stand; only its default membership changed. +superseded by [ADR-0008](0008-remove-zcashd-support.md): zcashd support is +removed entirely, the feature with it. (The **default-on** choice had already +been superseded by [ADR-0005](0005-zcashd-support-default-off.md).) ## Context and decision diff --git a/docs/adr/0005-zcashd-support-default-off.md b/docs/adr/0005-zcashd-support-default-off.md index 3b96c162d..7a8316902 100644 --- a/docs/adr/0005-zcashd-support-default-off.md +++ b/docs/adr/0005-zcashd-support-default-off.md @@ -2,7 +2,9 @@ ## Status -accepted (supersedes the default-on decision in ADR-0001) +superseded by [ADR-0008](0008-remove-zcashd-support.md): zcashd support is +removed entirely, the feature with it. (This ADR had superseded the default-on +decision in ADR-0001.) ## Context and decision diff --git a/docs/adr/0008-remove-zcashd-support.md b/docs/adr/0008-remove-zcashd-support.md new file mode 100644 index 000000000..6d60ab89d --- /dev/null +++ b/docs/adr/0008-remove-zcashd-support.md @@ -0,0 +1,57 @@ +# zcashd support is removed + +## Status + +accepted (supersedes ADR-0001 and ADR-0005, which gated and then defaulted-off +the `zcashd_support` feature) + +## Context and decision + +ADR-0001 introduced the `zcashd_support` Cargo feature to gate zcashd-backed +code, and ADR-0005 made it opt-in rather than a default. Both were staging +posts on the deprecation path: zcashd itself is deprecated ecosystem-wide, the +gated code compiled out of every default build and CI run, and nothing +exercised it except an explicitly flagged test pass against a zcashd binary +that the project had to keep building into its CI image. + +We remove zcashd support entirely. Concretely: + +- The `zcashd_support` feature and everything it gated are deleted: the + zcashd-shaped `getpeerinfo` parsing in zaino-fetch, the zcashd validator + launchers and `ValidatorKind::Zcashd` in zaino-testutils, and the + zcashd-backed test suites (`clientless::json_server`, `e2e::devtool_zcashd`, + the zcashd arms of the other live suites). +- The test-environment image no longer downloads or builds zcashd/zcash-cli; + the `ZCASH_VERSION` pin, the zcashd Containerfile stages, and the + zcashd-conditional image targets are gone. The image tag no longer embeds a + zcashd version. +- The `--with-zcashd` flag, the `makers zcashd_test` convenience task, and the + `makers check-no-zcashd` guard family are deleted. The guard is moot: the + no-zcashd build is now the only build. +- Zebra (or another Zaino) is the only supported backing validator. + +What this does **not** remove: Zaino still serves the zcashd-compatible RPC +surface to its own clients — that wire contract (field names, error codes, +response shapes, the `zcashd_build`/`zcashd_subversion` protobuf fields) is +Zaino's product, documented against the canonical +[Zcash RPC reference](https://zcash.github.io/rpc/), and is unaffected by +which validator backs the index. Comments citing zcashd semantics for that +serving surface stay. + +## Considered options + +1. Keep the opt-in feature indefinitely. Rejected: the gated code was + unexercised by default, so it could only bit-rot; keeping it also forced + the CI image to keep building a deprecated C++ codebase and kept a + four-way build-target matrix alive in the Containerfile. +2. Remove support (chosen). + +## Consequences + +- Anyone still fronting a zcashd validator with Zaino must pin a release + before this change. +- The CI image shrinks to two build targets (prebuilt zebra vs + zebra-from-source) and rebuilds faster. +- Restoring zcashd support would mean reverting this change and re-growing + the test matrix; the deleted code remains available in git history and in + the releases that shipped it. diff --git a/docs/internal_spec.md b/docs/internal_spec.md index 00da2928e..073baf5e7 100644 --- a/docs/internal_spec.md +++ b/docs/internal_spec.md @@ -172,7 +172,7 @@ Full documentation for `Zaino-State` can be found [here](https://zingolabs.githu ## Zaino-Fetch -`Zaino-Fetch` is a library that provides access to the mempool and blockchain data using Zcash's JsonRPC interface. It is primarily used as a backup and for backward compatibility with systems that rely on RPC communication such as `Zcashd`. +`Zaino-Fetch` is a library that provides access to the mempool and blockchain data using Zcash's JsonRPC interface. It is primarily used as a backup and for backward compatibility with systems that rely on RPC communication. ### Functionality - RPC Client Implementation: diff --git a/docs/testing.md b/docs/testing.md index 9bfd24575..4c0084c38 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -2,10 +2,9 @@ ### Dependencies 1) [Zebrad](https://github.com/ZcashFoundation/zebra.git) 2) [Lightwalletd](https://github.com/zcash/lightwalletd.git) -3) [Zcashd, Zcash-Cli](https://github.com/zcash/zcash) ### Tests -1) Symlink or copy compiled `zebrad`, `zcashd` and `zcash-cli` binaries to `zaino/live-tests/test_binaries/bins/*` +1) Symlink or copy compiled `zebrad` binaries to `zaino/live-tests/test_binaries/bins/*` 2) Add `zaino/live-tests/test_binaries/bins` to `$PATH` or to `$TEST_BINARIES_DIR` 3) Run `cargo nextest run` @@ -39,21 +38,6 @@ The single front door is `makers test [SET]`, where `SET` defaults to `packages` the `test` front door delegates to; invoke them directly only when you need to forward engine flags.) -### zcashd-backed tests are OFF by default - -zcashd is being deprecated, so `zcashd_support` is **opt-in, not a default** -feature (docs/adr/0005): every test path runs `--no-default-features`, so the -zcashd-backed tests are compiled out. There is **no implicit or env-var path** -to enable them — only the explicit flag: - -- pass the flag: `makers test --with-zcashd`, `makers test live --with-zcashd`, - or `makers test all --with-zcashd` (it adds `--features zcashd_support`) -- use the convenience task: `makers zcashd_test` (equivalent to - `makers test all --with-zcashd`) - -See `docs/adr/0001-zcashd-support-feature-gate.md` (and `0005` for the -default-off revision) for the rationale. - ### Test contention on lower-resource machines The suites run at full parallelism (one test thread per CPU), and each diff --git a/docs/use_cases.md b/docs/use_cases.md index a19769d25..7e7afb867 100644 --- a/docs/use_cases.md +++ b/docs/use_cases.md @@ -1,6 +1,6 @@ # Indexer Live Service ### Dependencies -1) [Zebrad](https://github.com/ZcashFoundation/zebra.git) or [Zcashd, Zcash-Cli](https://github.com/zcash/zcash.git) +1) [Zebrad](https://github.com/ZcashFoundation/zebra.git) 2) [Zingolib](https://github.com/zingolabs/zingolib.git) [if running Zingo-Cli] ### Running ZainoD @@ -35,7 +35,7 @@ Zaino-State serves as Zaino's chain fetch and transaction submission library. Th The use of a `Service` and `ServiceSubscriber` separates the core chainstate maintainer processes from fetch fuctionality, enabling zaino to serve a large number of concurrent clients efficiently. In the future we will also be adding a lightweight tonic backend option for clients that do not want to run any chainstate processes locally. Currently 2 `Service's` are being implemented, with plans for several more: -- FetchService: Zcash JsonRPC powered backend service enabling compatibility with a large number of validator options (zcashd, zebrad). +- FetchService: Zcash JsonRPC powered backend service enabling compatibility with JsonRPC validator options (zebrad). - StateService: Highly efficient chain fetch service tailored to run with ZebraD. Future Planned backend Services: diff --git a/live-tests/CONTEXT.md b/live-tests/CONTEXT.md index 1bef4076e..9173d9da1 100644 --- a/live-tests/CONTEXT.md +++ b/live-tests/CONTEXT.md @@ -8,7 +8,7 @@ flow. Split into two partitions, `e2e` and `clientless`. ## Language **Live test**: -A test that requires a *live* validator process (Zebra or zcashd), and +A test that requires a *live* validator process (Zebra), and optionally a live wallet client, to exercise Zaino against real external infrastructure. The defining property of this suite and the reason it is excluded from the default `container-test` flow and run only by its own task @@ -26,7 +26,7 @@ _Avoid_: wallet test, wallet-tests, lightclient. **clientless (test partition)**: The partition that drives Zaino's service layer (`FetchService`/`StateService` subscribers, RPC surface) directly against a live validator, with no wallet -client — fetch-vs-state and zcashd-vs-zainod oracle checks. Formerly the +client — fetch-vs-state oracle checks. Formerly the `walletless-tests` package; named `integration` until docs/adr/0004 reverted that to `clientless`. The crate/dir is `live-tests/clientless`; selected with `-p clientless` or `makers test clientless`. @@ -36,8 +36,8 @@ reverted in docs/adr/0004, now reserved for Cargo's sense). **zaino-testutils**: The client-agnostic test harness consumed by both the `e2e` and `clientless` partitions. A standalone crate, not part of either partition; it -owns shared fixtures and the feature-forwarding surface (`zcashd_support`, -`transparent_address_history_experimental`). +owns shared fixtures and the feature-forwarding surface +(`transparent_address_history_experimental`). _Avoid_: test helpers, testlib. **packages (test set)**: diff --git a/live-tests/clientless/Cargo.toml b/live-tests/clientless/Cargo.toml index c8945a81a..99827fa39 100644 --- a/live-tests/clientless/Cargo.toml +++ b/live-tests/clientless/Cargo.toml @@ -13,11 +13,6 @@ version = "0.2.0" [features] default = [] -# Support for the zcashd test validator. Opt-in (default off, docs/adr/0005); being deprecated. Gates -# the zcashd-backed tests and forwards to zaino-testutils. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = ["zaino-testutils/zcashd_support"] - # **Experimental and alpha features** # Exposes the **complete** set of experimental / alpha features currently implemented in Zaino. experimental_features = ["transparent_address_history_experimental"] diff --git a/live-tests/clientless/src/lib.rs b/live-tests/clientless/src/lib.rs index 12d93f9be..4e3bcb7ad 100644 --- a/live-tests/clientless/src/lib.rs +++ b/live-tests/clientless/src/lib.rs @@ -76,7 +76,7 @@ pub mod rpc { // let expected_sprout = ZValidateAddress::sprout("ztfhKyLouqi8sSwjRm4YMQdWPjTmrJ4QgtziVQ1Kd1e9EsRHYKofjoJdF438FwcUQnix8yrbSrzPpJJNABewgNffs5d4YZJ".to_string(), "c8e8797f1fb5e9cf6b2d000177c5994119279a2629970a4f669aed1362a4cca5".to_string(), "480f78d61bdd7fc4b4edeef9f6305b29753057ab1008d42ded1a3364dac2d83c".to_string()); - // let fs_sprout = zcashd_subscriber + // let fs_sprout = subscriber // .z_validate_address("ztfhKyLouqi8sSwjRm4YMQdWPjTmrJ4QgtziVQ1Kd1e9EsRHYKofjoJdF438FwcUQnix8yrbSrzPpJJNABewgNffs5d4YZJ".to_string()) // .await // .unwrap(); @@ -114,7 +114,7 @@ pub mod rpc { /// Build the `z_validate_address` rpc-call closure from `subscriber` and /// run the shared validation suite. Factors the identical closure + /// suite-call preamble shared by the four `z_validate_address` tests - /// (fetch_service zcashd/zebrad, state_service, json_server). + /// (fetch_service and state_service). #[allow(deprecated)] pub async fn run_z_validate_for(subscriber: &S) { let rpc_call = diff --git a/live-tests/clientless/tests/chain_cache.rs b/live-tests/clientless/tests/chain_cache.rs index eb173f2e0..1ae1be521 100644 --- a/live-tests/clientless/tests/chain_cache.rs +++ b/live-tests/clientless/tests/chain_cache.rs @@ -48,8 +48,6 @@ mod chain_query_interface { }, Height, NodeBackedIndexerService, NodeBackedIndexerServiceConfig, ZcashService, }; - #[cfg(feature = "zcashd_support")] - use zcash_local_net::validator::zcashd::Zcashd; use zcash_local_net::validator::zebrad::Zebrad; use zebra_chain::{ parameters::{ @@ -202,40 +200,6 @@ mod chain_query_interface { index_reader, ) } - #[cfg(feature = "zcashd_support")] - ValidatorKind::Zcashd => { - let config = ChainIndexConfig { - storage: StorageConfig { - database: DatabaseConfig { - path: test_manager - .data_dir - .as_path() - .to_path_buf() - .join("chain-index-zaino"), - ..Default::default() - }, - ..Default::default() - }, - ephemeral, - db_version: 1, - // This fixture derives its runtime network from the - // heights the harness launched the validator with. - network: zaino_testutils::from_local_net_activation_heights( - &test_manager.local_net.get_activation_heights().await, - ) - .to_regtest_network(), - }; - let chain_index = NodeBackedChainIndex::new( - ValidatorConnector::Fetch(json_service.clone()), - config, - ) - .await - .unwrap(); - let index_reader = chain_index.subscriber(); - tokio::time::sleep(Duration::from_secs(3)).await; - - (test_manager, json_service, None, chain_index, index_reader) - } } } @@ -245,13 +209,6 @@ mod chain_query_interface { get_block_range::(&ValidatorKind::Zebrad).await } - #[cfg(feature = "zcashd_support")] - #[ignore = "prone to timeouts and hangs, to be fixed in chain index integration"] - #[tokio::test(flavor = "multi_thread")] - async fn get_block_range_zcashd() { - get_block_range::(&ValidatorKind::Zcashd).await - } - async fn get_block_range(validator: &ValidatorKind) where C: ValidatorExt, @@ -380,13 +337,6 @@ mod chain_query_interface { sync_large_chain::(&ValidatorKind::Zebrad).await } - #[cfg(feature = "zcashd_support")] - #[ignore = "prone to timeouts and hangs, to be fixed in chain index integration"] - #[tokio::test(flavor = "multi_thread")] - async fn sync_large_chain_zcashd() { - sync_large_chain::(&ValidatorKind::Zcashd).await - } - async fn sync_large_chain(validator: &ValidatorKind) where C: ValidatorExt, @@ -456,13 +406,6 @@ mod chain_query_interface { get_subtree_roots::(&ValidatorKind::Zebrad).await } - #[cfg(feature = "zcashd_support")] - #[ignore = "prone to timeouts and hangs, to be fixed in chain index integration"] - #[tokio::test(flavor = "multi_thread")] - async fn get_subtree_roots_zcashd() { - get_subtree_roots::(&ValidatorKind::Zcashd).await - } - async fn get_subtree_roots(validator: &ValidatorKind) where C: ValidatorExt, @@ -559,13 +502,6 @@ mod chain_query_interface { get_mempool_stream_fresh_snapshot_repeated::(&ValidatorKind::Zebrad).await } - #[cfg(feature = "zcashd_support")] - #[ignore = "prone to timeouts and hangs, to be fixed in chain index integration"] - #[tokio::test(flavor = "multi_thread")] - async fn get_mempool_stream_fresh_snapshot_repeated_zcashd() { - get_mempool_stream_fresh_snapshot_repeated::(&ValidatorKind::Zcashd).await - } - async fn get_mempool_stream_fresh_snapshot_repeated(validator: &ValidatorKind) where C: ValidatorExt, @@ -614,13 +550,6 @@ mod chain_query_interface { zallet_like_steady_state_loop::(&ValidatorKind::Zebrad).await } - #[cfg(feature = "zcashd_support")] - #[ignore = "prone to timeouts and hangs, to be fixed in chain index integration"] - #[tokio::test(flavor = "multi_thread")] - async fn zallet_like_steady_state_loop_zcashd() { - zallet_like_steady_state_loop::(&ValidatorKind::Zcashd).await - } - async fn zallet_like_steady_state_loop(validator: &ValidatorKind) where C: ValidatorExt, diff --git a/live-tests/clientless/tests/fetch_service.rs b/live-tests/clientless/tests/fetch_service.rs index dfcc290ec..c0c4962ca 100644 --- a/live-tests/clientless/tests/fetch_service.rs +++ b/live-tests/clientless/tests/fetch_service.rs @@ -130,68 +130,6 @@ async fn assert_fetch_service_mininginfo_matches_rpc(validator: .await; } -#[cfg(feature = "zcashd_support")] -#[allow(deprecated)] -async fn assert_fetch_service_gettxoutsetinfo_matches_rpc( - validator: &ValidatorKind, -) { - let (test_manager, fetch_service_subscriber) = - zaino_testutils::launch_with_fetch_subscriber::(validator, None).await; - - let fetch_service_txoutset_info = fetch_service_subscriber - .get_tx_out_set_info() - .await - .unwrap(); - - let jsonrpc_client = test_manager.full_node_jsonrpc_connector().await; - - let rpc_txoutset_info = jsonrpc_client.get_tx_out_set_info().await.unwrap(); - - // Structural parity with zcashd: height, bestblock, transactions, txouts and total_amount - // must match. `bytes_serialized` and `hash_serialized` are Zaino-defined (see the - // `gettxoutsetinfo` spec in zaino-state) and intentionally diverge from zcashd; only - // Zaino-internal invariants are asserted on those fields. - use zaino_fetch::jsonrpsee::response::GetTxOutSetInfoResponse; - let (zaino, zcashd) = match (fetch_service_txoutset_info, rpc_txoutset_info) { - (GetTxOutSetInfoResponse::Info(z), GetTxOutSetInfoResponse::Info(r)) => (z, r), - other => panic!("expected non-empty gettxoutsetinfo from both sides, got {other:?}"), - }; - - assert_eq!(zaino.height, zcashd.height, "`height` differs from zcashd"); - assert_eq!( - zaino.best_block, zcashd.best_block, - "`bestblock` differs from zcashd" - ); - assert_eq!( - zaino.transactions, zcashd.transactions, - "`transactions` count differs from zcashd" - ); - assert_eq!(zaino.txouts, zcashd.txouts, "`txouts` differs from zcashd"); - assert!( - (zaino.total_amount - zcashd.total_amount).abs() < 1e-8, - "`total_amount` differs from zcashd: zaino={} zcashd={}", - zaino.total_amount, - zcashd.total_amount - ); - - // Zaino-only invariants on the redefined fields. - assert_eq!( - zaino.bytes_serialized, - zaino.txouts * 65, - "`bytes_serialized` must equal `txouts * 65` under Zaino's UTXO entry encoding" - ); - assert_eq!( - zaino.hash_serialized.len(), - 64, - "`hash_serialized` must be 64 lowercase hex chars" - ); - assert!( - zaino.hash_serialized.chars().all(|c| c.is_ascii_hexdigit()), - "`hash_serialized` must be hex: got {}", - zaino.hash_serialized - ); -} - #[allow(deprecated)] async fn assert_fetch_service_peerinfo_matches_rpc(validator: &ValidatorKind) { assert_subscriber_matches_rpc::( @@ -581,107 +519,6 @@ async fn assert_fetch_service_getnetworksols_matches_rpc( .await; } -#[cfg(feature = "zcashd_support")] -#[allow(deprecated)] -async fn fetch_service_get_block_deltas(validator: &ValidatorKind) { - let (test_manager, fetch_service_subscriber) = - zaino_testutils::launch_with_fetch_subscriber::(validator, None).await; - - let current_block = fetch_service_subscriber.get_latest_block().await.unwrap(); - - let block_hash_bytes: [u8; 32] = current_block.hash.as_slice().try_into().unwrap(); - - let block_hash = zebra_chain::block::Hash::from(block_hash_bytes); - - // Note: we need an 'expected' block hash in order to query its deltas. - // Having a predictable or test vector chain is the way to go here. - let fetch_service_block_deltas = fetch_service_subscriber - .get_block_deltas(block_hash.to_string()) - .await - .unwrap(); - - let jsonrpc_client = test_manager.full_node_jsonrpc_connector().await; - - let rpc_block_deltas = jsonrpc_client - .get_block_deltas(block_hash.to_string()) - .await - .unwrap(); - - assert_eq!(fetch_service_block_deltas, rpc_block_deltas); -} - -#[cfg(feature = "zcashd_support")] -mod zcashd { - - use super::*; - use zcash_local_net::validator::zcashd::Zcashd; - - mod launch { - - use super::*; - - #[tokio::test(flavor = "multi_thread")] - pub(crate) async fn regtest_no_cache() { - launch_fetch_service::(&ValidatorKind::Zcashd, None).await; - } - - #[tokio::test(flavor = "multi_thread")] - #[ignore = "We no longer use chain caches. See zcashd::launch::regtest_no_cache."] - pub(crate) async fn regtest_with_cache() { - launch_fetch_service::( - &ValidatorKind::Zcashd, - zaino_testutils::ZCASHD_CHAIN_CACHE_DIR.clone(), - ) - .await; - } - } - - mod validation { - - use super::*; - - #[tokio::test(flavor = "multi_thread")] - pub(crate) async fn validate_address() { - fetch_service_validate_address::(&ValidatorKind::Zcashd).await; - } - - #[tokio::test(flavor = "multi_thread", worker_threads = 2)] - pub(crate) async fn z_validate_address() { - z_validate::(&ValidatorKind::Zcashd).await; - } - } - - mod get { - use super::*; - - zaino_testutils::validator_tests!( - Zcashd, - ValidatorKind::Zcashd, - block_raw => fetch_service_get_block_raw, - block_object => fetch_service_get_block_object, - latest_block => fetch_service_get_latest_block, - block => fetch_service_get_block, - block_header => fetch_service_get_block_header, - difficulty => assert_fetch_service_difficulty_matches_rpc, - block_deltas => fetch_service_get_block_deltas, - mining_info => assert_fetch_service_mininginfo_matches_rpc, - peer_info => assert_fetch_service_peerinfo_matches_rpc, - block_subsidy => fetch_service_get_block_subsidy, - best_blockhash => fetch_service_get_best_blockhash, - block_count => fetch_service_get_block_count, - block_nullifiers => fetch_service_get_block_nullifiers, - block_range => fetch_service_get_block_range, - block_range_nullifiers => fetch_service_get_block_range_nullifiers, - tree_state => fetch_service_get_tree_state, - latest_tree_state => fetch_service_get_latest_tree_state, - subtree_roots => fetch_service_get_subtree_roots, - lightd_info => fetch_service_get_lightd_info, - get_network_sol_ps => assert_fetch_service_getnetworksols_matches_rpc, - get_tx_out_set_info => assert_fetch_service_gettxoutsetinfo_matches_rpc, - ); - } -} - mod zebrad { use super::*; diff --git a/live-tests/clientless/tests/json_server.rs b/live-tests/clientless/tests/json_server.rs deleted file mode 100644 index b8c17443c..000000000 --- a/live-tests/clientless/tests/json_server.rs +++ /dev/null @@ -1,484 +0,0 @@ -//! Tests that compare the output of both `zcashd` and `zainod` through `FetchService`. -//! -//! Entirely gated on `zcashd_support`: every test here launches the -//! zcashd-backed dual fetch services. See -//! docs/adr/0001-zcashd-support-feature-gate.md. -#![cfg(feature = "zcashd_support")] - -use zaino_state::{NodeBackedIndexerServiceSubscriber, ZcashIndexer}; -use zaino_testutils::{Rpc, TestManager}; -use zcash_local_net::validator::zcashd::Zcashd; - -/// Assert that `query` returns the same value from the zcashd-backed and -/// zaino-backed subscribers. `query` takes the subscriber by value (subscribers -/// are `Clone`) so its future owns it — sidestepping the borrow-across-await -/// problem. The pure-compare building block of the json_server tests. -#[allow(deprecated)] -async fn assert_subscribers_agree( - zcashd_subscriber: &NodeBackedIndexerServiceSubscriber, - zaino_subscriber: &NodeBackedIndexerServiceSubscriber, - query: Q, -) where - Q: Fn(NodeBackedIndexerServiceSubscriber) -> Fut, - Fut: std::future::Future, - T: std::fmt::Debug + PartialEq, -{ - let from_zcashd = query(zcashd_subscriber.clone()).await; - let from_zaino = query(zaino_subscriber.clone()).await; - assert_eq!(from_zcashd, from_zaino); -} - -/// Mine `blocks` blocks one at a time, asserting `query` agrees across both -/// subscribers before each. The looped form of [`assert_subscribers_agree`] for -/// tests that check an invariant holds across the chain. -#[allow(deprecated)] -async fn compare_over_blocks( - test_manager: &TestManager, - zcashd_subscriber: &NodeBackedIndexerServiceSubscriber, - zaino_subscriber: &NodeBackedIndexerServiceSubscriber, - blocks: u32, - query: Q, -) where - Q: Fn(NodeBackedIndexerServiceSubscriber) -> Fut, - Fut: std::future::Future, - T: std::fmt::Debug + PartialEq, -{ - for _ in 0..blocks { - assert_subscribers_agree(zcashd_subscriber, zaino_subscriber, &query).await; - test_manager - .generate_blocks_and_wait_for_tips(1, zaino_subscriber, zcashd_subscriber) - .await; - } -} - -#[allow(deprecated)] -async fn launch_json_server_check_info() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - let zcashd_info = dbg!(services.zcashd_subscriber.get_info().await.unwrap()); - let zcashd_blockchain_info = dbg!(services - .zcashd_subscriber - .get_blockchain_info() - .await - .unwrap()); - let zaino_info = dbg!(services.zaino_subscriber.get_info().await.unwrap()); - let zaino_blockchain_info = dbg!(services - .zaino_subscriber - .get_blockchain_info() - .await - .unwrap()); - - // Clean timestamp from get_info - let cleaned_zcashd_info = zaino_testutils::get_info_with_zeroed_timestamp(zcashd_info); - - let cleaned_zaino_info = zaino_testutils::get_info_with_zeroed_timestamp(zaino_info); - - assert_eq!(cleaned_zcashd_info, cleaned_zaino_info); - - assert_eq!( - zcashd_blockchain_info.chain(), - zaino_blockchain_info.chain() - ); - assert_eq!( - zcashd_blockchain_info.blocks(), - zaino_blockchain_info.blocks() - ); - assert_eq!( - zcashd_blockchain_info.best_block_hash(), - zaino_blockchain_info.best_block_hash() - ); - assert_eq!( - zcashd_blockchain_info.estimated_height(), - zaino_blockchain_info.estimated_height() - ); - assert_eq!( - zcashd_blockchain_info.value_pools(), - zaino_blockchain_info.value_pools() - ); - assert_eq!( - zcashd_blockchain_info.upgrades(), - zaino_blockchain_info.upgrades() - ); - assert_eq!( - zcashd_blockchain_info.consensus(), - zaino_blockchain_info.consensus() - ); - - services.test_manager.close().await; -} - -async fn get_best_blockhash_inner() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - assert_subscribers_agree( - &services.zcashd_subscriber, - &services.zaino_subscriber, - |s| async move { dbg!(s.get_best_blockhash().await.unwrap()) }, - ) - .await; - - services.test_manager.close().await; -} - -async fn get_block_count_inner() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - assert_subscribers_agree( - &services.zcashd_subscriber, - &services.zaino_subscriber, - |s| async move { dbg!(s.get_block_count().await.unwrap()) }, - ) - .await; - - services.test_manager.close().await; -} - -async fn validate_address_inner() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - // Using a testnet transparent address - let address_string = "tmHMBeeYRuc2eVicLNfP15YLxbQsooCA6jb"; - - let address_with_script = "t3TAfQ9eYmXWGe3oPae1XKhdTxm8JvsnFRL"; - - let zcashd_valid = services - .zcashd_subscriber - .validate_address(address_string.to_string()) - .await - .unwrap(); - - let zaino_valid = services - .zaino_subscriber - .validate_address(address_string.to_string()) - .await - .unwrap(); - - assert_eq!(zcashd_valid, zaino_valid, "Address should be valid"); - - let zcashd_valid_script = services - .zcashd_subscriber - .validate_address(address_with_script.to_string()) - .await - .unwrap(); - - let zaino_valid_script = services - .zaino_subscriber - .validate_address(address_with_script.to_string()) - .await - .unwrap(); - - assert_eq!( - zcashd_valid_script, zaino_valid_script, - "Address should be valid" - ); - - services.test_manager.close().await; -} - -async fn z_get_block_inner() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - let zcashd_block_raw = dbg!(services - .zcashd_subscriber - .z_get_block("1".to_string(), Some(0)) - .await - .unwrap()); - - let zaino_block_raw = dbg!(services - .zaino_subscriber - .z_get_block("1".to_string(), Some(0)) - .await - .unwrap()); - - assert_eq!(zcashd_block_raw, zaino_block_raw); - - let zcashd_block = dbg!(services - .zcashd_subscriber - .z_get_block("1".to_string(), Some(1)) - .await - .unwrap()); - - let zaino_block = dbg!(services - .zaino_subscriber - .z_get_block("1".to_string(), Some(1)) - .await - .unwrap()); - - assert_eq!(zcashd_block, zaino_block); - - let hash = match zcashd_block { - zebra_rpc::methods::GetBlock::Raw(_) => panic!("expected object"), - zebra_rpc::methods::GetBlock::Object(obj) => obj.hash().to_string(), - }; - let zaino_get_block_by_hash = services - .zaino_subscriber - .z_get_block(hash.clone(), Some(1)) - .await - .unwrap(); - assert_eq!(zaino_get_block_by_hash, zaino_block); - - services.test_manager.close().await; -} - -async fn get_tx_out_set_info_inner() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - services.generate_blocks_and_wait_for_tips(1).await; - - let zcashd_txoutset_info = services - .zcashd_subscriber - .get_tx_out_set_info() - .await - .unwrap(); - let zaino_txoutset_info = services - .zaino_subscriber - .get_tx_out_set_info() - .await - .unwrap(); - - // Structural parity with zcashd: height, bestblock, transactions, txouts and total_amount - // must match. `bytes_serialized` and `hash_serialized` are Zaino-defined and intentionally - // diverge from zcashd; only Zaino-internal invariants are asserted on those fields. - use zaino_fetch::jsonrpsee::response::GetTxOutSetInfoResponse; - let (zaino, zcashd) = match (zaino_txoutset_info, zcashd_txoutset_info) { - (GetTxOutSetInfoResponse::Info(z), GetTxOutSetInfoResponse::Info(r)) => (z, r), - other => panic!("expected non-empty gettxoutsetinfo from both sides, got {other:?}"), - }; - - assert_eq!(zaino.height, zcashd.height, "`height` differs from zcashd"); - assert_eq!( - zaino.best_block, zcashd.best_block, - "`bestblock` differs from zcashd" - ); - assert_eq!( - zaino.transactions, zcashd.transactions, - "`transactions` count differs from zcashd" - ); - assert_eq!(zaino.txouts, zcashd.txouts, "`txouts` differs from zcashd"); - assert!( - (zaino.total_amount - zcashd.total_amount).abs() < 1e-8, - "`total_amount` differs from zcashd: zaino={} zcashd={}", - zaino.total_amount, - zcashd.total_amount - ); - - assert_eq!( - zaino.bytes_serialized, - zaino.txouts * 65, - "`bytes_serialized` must equal txouts * 65 under Zaino's UTXO entry encoding" - ); - assert_eq!( - zaino.hash_serialized.len(), - 64, - "`hash_serialized` must be 64 lowercase hex chars" - ); - assert!( - zaino.hash_serialized.chars().all(|c| c.is_ascii_hexdigit()), - "`hash_serialized` must be hex: got {}", - zaino.hash_serialized - ); - - services.test_manager.close().await; -} - -// TODO: This module should not be called `zcashd` -mod zcashd { - use super::*; - - pub(crate) mod zcash_indexer { - use zaino_state::LightWalletIndexer; - use zebra_rpc::methods::GetBlock; - - use super::*; - - #[tokio::test(flavor = "multi_thread")] - async fn check_info_no_cookie() { - launch_json_server_check_info().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn check_info_with_cookie() { - launch_json_server_check_info().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_best_blockhash() { - get_best_blockhash_inner().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_block_count() { - get_block_count_inner().await; - } - - /// Checks that the difficulty is the same between zcashd and zaino. - /// - /// This tests generates blocks and checks that the difficulty is the same between zcashd and zaino - /// after each block is generated. - #[tokio::test(flavor = "multi_thread")] - async fn get_difficulty() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - compare_over_blocks( - &services.test_manager, - &services.zcashd_subscriber, - &services.zaino_subscriber, - 10, - |s| async move { s.get_difficulty().await.unwrap() }, - ) - .await; - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_block_deltas() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - const BLOCK_LIMIT: i32 = 10; - - for _ in 0..BLOCK_LIMIT { - let current_block = services.zcashd_subscriber.get_latest_block().await.unwrap(); - - let block_hash_bytes: [u8; 32] = current_block.hash.as_slice().try_into().unwrap(); - - let block_hash = zebra_chain::block::Hash::from(block_hash_bytes); - - let zcashd_deltas = services - .zcashd_subscriber - .get_block_deltas(block_hash.to_string()) - .await - .unwrap(); - let zaino_deltas = services - .zaino_subscriber - .get_block_deltas(block_hash.to_string()) - .await - .unwrap(); - - assert_eq!(zcashd_deltas, zaino_deltas); - - services.generate_blocks_and_wait_for_tips(1).await; - } - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_mining_info() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - compare_over_blocks( - &services.test_manager, - &services.zcashd_subscriber, - &services.zaino_subscriber, - 10, - |s| async move { s.get_mining_info().await.unwrap() }, - ) - .await; - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_tx_out_set_info() { - get_tx_out_set_info_inner().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_peer_info() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - let zcashd_peer_info = services.zcashd_subscriber.get_peer_info().await.unwrap(); - let zaino_peer_info = services.zaino_subscriber.get_peer_info().await.unwrap(); - - assert_eq!(zcashd_peer_info, zaino_peer_info); - - services.generate_blocks_and_wait_for_tips(1).await; - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_block_subsidy() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - services.generate_blocks_and_wait_for_tips(1).await; - - let zcashd_block_subsidy = services - .zcashd_subscriber - .get_block_subsidy(1) - .await - .unwrap(); - let zaino_block_subsidy = services - .zaino_subscriber - .get_block_subsidy(1) - .await - .unwrap(); - - assert_eq!(zcashd_block_subsidy, zaino_block_subsidy); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn validate_address() { - validate_address_inner().await; - } - - #[allow(deprecated)] - #[tokio::test(flavor = "multi_thread", worker_threads = 2)] - async fn z_validate_address() { - let mut services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - clientless::rpc::z_validate_address::run_z_validate_for(&services.zcashd_subscriber) - .await; - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn z_get_block() { - z_get_block_inner().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_block_header() { - let services = zaino_testutils::launch_zcashd_dual_fetch_services().await; - - const BLOCK_LIMIT: u32 = 10; - - services - .test_manager - .generate_blocks_and_check_each( - BLOCK_LIMIT, - &services.zaino_subscriber, - &services.zcashd_subscriber, - async |i| { - let block = services - .zcashd_subscriber - .z_get_block(i.to_string(), Some(1)) - .await - .unwrap(); - - let block_hash = match block { - GetBlock::Object(block) => block.hash(), - GetBlock::Raw(_) => panic!("Expected block object"), - }; - - let zcashd_get_block_header = services - .zcashd_subscriber - .get_block_header(block_hash.to_string(), false) - .await - .unwrap(); - - let zainod_block_header_response = services - .zaino_subscriber - .get_block_header(block_hash.to_string(), false) - .await - .unwrap(); - assert_eq!(zcashd_get_block_header, zainod_block_header_response); - }, - ) - .await; - } - } -} diff --git a/live-tests/clientless/tests/state_service.rs b/live-tests/clientless/tests/state_service.rs index 59b607d40..6c7c9feb9 100644 --- a/live-tests/clientless/tests/state_service.rs +++ b/live-tests/clientless/tests/state_service.rs @@ -412,7 +412,7 @@ mod zebra { } #[tokio::test(flavor = "multi_thread")] - #[ignore = "We no longer use chain caches. See zcashd::check_info::regtest_no_cache."] + #[ignore = "We no longer use chain caches."] async fn regtest_with_cache() { state_service_check_info::( &ValidatorKind::Zebrad, diff --git a/live-tests/e2e/Cargo.toml b/live-tests/e2e/Cargo.toml index 2e6c53f4d..7a650c902 100644 --- a/live-tests/e2e/Cargo.toml +++ b/live-tests/e2e/Cargo.toml @@ -12,16 +12,6 @@ publish = false [features] default = [] -# Support for the zcashd test validator. Opt-in (default off, docs/adr/0005); being deprecated. Gates -# the zcashd-backed wallet tests and forwards to the zaino crates. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = [ - "zaino-testutils/zcashd_support", - "zaino-state/zcashd_support", - "zaino-fetch/zcashd_support", - "zainod/zcashd_support", -] - # Single non-default gate for every devtool-incompatible / heavy test (the # finalization heavies, send_to_all, monitor_unverified_mempool, the # test-vector builder, address_deltas). They compile by default but are @@ -32,8 +22,6 @@ devtool-incompatible = [] [dependencies] # Zaino test harness + packages, sourced from the root workspace manifest. -# default-features = false (carried by the workspace entries) propagates the -# zcashd_support drop; re-enabled by forwarding above. See docs/adr/0001. zaino-testutils = { workspace = true } zaino-state = { workspace = true, features = ["test_dependencies"] } zaino-common = { workspace = true } diff --git a/live-tests/e2e/tests/devtool.rs b/live-tests/e2e/tests/devtool.rs index 94012c554..bc7110b42 100644 --- a/live-tests/e2e/tests/devtool.rs +++ b/live-tests/e2e/tests/devtool.rs @@ -4,8 +4,6 @@ //! `Clients`, the matching tests in `wallet_to_validator.rs` migrate here and //! the zingolib versions are eventually retired (zingolabs/infrastructure#269). //! -//! Zebrad only: the zcashd matrix is deferred (see below). -//! //! Covered (the full zebrad fetch + state query/send surface): //! - sends to each pool, `send_to_all`, shielding, mining-reward receipt; //! - `get_transaction` (mined / mempool), `get_raw_transaction`; @@ -17,6 +15,7 @@ //! - block range: default/all pools and the out-of-range edge cases; //! - compact-block transparent data; //! - `connect_to_node_get_info` (wallet `get_info` smoke). +//! //! Dual `*_fetch_vs_state` tests assert the fetch and state backends agree. //! //! Deferred, with the capability each waits on: @@ -27,10 +26,6 @@ //! - `monitor_unverified_mempool` — unconfirmed (mempool) wallet balances; //! devtool sync is block-based (likely stays on zingolib, the indexer-side //! mempool views above already cover the surface). -//! - the zcashd matrix (`json_server`, zcashd send/query) — the devtool wallet -//! rejects zcashd's default regtest activation heights at construction; -//! `json_server` is additionally zcashd-bound (its reference subscriber *is* -//! zcashd). //! - the `test_vectors` chain builder — devtool transparent-coinbase shielding. //! - `get_mempool_info` — recomputes expected sizes from //! `FetchServiceSubscriber` internals; low value over the mempool surfaces diff --git a/live-tests/e2e/tests/devtool_zcashd.rs b/live-tests/e2e/tests/devtool_zcashd.rs deleted file mode 100644 index 5950d0806..000000000 --- a/live-tests/e2e/tests/devtool_zcashd.rs +++ /dev/null @@ -1,672 +0,0 @@ -//! Proof-of-concept: a devtool wallet against a **zcashd**-backed Zaino. -//! -//! The zebrad devtool suite (`tests/devtool.rs`) is complete. This isolates the -//! one remaining alignment for the zcashd matrix (the `json_server` oracle tests -//! and the zcashd send/query column): launch zcashd at the same activation -//! heights zebrad uses — `ZEBRAD_DEFAULT_ACTIVATION_HEIGHTS`, which the devtool -//! wallet's compiled-in `supported_regtest_activation_heights` requires (the 46 -//! zebrad tests prove the wallet accepts them) — rather than zcashd's default -//! heights (all = 1), which would mismatch the wallet's consensus branch IDs. -//! -//! zcashd mines ORCHARD coinbase to `REG_O_ADDR_FROM_ABANDONART` (the abandon-art -//! orchard address the devtool faucet owns), so the faucet is funded with no -//! transparent-coinbase shielding — the zcashd matrix is NOT gated on devtool -//! transparent-coinbase shielding, only on this heights alignment. -//! -//! If this passes, the `json_server` tests port by swapping their zingolib -//! funding for `DevtoolClients` while keeping the zaino-vs-zcashd oracle -//! comparison. If zcashd rejects the heights (e.g. the NU6.1 lockbox gotcha, -//! which bit zebrad), that's the blocker to resolve before porting the mod. - -// The entire zcashd matrix depends on the zcashd validator + its zaino-testutils -// launchers, all gated behind `zcashd_support`. Gate the whole binary so it -// compiles out under `--no-default-features` (mirrors the clientless partition's json_server.rs). -#![cfg(feature = "zcashd_support")] -use e2e::devtool::DevtoolClients; -use zaino_state::{ChainIndex, ZcashIndexer}; -use zaino_testutils::{Rpc, TestManager, ValidatorKind, ZcashdDualFetchServices}; -use zcash_local_net::validator::zcashd::Zcashd; -use zebra_chain::subtree::NoteCommitmentSubtreeIndex; -use zebra_rpc::client::GetAddressBalanceRequest; -use zebra_rpc::methods::GetAddressTxIdsRequest; - -/// Launch zcashd (orchard-mining) at the devtool-compatible activation heights -/// (`ZEBRAD_DEFAULT_ACTIVATION_HEIGHTS`, which the PoC below proves zcashd -/// accepts and the devtool wallet requires) and build the devtool -/// faucet/recipient wallets against the resulting Zaino, without mining or -/// syncing. The zcashd analogue of devtool.rs's `launch_and_build_clients`, -/// concrete on zcashd (which has no StateService backend). -async fn launch_zcashd_and_build_clients() -> (TestManager, DevtoolClients) { - let test_manager = TestManager::::launch_mining_to( - zaino_testutils::SHIELDED_FUNDING_POOL, // ORCHARD - &ValidatorKind::Zcashd, - None, // network -> Regtest - // The heights the devtool wallet accepts (same as the zebrad path). - Some(zaino_testutils::ZEBRAD_DEFAULT_ACTIVATION_HEIGHTS), - None, // no chain cache: build fresh at these heights - true, // enable zaino - false, // no json-rpc server - false, // no clients (the devtool wallet is built separately) - ) - .await - .expect("launch zcashd TestManager"); - - let clients = e2e::devtool::build_clients( - test_manager - .zaino_grpc_listen_address - .expect("zaino enabled") - .port(), - &test_manager.local_net, - ) - .await; - - (test_manager, clients) -} - -/// [`launch_zcashd_and_build_clients`] plus `orchard_notes` orchard coinbase -/// notes for the faucet, synced. One block more than `orchard_notes` is mined -/// because the height-1 coinbase is sapling at nu5=2 (orchard accrues from -/// height 2). The send/shield analogue of devtool.rs's `launch_and_fund_faucet`. -async fn launch_and_fund_zcashd_faucet( - orchard_notes: u32, -) -> (TestManager, DevtoolClients) { - let (test_manager, mut clients) = launch_zcashd_and_build_clients().await; - test_manager - .generate_blocks_and_wait_for_tip(orchard_notes + 1, test_manager.subscriber()) - .await; - clients.sync_faucet().await; - (test_manager, clients) -} - -/// Launch zcashd, fund the faucet with two orchard coinbase notes, and assert -/// the faucet sees them — the PoC that proved zcashd accepts the -/// devtool-compatible heights (no NU6.1 lockbox rejection) and the abandon-art -/// faucet sees zcashd's orchard coinbase. -#[tokio::test(flavor = "multi_thread")] -async fn faucet_receives_zcashd_orchard_reward() { - let (mut test_manager, mut clients) = launch_zcashd_and_build_clients().await; - - // Two orchard coinbase notes for the abandon-art faucet. - test_manager - .generate_blocks_and_wait_for_tip(2, test_manager.subscriber()) - .await; - clients.sync_faucet().await; - - let balance = clients.faucet_balance().await; - dbg!(&balance); - assert!( - balance.orchard_spendable > 0, - "devtool faucet should see zcashd's orchard coinbase" - ); - - test_manager.close().await; -} - -/// Launch zcashd dual fetch services at the devtool-compatible activation -/// heights (`ZEBRAD_DEFAULT_ACTIVATION_HEIGHTS`, which the PoC above proves -/// zcashd accepts and the devtool wallet requires) and build the devtool -/// faucet/recipient wallets against the resulting Zaino — the devtool analogue -/// of json_server's `create_zcashd_test_manager_and_fetch_services`. -async fn create_zcashd_devtool_services() -> (ZcashdDualFetchServices, DevtoolClients) { - let services = zaino_testutils::launch_zcashd_dual_fetch_services_at( - zaino_testutils::ZEBRAD_DEFAULT_ACTIVATION_HEIGHTS, - ) - .await; - let clients = e2e::devtool::build_clients( - services - .test_manager - .zaino_grpc_listen_address - .expect("zaino enabled") - .port(), - ) - .await; - (services, clients) -} - -/// Devtool analogue of json_server's `jsonrpc_fund`: fund the faucet with orchard -/// coinbase notes, sync, fetch the recipient's transparent + unified addresses, -/// and if `send` is `Some(pool)`, send 250_000 to that pool's recipient address -/// and mine it in. Returns `(recipient_taddr, recipient_ua, sent_txid_hex)`. The -/// send=None mempool tests broadcast two unmined sends, so they need two notes. -async fn jsonrpc_fund( - services: &ZcashdDualFetchServices, - clients: &mut DevtoolClients, - send: Option, -) -> (String, String, Option) { - // At nu5=2 the height-1 coinbase is sapling and orchard notes only accrue - // from height 2, so mine one block more than the orchard notes needed (1 per - // send: a Some(pool) test spends one note, the send=None mempool tests two). - let notes: u32 = if send.is_some() { 2 } else { 3 }; - services.generate_blocks_and_wait_for_tips(notes).await; - clients.sync_faucet().await; - - let recipient_taddr = clients.get_recipient_address("transparent").await; - let recipient_ua = clients.get_recipient_address("unified").await; - - let sent = if let Some(pool) = send { - let addr = clients.get_recipient_address(pool.address_kind()).await; - let txid = clients.send_from_faucet(&addr, 250_000).await; - services.generate_blocks_and_wait_for_tips(1).await; - Some(txid.trim().to_string()) - } else { - None - }; - - (recipient_taddr, recipient_ua, sent) -} - -/// Devtool ports of the `json_server` oracle tests: zaino's answer (through its -/// JSON-RPC server, `zaino_subscriber`) must equal zcashd's own answer -/// (`zcashd_subscriber`). Verbatim from `tests/json_server.rs` except the -/// funding (devtool, not zingolib) and the sent txid (devtool's display-order -/// hex `String`, which matches the txid strings these RPCs return). -mod json_server { - use super::*; - - #[tokio::test(flavor = "multi_thread")] - async fn z_get_address_balance() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (recipient_taddr, _recipient_ua, _txid) = - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Transparent)).await; - - let zcashd_service_balance = services - .zcashd_subscriber - .z_get_address_balance(GetAddressBalanceRequest::new(vec![recipient_taddr.clone()])) - .await - .unwrap(); - let zaino_service_balance = services - .zaino_subscriber - .z_get_address_balance(GetAddressBalanceRequest::new(vec![recipient_taddr])) - .await - .unwrap(); - - dbg!(&zcashd_service_balance); - dbg!(&zaino_service_balance); - - // The fixture sent exactly 250_000 to the recipient taddr. - assert_eq!(zcashd_service_balance.balance(), 250_000); - assert_eq!(zcashd_service_balance, zaino_service_balance); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_raw_mempool() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (recipient_taddr, recipient_ua, _txid) = - jsonrpc_fund(&services, &mut clients, None).await; - clients.send_from_faucet(&recipient_taddr, 250_000).await; - clients.send_from_faucet(&recipient_ua, 250_000).await; - - tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; - - let mut zcashd_mempool = services.zcashd_subscriber.get_raw_mempool().await.unwrap(); - let mut zaino_mempool = services.zaino_subscriber.get_raw_mempool().await.unwrap(); - - dbg!(&zcashd_mempool); - zcashd_mempool.sort(); - dbg!(&zaino_mempool); - zaino_mempool.sort(); - - assert_eq!(zcashd_mempool, zaino_mempool); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_mempool_info() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (recipient_taddr, recipient_ua, _txid) = - jsonrpc_fund(&services, &mut clients, None).await; - clients.send_from_faucet(&recipient_taddr, 250_000).await; - clients.send_from_faucet(&recipient_ua, 250_000).await; - - tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; - - let zcashd_info = services.zcashd_subscriber.get_mempool_info().await.unwrap(); - let zaino_info = services.zaino_subscriber.get_mempool_info().await.unwrap(); - - assert_eq!(zcashd_info, zaino_info); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn z_get_treestate() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Orchard)).await; - - let chain_height = dbg!(services.zaino_subscriber.chain_height().await.unwrap()).0; - - let zcashd_treestate = dbg!(services - .zcashd_subscriber - .z_get_treestate(chain_height.to_string()) - .await - .unwrap()); - let zaino_treestate = dbg!(services - .zaino_subscriber - .z_get_treestate(chain_height.to_string()) - .await - .unwrap()); - - assert_eq!(zcashd_treestate, zaino_treestate); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn z_get_subtrees_by_index() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Orchard)).await; - - let zcashd_subtrees = dbg!(services - .zcashd_subscriber - .z_get_subtrees_by_index("orchard".to_string(), NoteCommitmentSubtreeIndex(0), None) - .await - .unwrap()); - let zaino_subtrees = dbg!(services - .zaino_subscriber - .z_get_subtrees_by_index("orchard".to_string(), NoteCommitmentSubtreeIndex(0), None) - .await - .unwrap()); - - assert_eq!(zcashd_subtrees, zaino_subtrees); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_raw_transaction() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (_recipient_taddr, _recipient_ua, tx) = - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Orchard)).await; - let tx = tx.expect("jsonrpc_fund sends a tx when given Some(pool)"); - - let zcashd_transaction = dbg!(services - .zcashd_subscriber - .get_raw_transaction(tx.clone(), Some(1)) - .await - .unwrap()); - let zaino_transaction = dbg!(services - .zaino_subscriber - .get_raw_transaction(tx, Some(1)) - .await - .unwrap()); - - assert_eq!(zcashd_transaction, zaino_transaction); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_tx_out() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (recipient_taddr, _recipient_ua, _txid) = - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Transparent)).await; - - let zcashd_utxos = services - .zcashd_subscriber - .z_get_address_utxos(GetAddressBalanceRequest::new(vec![recipient_taddr.clone()])) - .await - .unwrap(); - let (_, txid, output_index, ..) = zcashd_utxos[0].into_parts(); - - let zcashd_tx_out = services - .zcashd_subscriber - .get_tx_out(txid.to_string(), output_index.index(), Some(true)) - .await - .unwrap(); - let zaino_tx_out = services - .zaino_subscriber - .get_tx_out(txid.to_string(), output_index.index(), Some(true)) - .await - .unwrap(); - - assert_eq!(zcashd_tx_out, zaino_tx_out); - - let zcashd_missing_tx_out = services - .zcashd_subscriber - .get_tx_out(txid.to_string(), output_index.index() + 100, None) - .await - .unwrap(); - let zaino_missing_tx_out = services - .zaino_subscriber - .get_tx_out(txid.to_string(), output_index.index() + 100, None) - .await - .unwrap(); - - assert_eq!(zcashd_missing_tx_out, zaino_missing_tx_out); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn get_address_tx_ids() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (recipient_taddr, _recipient_ua, tx) = - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Transparent)).await; - let tx = tx.expect("jsonrpc_fund sends a tx when given Some(pool)"); - - let chain_height: u32 = { - let idx = &services.zcashd_subscriber.indexer; - let snapshot = idx.snapshot_nonfinalized_state().await.unwrap(); - u32::from(idx.best_chaintip(&snapshot).await.unwrap().height) - }; - dbg!(&chain_height); - - let zcashd_txids = services - .zcashd_subscriber - .get_address_tx_ids(GetAddressTxIdsRequest::new( - vec![recipient_taddr.clone()], - Some(chain_height - 2), - Some(chain_height), - )) - .await - .unwrap(); - let zaino_txids = services - .zaino_subscriber - .get_address_tx_ids(GetAddressTxIdsRequest::new( - vec![recipient_taddr], - Some(chain_height - 2), - Some(chain_height), - )) - .await - .unwrap(); - - dbg!(&tx); - dbg!(&zcashd_txids); - assert_eq!(tx, zcashd_txids[0]); - - dbg!(&zaino_txids); - assert_eq!(zcashd_txids, zaino_txids); - - services.test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn z_get_address_utxos() { - let (mut services, mut clients) = create_zcashd_devtool_services().await; - - let (recipient_taddr, _recipient_ua, txid_1) = - jsonrpc_fund(&services, &mut clients, Some(e2e::Pool::Transparent)).await; - let txid_1 = txid_1.expect("jsonrpc_fund sends a tx when given Some(pool)"); - - clients.sync_faucet().await; - - let zcashd_utxos = services - .zcashd_subscriber - .z_get_address_utxos(GetAddressBalanceRequest::new(vec![recipient_taddr.clone()])) - .await - .unwrap(); - let (_, zcashd_txid, ..) = zcashd_utxos[0].into_parts(); - - let zaino_utxos = services - .zaino_subscriber - .z_get_address_utxos(GetAddressBalanceRequest::new(vec![recipient_taddr])) - .await - .unwrap(); - let (_, zaino_txid, ..) = zaino_utxos[0].into_parts(); - - dbg!(&txid_1); - dbg!(&zcashd_utxos); - assert_eq!(txid_1, zcashd_txid.to_string()); - - dbg!(&zaino_utxos); - assert_eq!(zcashd_txid.to_string(), zaino_txid.to_string()); - - services.test_manager.close().await; - } -} - -/// zcashd analogue of devtool.rs's `send_to_pool`: the faucet sends 250_000 to -/// the recipient's `pool` address and the recipient sees it. -async fn send_to_pool(pool: e2e::Pool) { - let (mut test_manager, mut clients) = launch_and_fund_zcashd_faucet(1).await; - - let recipient = clients.get_recipient_address(pool.address_kind()).await; - let txid = clients.send_from_faucet(&recipient, 250_000).await; - dbg!(txid); - - test_manager - .generate_blocks_and_wait_for_tip(1, test_manager.subscriber()) - .await; - clients.sync_recipient().await; - - assert_eq!( - pool.spendable_balance(&clients.recipient_balance().await), - 250_000 - ); - - test_manager.close().await; -} - -/// zcashd analogue of devtool.rs's `shield_for_validator`: the recipient -/// receives a transparent send, then shields it into orchard (235_000 after the -/// ZIP-317 shielding fee). -async fn shield_for_validator() { - let (mut test_manager, mut clients) = launch_and_fund_zcashd_faucet(1).await; - - let recipient_taddr = clients.get_recipient_address("transparent").await; - clients.send_from_faucet(&recipient_taddr, 250_000).await; - test_manager - .generate_blocks_and_wait_for_tip(1, test_manager.subscriber()) - .await; - clients.sync_recipient().await; - - assert_eq!( - e2e::Pool::Transparent.spendable_balance(&clients.recipient_balance().await), - 250_000 - ); - - clients.shield_recipient().await; - test_manager - .generate_blocks_and_wait_for_tip(1, test_manager.subscriber()) - .await; - clients.sync_recipient().await; - - assert_eq!( - e2e::Pool::Orchard.spendable_balance(&clients.recipient_balance().await), - 235_000 - ); - - test_manager.close().await; -} - -/// Devtool ports of `wallet_to_validator`'s `mod zcashd` send/shield/get-info -/// column. Deferred: the heavy finalization send (`sent_to::transparent`'s -/// seam-deep mine, waits on cheap filler mining), `sent_to::all`, and -/// `monitor_unverified_mempool` (unconfirmed mempool balances). -/// `send_to_transparent` here is the light send, matching the -/// zebrad devtool port. -mod wallet_to_validator { - use super::*; - - #[tokio::test(flavor = "multi_thread")] - async fn connect_to_node_get_info() { - let (mut test_manager, clients) = launch_zcashd_and_build_clients().await; - clients.get_info_faucet().await; - clients.get_info_recipient().await; - test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn send_to_orchard() { - send_to_pool(e2e::Pool::Orchard).await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn send_to_sapling() { - send_to_pool(e2e::Pool::Sapling).await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn send_to_transparent() { - send_to_pool(e2e::Pool::Transparent).await; - } - - #[tokio::test(flavor = "multi_thread")] - async fn shield() { - shield_for_validator().await; - } - - /// zcashd analogue of devtool.rs's gated `send_to_transparent_finalization`: - /// a transparent send returns the same address txids from the non-finalized - /// chain and after the seam-deep advance into the finalized DB. `#[ignore]`d - /// for the same reason — the advance mines orchard coinbase (~100 halo2 - /// proofs) until per-call cheap filler mining lands. - #[tokio::test(flavor = "multi_thread")] - #[cfg_attr( - not(feature = "devtool-incompatible"), - ignore = "heavy: seam-deep orchard advance (~100 halo2 proofs); un-ignore + transparent filler when cheap filler mining lands" - )] - async fn send_to_transparent_finalization() { - let (mut test_manager, mut clients) = launch_and_fund_zcashd_faucet(1).await; - - let recipient_taddr = clients.get_recipient_address("transparent").await; - clients.send_from_faucet(&recipient_taddr, 250_000).await; - test_manager - .generate_blocks_and_wait_for_tip(1, test_manager.subscriber()) - .await; - - let fetch_service = test_manager.full_node_jsonrpc_connector().await; - let height = fetch_service.get_blockchain_info().await.unwrap().blocks.0; - let unfinalised_transactions = fetch_service - .get_address_txids(vec![recipient_taddr.clone()], height, height) - .await - .unwrap(); - - test_manager - .generate_blocks_bulk_and_wait_for_tips( - // Advance past the seam so the send crosses the finalised floor - // (`tip - seam`); a small margin above it keeps the boundary unambiguous. - zaino_common::consensus::FAST_TEST_MAX_NONFINALISED_DEPTH + 5, - test_manager.subscriber(), - test_manager.subscriber(), - ) - .await; - - let finalised_transactions = fetch_service - .get_address_txids(vec![recipient_taddr], height, height) - .await - .unwrap(); - - clients.sync_recipient().await; - assert_eq!( - e2e::Pool::Transparent.spendable_balance(&clients.recipient_balance().await), - 250_000 - ); - assert_eq!(unfinalised_transactions, finalised_transactions); - - test_manager.close().await; - } - - /// zcashd port of `sent_to::all` (heavy): one faucet funds a send to all - /// three pools, then a seam-deep advance, and each recipient pool reports - /// 250_000. `#[ignore]`d: the seam-deep advance mines orchard coinbase - /// (~100 halo2 proofs). The advance is faithful to the original but not - /// load-bearing for the per-pool balance asserts (the sends confirm in one - /// block), so this could be re-ported light (like the zebrad `send_to_all`) - /// instead of gated, if preferred. - #[tokio::test(flavor = "multi_thread")] - #[cfg_attr( - not(feature = "devtool-incompatible"), - ignore = "heavy: seam-deep orchard advance (~100 halo2 proofs); re-port light or un-ignore with transparent filler" - )] - async fn send_to_all() { - let (mut test_manager, mut clients) = launch_and_fund_zcashd_faucet(3).await; - - let recipient_ua = clients.get_recipient_address("unified").await; - let recipient_zaddr = clients.get_recipient_address("sapling").await; - let recipient_taddr = clients.get_recipient_address("transparent").await; - clients.send_from_faucet(&recipient_ua, 250_000).await; - clients.send_from_faucet(&recipient_zaddr, 250_000).await; - clients.send_from_faucet(&recipient_taddr, 250_000).await; - - test_manager - .generate_blocks_bulk_and_wait_for_tips( - // Advance past the seam so all three pool sends cross the finalised floor. - zaino_common::consensus::FAST_TEST_MAX_NONFINALISED_DEPTH + 5, - test_manager.subscriber(), - test_manager.subscriber(), - ) - .await; - clients.sync_recipient().await; - - let balance = clients.recipient_balance().await; - assert_eq!(e2e::Pool::Orchard.spendable_balance(&balance), 250_000); - assert_eq!(e2e::Pool::Sapling.spendable_balance(&balance), 250_000); - assert_eq!(e2e::Pool::Transparent.spendable_balance(&balance), 250_000); - - test_manager.close().await; - } - - /// zcashd analogue of devtool.rs's `monitor_unverified_mempool`. `#[ignore]`d - /// with the balance assertions commented out — devtool's WalletBalance has - /// no unconfirmed_*/confirmed_* fields (block-based sync, no mempool scan). - #[tokio::test(flavor = "multi_thread")] - #[cfg_attr( - not(feature = "devtool-incompatible"), - ignore = "devtool WalletBalance has no unconfirmed_*/confirmed_* fields; balance asserts commented out — restore + un-ignore when devtool surfaces unconfirmed balances" - )] - async fn monitor_unverified_mempool() { - let (mut test_manager, mut clients) = launch_and_fund_zcashd_faucet(2).await; - - let recipient_ua = clients.get_recipient_address("unified").await; - let txid_1 = clients.send_from_faucet(&recipient_ua, 250_000).await; - let recipient_zaddr = clients.get_recipient_address("sapling").await; - let txid_2 = clients.send_from_faucet(&recipient_zaddr, 250_000).await; - - clients.rescan_recipient().await; - - let fetch_service = test_manager.full_node_jsonrpc_connector().await; - let mempool_txids = fetch_service.get_raw_mempool().await.unwrap(); - dbg!(txid_1); - dbg!(txid_2); - dbg!(mempool_txids.clone()); - - let _transaction_1 = dbg!( - fetch_service - .get_raw_transaction(mempool_txids.transactions[0].clone(), Some(1)) - .await - ); - let _transaction_2 = dbg!( - fetch_service - .get_raw_transaction(mempool_txids.transactions[1].clone(), Some(1)) - .await - ); - - // Unconfirmed (mempool) balances — devtool's WalletBalance has no - // unconfirmed_* fields: - // assert_eq!(clients.recipient_balance().await.unconfirmed_orchard_balance.unwrap().into_u64(), 250_000); - // assert_eq!(clients.recipient_balance().await.unconfirmed_sapling_balance.unwrap().into_u64(), 250_000); - - test_manager - .generate_blocks_and_wait_for_tip(1, test_manager.subscriber()) - .await; - - let _transaction_1 = dbg!( - fetch_service - .get_raw_transaction(mempool_txids.transactions[0].clone(), Some(1)) - .await - ); - let _transaction_2 = dbg!( - fetch_service - .get_raw_transaction(mempool_txids.transactions[1].clone(), Some(1)) - .await - ); - - clients.sync_recipient().await; - - // Confirmed balances — restore as Pool::Orchard.spendable_balance(...) when un-ignoring. - - test_manager.close().await; - } -} diff --git a/live-tests/quick_test.txt b/live-tests/quick_test.txt index 91351f15e..79c7e50f4 100644 --- a/live-tests/quick_test.txt +++ b/live-tests/quick_test.txt @@ -2,28 +2,6 @@ chain_query_interface::get_block_range_zebrad chain_query_interface::get_mempool_stream_fresh_snapshot_repeated_zebrad chain_query_interface::get_subtree_roots_zebrad chain_query_interface::zallet_like_steady_state_loop_zebrad -zcashd::get::address_balance -zcashd::get::address_tx_ids -zcashd::get::address_utxos -zcashd::get::block -zcashd::get::block_deltas -zcashd::get::block_header -zcashd::get::block_nullifiers -zcashd::get::block_object -zcashd::get::block_range_no_pool_type_returns_sapling_orchard -zcashd::get::block_range_returns_all_pools_when_requested -zcashd::get::block_raw -zcashd::get::difficulty -zcashd::get::get_network_sol_ps -zcashd::get::latest_block -zcashd::get::latest_tree_state -zcashd::get::lightd_info -zcashd::get::mining_info -zcashd::get::peer_info -zcashd::get::subtree_roots -zcashd::launch::regtest_no_cache -zcashd::validation::validate_address -zcashd::validation::z_validate_address zebrad::get::best_blockhash zebrad::get::block_count zebrad::get::block_header @@ -43,18 +21,6 @@ zebrad::get::tree_state zebrad::launch::regtest_no_cache zebrad::validation::validate_address zebrad::validation::z_validate_address -zcashd::zcash_indexer::check_info_with_cookie -zcashd::zcash_indexer::get_address_tx_ids -zcashd::zcash_indexer::get_best_blockhash -zcashd::zcash_indexer::get_block_count -zcashd::zcash_indexer::get_block_deltas -zcashd::zcash_indexer::get_block_header -zcashd::zcash_indexer::get_peer_info -zcashd::zcash_indexer::validate_address -zcashd::zcash_indexer::z_get_address_balance -zcashd::zcash_indexer::z_get_address_utxos -zcashd::zcash_indexer::z_get_block -zcashd::zcash_indexer::z_validate_address zebra::check_info::regtest_no_cache zebra::check_info::state_service_chaintip_update_subscriber zebra::get::address_tx_ids_regtest @@ -89,6 +55,5 @@ zebra::lightwallet_indexer::get_transaction zebra::lightwallet_indexer::get_transparent_data_from_compact_block_when_requested zebra::lightwallet_indexer::get_tree_state pre_v4_txs_parsing -zcashd::connect_to_node_get_info zebrad::fetch_service::connect_to_node_get_info zebrad::state_service::connect_to_node_get_info diff --git a/live-tests/test_environment/Containerfile b/live-tests/test_environment/Containerfile index a6a19c7fd..b582abf1b 100644 --- a/live-tests/test_environment/Containerfile +++ b/live-tests/test_environment/Containerfile @@ -5,7 +5,6 @@ # === GLOBAL ARGS === ######################## ARG RUST_VERSION -ARG ZCASH_VERSION ARG ZEBRA_VERSION ARG DEVTOOL_VERSION ARG UID=1000 @@ -19,7 +18,6 @@ ARG CARGO_HOME="/usr/local/cargo" ######################## FROM docker.io/zfnd/zebra:${ZEBRA_VERSION} AS zebra-downloader -FROM docker.io/zodlinc/zcash:v${ZCASH_VERSION} AS zcashd-downloader ######################## @@ -55,34 +53,6 @@ RUN git clone https://github.com/ZcashFoundation/zebra . \ && cargo build --release --bin zebrad \ && cp target/release/zebrad /tmp/zebrad -FROM docker.io/library/debian:trixie AS zcashd-builder - -ARG ZCASH_VERSION -# Versions pinned (DL3008) to the candidates in debian:trixie; bump together -# with the base image (query with `apt-cache policy `). -# --no-install-recommends (DL3015): ca-certificates and netbase are re-added -# explicitly because the zcash source build clones and downloads over HTTPS; -# they were previously pulled in only as apt recommends. -RUN apt-get update && apt-get install -y --no-install-recommends \ - git=1:2.47.3-0+deb13u1 \ - build-essential=12.12 \ - pkg-config=1.8.1-4 \ - automake=1:1.17-4 \ - autoconf=2.72-3.1 \ - libtool=2.5.4-4 \ - bsdmainutils=12.1.8 \ - curl=8.14.1-2+deb13u4 \ - ca-certificates=20250419 \ - netbase=6.5 - -WORKDIR /zcash -# Single RUN (DL3059): clone, fetch params, build, and stage the binaries. -RUN git clone --depth 1 --branch "v${ZCASH_VERSION}" \ - https://github.com/zcash/zcash . \ - && ./zcutil/fetch-params.sh \ - && ./zcutil/build.sh -j"$(nproc)" \ - && cp src/zcashd src/zcash-cli /tmp/ - FROM docker.io/library/rust:${RUST_VERSION}-trixie AS devtool-builder ARG DEVTOOL_VERSION @@ -182,30 +152,10 @@ USER ${USER} ######################## FROM base AS final-prebuilt -ARG ZCASH_VERSION -ARG ZEBRA_VERSION -ARG DEVTOOL_VERSION -LABEL org.zaino.test-artifacts.versions.zcashd="${ZCASH_VERSION}" -LABEL org.zaino.test-artifacts.versions.zebra="${ZEBRA_VERSION}" -LABEL org.zaino.test-artifacts.versions.devtool="${DEVTOOL_VERSION}" -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-downloader /usr/bin/zcashd /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-downloader /usr/bin/zcash-cli /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=zebra-downloader /usr/local/bin/zebrad /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=devtool-builder /tmp/zcash-devtool /home/container_user/artifacts/ -RUN cargo install cargo-nextest --locked --verbose --root "${CARGO_HOME}" - -ENTRYPOINT ["/home/container_user/bin/entrypoint.sh"] -CMD ["/bin/bash"] - -FROM base AS final-zcashd-source -ARG ZCASH_VERSION ARG ZEBRA_VERSION ARG DEVTOOL_VERSION -LABEL org.zaino.test-artifacts.versions.zcashd="${ZCASH_VERSION}" LABEL org.zaino.test-artifacts.versions.zebra="${ZEBRA_VERSION}" LABEL org.zaino.test-artifacts.versions.devtool="${DEVTOOL_VERSION}" -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-builder /tmp/zcashd /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-builder /tmp/zcash-cli /home/container_user/artifacts/ COPY --chown=container_user:container_user --chmod=0755 --from=zebra-downloader /usr/local/bin/zebrad /home/container_user/artifacts/ COPY --chown=container_user:container_user --chmod=0755 --from=devtool-builder /tmp/zcash-devtool /home/container_user/artifacts/ RUN cargo install cargo-nextest --locked --verbose --root "${CARGO_HOME}" @@ -214,30 +164,10 @@ ENTRYPOINT ["/home/container_user/bin/entrypoint.sh"] CMD ["/bin/bash"] FROM base AS final-zebrad-source -ARG ZCASH_VERSION -ARG ZEBRA_VERSION -ARG DEVTOOL_VERSION -LABEL org.zaino.test-artifacts.versions.zcashd="${ZCASH_VERSION}" -LABEL org.zaino.test-artifacts.versions.zebra="${ZEBRA_VERSION}" -LABEL org.zaino.test-artifacts.versions.devtool="${DEVTOOL_VERSION}" -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-downloader /usr/bin/zcashd /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-downloader /usr/bin/zcash-cli /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=zebra-builder /tmp/zebrad /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=devtool-builder /tmp/zcash-devtool /home/container_user/artifacts/ -RUN cargo install cargo-nextest --locked --verbose --root "${CARGO_HOME}" - -ENTRYPOINT ["/home/container_user/bin/entrypoint.sh"] -CMD ["/bin/bash"] - -FROM base AS final-all-source -ARG ZCASH_VERSION ARG ZEBRA_VERSION ARG DEVTOOL_VERSION -LABEL org.zaino.test-artifacts.versions.zcashd="${ZCASH_VERSION}" LABEL org.zaino.test-artifacts.versions.zebra="${ZEBRA_VERSION}" LABEL org.zaino.test-artifacts.versions.devtool="${DEVTOOL_VERSION}" -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-builder /tmp/zcashd /home/container_user/artifacts/ -COPY --chown=container_user:container_user --chmod=0755 --from=zcashd-builder /tmp/zcash-cli /home/container_user/artifacts/ COPY --chown=container_user:container_user --chmod=0755 --from=zebra-builder /tmp/zebrad /home/container_user/artifacts/ COPY --chown=container_user:container_user --chmod=0755 --from=devtool-builder /tmp/zcash-devtool /home/container_user/artifacts/ RUN cargo install cargo-nextest --locked --verbose --root "${CARGO_HOME}" diff --git a/live-tests/test_environment/entrypoint.sh b/live-tests/test_environment/entrypoint.sh index 09fe08529..f2b780105 100755 --- a/live-tests/test_environment/entrypoint.sh +++ b/live-tests/test_environment/entrypoint.sh @@ -1,13 +1,11 @@ #!/bin/bash set -e -# Usage: link_to_binaries.sh [REPO_ROOT] [ZCASHD_PATH] [ZEBRAD_PATH] [ZCASH_CLI_PATH] [DEVTOOL_PATH] +# Usage: link_to_binaries.sh [REPO_ROOT] [ZEBRAD_PATH] [DEVTOOL_PATH] # # Arguments: # REPO_ROOT - Repository root directory (default: /home/container_user/zaino) -# ZCASHD_PATH - Path to zcashd binary (default: /home/container_user/artifacts/zcashd) # ZEBRAD_PATH - Path to zebrad binary (default: /home/container_user/artifacts/zebrad) -# ZCASH_CLI_PATH - Path to zcash-cli binary (default: /home/container_user/artifacts/zcash-cli) # DEVTOOL_PATH - Path to zcash-devtool binary (default: /home/container_user/artifacts/zcash-devtool) # Check if this script is being called with arguments that are actually a command to execute @@ -19,10 +17,8 @@ fi # Use provided arguments or defaults REPO_ROOT="${1:-/home/container_user/zaino}" -ZCASHD_PATH="${2:-/home/container_user/artifacts/zcashd}" -ZEBRAD_PATH="${3:-/home/container_user/artifacts/zebrad}" -ZCASH_CLI_PATH="${4:-/home/container_user/artifacts/zcash-cli}" -DEVTOOL_PATH="${5:-/home/container_user/artifacts/zcash-devtool}" +ZEBRAD_PATH="${2:-/home/container_user/artifacts/zebrad}" +DEVTOOL_PATH="${3:-/home/container_user/artifacts/zcash-devtool}" # Check if live-tests/test_binaries/bins directory exists and create symlinks if binaries are missing @@ -36,24 +32,12 @@ fi echo "Checking for test binaries in $BINS_DIR..." -# Check and create symlink for zcashd -if [ ! -f "$BINS_DIR/zcashd" ] && [ ! -L "$BINS_DIR/zcashd" ]; then - echo "zcashd not found in $BINS_DIR, creating symlink..." - ln -s "$ZCASHD_PATH" "$BINS_DIR/zcashd" -fi - # Check and create symlink for zebrad if [ ! -f "$BINS_DIR/zebrad" ] && [ ! -L "$BINS_DIR/zebrad" ]; then echo "zebrad not found in $BINS_DIR, creating symlink..." ln -s "$ZEBRAD_PATH" "$BINS_DIR/zebrad" fi -# Check and create symlink for zcash-cli -if [ ! -f "$BINS_DIR/zcash-cli" ] && [ ! -L "$BINS_DIR/zcash-cli" ]; then - echo "zcash-cli not found in $BINS_DIR, creating symlink..." - ln -s "$ZCASH_CLI_PATH" "$BINS_DIR/zcash-cli" -fi - # Check and create symlink for zcash-devtool if [ ! -f "$BINS_DIR/zcash-devtool" ] && [ ! -L "$BINS_DIR/zcash-devtool" ]; then echo "zcash-devtool not found in $BINS_DIR, creating symlink..." @@ -61,4 +45,4 @@ if [ ! -f "$BINS_DIR/zcash-devtool" ] && [ ! -L "$BINS_DIR/zcash-devtool" ]; the fi echo "Binary setup complete. Contents of $BINS_DIR:" -ls -la "$BINS_DIR" \ No newline at end of file +ls -la "$BINS_DIR" diff --git a/live-tests/zaino-testutils/Cargo.toml b/live-tests/zaino-testutils/Cargo.toml index 09b132e9f..25332a42e 100644 --- a/live-tests/zaino-testutils/Cargo.toml +++ b/live-tests/zaino-testutils/Cargo.toml @@ -12,18 +12,6 @@ publish = false [features] default = [] -# Support for the zcashd test validator. Opt-in (default off, docs/adr/0005); being deprecated. Gates -# the zcashd-specific test infra (ValidatorKind::Zcashd, the Zcashd validator -# launchers, ZcashdDualFetchServices, the zcashd smoke-test module) and -# forwards to the zaino libs. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = [ - "zaino-fetch/zcashd_support", - "zaino-state/zcashd_support", - "zaino-serve/zcashd_support", - "zainod/zcashd_support", -] - # **Experimental and alpha features** # Exposes the **complete** set of experimental / alpha features currently implemented in Zaino. experimental_features = ["transparent_address_history_experimental"] diff --git a/live-tests/zaino-testutils/src/lib.rs b/live-tests/zaino-testutils/src/lib.rs index 78ecf274c..31be2b615 100644 --- a/live-tests/zaino-testutils/src/lib.rs +++ b/live-tests/zaino-testutils/src/lib.rs @@ -33,8 +33,6 @@ use zaino_state::{ use zainodlib::{config::BackendType, error::IndexerError, indexer::Indexer}; pub use zcash_local_net as services; use zcash_local_net::error::LaunchError; -#[cfg(feature = "zcashd_support")] -use zcash_local_net::validator::zcashd::{Zcashd, ZcashdConfig}; use zcash_local_net::validator::zebrad::{Zebrad, ZebradConfig}; pub use zcash_local_net::validator::Validator; use zcash_local_net::validator::ValidatorConfig as _; @@ -441,14 +439,6 @@ pub fn from_local_net_activation_heights( } } -/// Path for zcashd binary. -#[cfg(feature = "zcashd_support")] -pub static ZCASHD_BIN: Lazy> = Lazy::new(|| binary_path("zcashd")); - -/// Path for zcash-cli binary. -#[cfg(feature = "zcashd_support")] -pub static ZCASH_CLI_BIN: Lazy> = Lazy::new(|| binary_path("zcash-cli")); - /// Path for zebrad binary. pub static ZEBRAD_BIN: Lazy> = Lazy::new(|| binary_path("zebrad")); @@ -458,14 +448,6 @@ pub static LIGHTWALLETD_BIN: Lazy> = Lazy::new(|| binary_path("l /// Path for zainod binary. pub static ZAINOD_BIN: Lazy> = Lazy::new(|| binary_path("zainod")); -/// Path for zcashd chain cache. -#[cfg(feature = "zcashd_support")] -pub static ZCASHD_CHAIN_CACHE_DIR: Lazy> = Lazy::new(|| { - let mut workspace_root_path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()); - workspace_root_path.pop(); - Some(workspace_root_path.join("live-tests/chain_cache/client_rpc_tests")) -}); - /// Path for zebrad chain cache. pub static ZEBRAD_CHAIN_CACHE_DIR: Lazy> = Lazy::new(|| { let mut workspace_root_path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()); @@ -482,9 +464,6 @@ pub static ZEBRAD_THE_PUB_TESTNET_CACHE_DIR: Lazy> = Lazy::new(| #[derive(Debug, PartialEq, Clone, Copy)] /// Represents the type of validator to launch. pub enum ValidatorKind { - /// Zcashd. - #[cfg(feature = "zcashd_support")] - Zcashd, /// Zebrad. Zebrad, } @@ -492,13 +471,10 @@ pub enum ValidatorKind { impl ValidatorKind { /// Default regtest activation heights for this validator kind. /// - /// Centralises the per-kind selection so the choice (and its - /// `zcashd_support` gating) lives in one place instead of being matched at - /// every call site. + /// Centralises the per-kind selection so the choice lives in one place + /// instead of being matched at every call site. pub fn default_activation_heights(self) -> ActivationHeights { match self { - #[cfg(feature = "zcashd_support")] - ValidatorKind::Zcashd => ActivationHeights::default(), ValidatorKind::Zebrad => ZEBRAD_DEFAULT_ACTIVATION_HEIGHTS, } } @@ -506,9 +482,6 @@ impl ValidatorKind { /// Config for validators. pub enum ValidatorTestConfig { - /// Zcashd Config. - #[cfg(feature = "zcashd_support")] - ZcashdConfig(ZcashdConfig), /// Zebrad Config. ZebradConfig(zcash_local_net::validator::zebrad::ZebradConfig), } @@ -525,9 +498,9 @@ pub struct TestManager { pub data_dir: PathBuf, /// Network (chain) type: pub network: NetworkKind, - /// Zebrad/Zcashd JsonRpc listen address. + /// Validator JsonRpc listen address. pub full_node_rpc_listen_address: SocketAddr, - /// Zebrad/Zcashd gRpc listen address. + /// Validator gRpc listen address. pub full_node_grpc_listen_address: SocketAddr, /// Zaino Indexer JoinHandle. pub zaino_handle: Option>>, @@ -579,23 +552,6 @@ impl ValidatorExt for Zebrad { } } -#[cfg(feature = "zcashd_support")] -impl ValidatorExt for Zcashd { - async fn launch_validator_and_return_config( - config: Self::Config, - ) -> Result<(Self, ValidatorConfig), LaunchError> { - let zcashd = Zcashd::launch(config).await?; - let validator_config = ValidatorConfig { - validator_jsonrpc_listen_address: format!("{}:{}", Ipv4Addr::LOCALHOST, zcashd.port()), - validator_grpc_listen_address: None, - validator_cookie_path: None, - validator_user: Some("xxxxxx".to_string()), - validator_password: Some("xxxxxx".to_string()), - }; - Ok((zcashd, validator_config)) - } -} - /// The pool that sessions funding wallets from coinbase mine to. Shielded /// coinbase carries no 100-confirmation maturity rule (that rule covers only /// transparent coinbase outputs), so a test that needs shielded start funds @@ -612,15 +568,11 @@ impl ValidatorExt for Zcashd { pub const SHIELDED_FUNDING_POOL: MinerPool = MinerPool::Orchard; /// The pool a validator mines to when the session doesn't opt into -/// [`SHIELDED_FUNDING_POOL`]: transparent for zebrad (cheapest block -/// templates — a shielded miner address would cost a halo2 proof per block), -/// Orchard for zcashd (its historical setting; the cached launch reward -/// funds wallets without extra mining). +/// [`SHIELDED_FUNDING_POOL`]: transparent (cheapest block templates — a +/// shielded miner address would cost a halo2 proof per block). pub fn default_mining_pool(validator: &ValidatorKind) -> MinerPool { - if validator == &ValidatorKind::Zebrad { - MinerPool::Transparent - } else { - MinerPool::Orchard + match validator { + ValidatorKind::Zebrad => MinerPool::Transparent, } } @@ -685,7 +637,7 @@ where /// Launches zcash-local-net with coinbase paid to /// `mine_to_pool`'s regtest miner address. /// - /// Possible validators: Zcashd, Zebrad. + /// Possible validators: Zebrad. /// /// On zebrad a shielded `mine_to_pool` maps to a unified miner address /// whose receivers zebra tries in order orchard → sapling → transparent @@ -717,12 +669,6 @@ where enable_zaino_jsonrpc_server: bool, enable_clients: bool, ) -> Result { - #[cfg(feature = "zcashd_support")] - if (validator == &ValidatorKind::Zcashd) && (Conn::BACKEND == BackendType::Direct) { - return Err(std::io::Error::other( - "Cannot use the direct (ReadStateService) connection with zcashd.", - )); - } zaino_common::logging::try_init(); let activation_heights = @@ -1266,117 +1212,6 @@ async fn spawn_fetch_service( .unwrap() } -/// Handles from [`launch_zcashd_dual_fetch_services`]: a zcashd-backed -/// [`TestManager`] (JSON-RPC server enabled) plus two standalone fetch -/// services — one pointed at zcashd directly, one at Zaino's JSON-RPC -/// server — for tests that compare the two. The owned services exist only to -/// keep their subscribers alive. -#[cfg(feature = "zcashd_support")] -pub struct ZcashdDualFetchServices { - /// The launched zcashd + Zaino test manager. - pub test_manager: TestManager, - /// Owned zcashd-direct `Rpc` service; keeps `zcashd_subscriber` alive. - pub zcashd_fetch_service: NodeBackedIndexerService, - /// Subscriber whose answers come from zcashd directly. - pub zcashd_subscriber: NodeBackedIndexerServiceSubscriber, - /// Owned Zaino-pointed `Rpc` service; keeps `zaino_subscriber` alive. - pub zaino_fetch_service: NodeBackedIndexerService, - /// Subscriber whose answers come through Zaino's JSON-RPC server. - pub zaino_subscriber: NodeBackedIndexerServiceSubscriber, -} - -#[cfg(feature = "zcashd_support")] -#[allow(deprecated)] -impl ZcashdDualFetchServices { - /// Mine `n` blocks and wait for both the zaino and zcashd subscribers to - /// observe the new tip. - pub async fn generate_blocks_and_wait_for_tips(&self, n: u32) { - self.test_manager - .generate_blocks_and_wait_for_tips(n, &self.zaino_subscriber, &self.zcashd_subscriber) - .await; - } -} - -/// Launch a zcashd [`TestManager`] (with the JSON-RPC server enabled) alongside -/// two standalone [`FetchService`] instances — one pointed at zcashd directly, -/// one at Zaino's JSON-RPC server — for tests that compare the two, bundled as -/// a [`ZcashdDualFetchServices`]. -/// -/// Shared core of the `create_zcashd_test_manager_and_fetch_services` harness in -/// both live-test partitions (`clientless` and `e2e`). The `e2e` partition -/// wraps this and additionally builds lightclients from the returned manager's -/// gRPC address. -#[cfg(feature = "zcashd_support")] -#[allow(deprecated)] -pub async fn launch_zcashd_dual_fetch_services() -> ZcashdDualFetchServices { - launch_zcashd_dual_fetch_services_at(ActivationHeights::default()).await -} - -/// [`launch_zcashd_dual_fetch_services`] with the zcashd chain and both fetch -/// services pinned to `activation_heights`, for wallet clients (e.g. the devtool -/// wallet) whose compiled-in regtest heights differ from zcashd's defaults and -/// must be matched by the validator. -#[cfg(feature = "zcashd_support")] -#[allow(deprecated)] -pub async fn launch_zcashd_dual_fetch_services_at( - activation_heights: ActivationHeights, -) -> ZcashdDualFetchServices { - let test_manager = TestManager::::launch( - &ValidatorKind::Zcashd, - None, - Some(activation_heights), - None, - true, - true, - false, - ) - .await - .unwrap(); - - tokio::time::sleep(std::time::Duration::from_secs(3)).await; - - let zcashd_fetch_service = spawn_fetch_service( - test_manager.full_node_rpc_listen_address.to_string(), - None, - test_manager - .local_net - .data_dir() - .path() - .join("zcashd-fetch-service-zaino"), - Network::Regtest, - ) - .await; - let zcashd_subscriber = zcashd_fetch_service.get_subscriber().inner(); - - tokio::time::sleep(std::time::Duration::from_secs(3)).await; - - let zaino_fetch_service = spawn_fetch_service( - test_manager - .zaino_json_rpc_listen_address - .expect("zaino jsonrpc address must be active for these tests") - .to_string(), - test_manager.json_server_cookie_dir.clone(), - test_manager - .local_net - .data_dir() - .path() - .join("zaino-fetch-service-zaino"), - Network::Regtest, - ) - .await; - let zaino_subscriber = zaino_fetch_service.get_subscriber().inner(); - - tokio::time::sleep(std::time::Duration::from_secs(3)).await; - - ZcashdDualFetchServices { - test_manager, - zcashd_fetch_service, - zcashd_subscriber, - zaino_fetch_service, - zaino_subscriber, - } -} - /// Return a copy of `info` with its final (timestamp) field zeroed, so two /// `getinfo` responses from different sources can be compared without spurious /// timestamp differences. @@ -1503,59 +1338,6 @@ mod launch_testmanager { .unwrap() } - #[cfg(feature = "zcashd_support")] - mod zcashd { - use zcash_local_net::validator::zcashd::Zcashd; - - use super::*; - - #[tokio::test(flavor = "multi_thread")] - #[allow(deprecated)] - pub(crate) async fn basic() { - let mut test_manager = - launch_minimal::(&ValidatorKind::Zcashd, None, false).await; - assert_eq!(2, (test_manager.local_net.get_chain_height().await)); - test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - #[allow(deprecated)] - pub(crate) async fn generate_blocks() { - let mut test_manager = - launch_minimal::(&ValidatorKind::Zcashd, None, false).await; - assert_eq!(2, (test_manager.local_net.get_chain_height().await)); - test_manager.local_net.generate_blocks(1).await.unwrap(); - assert_eq!(3, (test_manager.local_net.get_chain_height().await)); - test_manager.close().await; - } - - #[ignore = "chain cache needs development"] - #[tokio::test(flavor = "multi_thread")] - #[allow(deprecated)] - pub(crate) async fn with_chain() { - let mut test_manager = launch_minimal::( - &ValidatorKind::Zcashd, - ZCASHD_CHAIN_CACHE_DIR.clone(), - false, - ) - .await; - assert_eq!(10, (test_manager.local_net.get_chain_height().await)); - test_manager.close().await; - } - - #[tokio::test(flavor = "multi_thread")] - #[allow(deprecated)] - pub(crate) async fn zaino() { - let mut test_manager = - launch_minimal::(&ValidatorKind::Zcashd, None, true).await; - - let _grpc_client = build_client(test_manager.grpc_socket_to_uri()) - .await - .unwrap(); - test_manager.close().await; - } - } - mod zebrad { use super::*; diff --git a/packages/zaino-common/src/config/validator.rs b/packages/zaino-common/src/config/validator.rs index c8ffcbd2a..f98afc3e6 100644 --- a/packages/zaino-common/src/config/validator.rs +++ b/packages/zaino-common/src/config/validator.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; /// Validator (full-node) connection settings. /// -/// Configures how Zaino connects to the backing validator (Zebra or Zcashd). +/// Configures how Zaino connects to the backing validator (Zebra). #[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize)] #[serde(default)] pub struct ValidatorConfig { diff --git a/packages/zaino-fetch/Cargo.toml b/packages/zaino-fetch/Cargo.toml index 6d912aa54..7b203c074 100644 --- a/packages/zaino-fetch/Cargo.toml +++ b/packages/zaino-fetch/Cargo.toml @@ -14,12 +14,6 @@ default = [] # Prometheus metrics emission (outbound RPC request counting / latency). prometheus = ["metrics"] -# Support for connecting to a zcashd validator node. Opt-in (default off, docs/adr/0005); being -# deprecated. Gates the zcashd-shaped getpeerinfo parsing. Dropping it -# (`--no-default-features`) compiles zcashd parsing out. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = [] - [dependencies] zaino-common = { workspace = true } zaino-proto = { workspace = true } diff --git a/packages/zaino-fetch/src/jsonrpsee/connector.rs b/packages/zaino-fetch/src/jsonrpsee/connector.rs index 056821afa..c19ded158 100644 --- a/packages/zaino-fetch/src/jsonrpsee/connector.rs +++ b/packages/zaino-fetch/src/jsonrpsee/connector.rs @@ -1036,7 +1036,7 @@ fn resolve_address(address: &str) -> Result { .map_err(|e| TransportError::BadNodeData(Box::new(e), "address resolution")) } -/// Tries to connect to zebrad/zcashd using the provided address and returns the correct URL. +/// Tries to connect to zebrad using the provided address and returns the correct URL. /// Accepts both hostname:port (e.g., "zebra:18232") and ip:port (e.g., "127.0.0.1:18232") formats. pub async fn test_node_and_return_url( address: &str, @@ -1081,7 +1081,7 @@ pub async fn test_node_and_return_url( } interval.tick().await; } - error!(%url, "failed to connect to validator node — is zcashd/zebrad running? check authentication"); + error!(%url, "failed to connect to validator node — is zebrad running? check authentication"); std::process::exit(1); } diff --git a/packages/zaino-fetch/src/jsonrpsee/response/peer_info.rs b/packages/zaino-fetch/src/jsonrpsee/response/peer_info.rs index 9b3e37741..c0bcba1be 100644 --- a/packages/zaino-fetch/src/jsonrpsee/response/peer_info.rs +++ b/packages/zaino-fetch/src/jsonrpsee/response/peer_info.rs @@ -5,26 +5,15 @@ use std::convert::Infallible; -#[cfg(feature = "zcashd_support")] -use serde::Serializer; use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value; use crate::jsonrpsee::connector::ResponseToError; -#[cfg(feature = "zcashd_support")] -use crate::jsonrpsee::response::common::{ - BlockHeight, Bytes, MaybeHeight, NodeId, ProtocolVersion, SecondsF64, TimeOffsetSeconds, - UnixTime, -}; /// Response to a `getpeerinfo` RPC request. #[derive(Debug, Clone, Serialize, PartialEq)] #[serde(untagged)] pub enum GetPeerInfo { - /// The `zcashd` typed response. - #[cfg(feature = "zcashd_support")] - Zcashd(Vec), - /// The `zebrad` typed response. Zebrad(Vec), @@ -42,83 +31,10 @@ pub struct ZebradPeerInfo { pub inbound: bool, } -// TODO: Do not use primitive types -/// Response to a `getpeerinfo` RPC request coming from `zcashd`. -#[cfg(feature = "zcashd_support")] -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -#[serde(deny_unknown_fields)] -pub struct ZcashdPeerInfo { - /// Peer index (NodeId). - pub id: NodeId, - - /// Remote address `host:port`. - pub addr: String, - - /// Typed representation of the hex-encoded service flags. - pub services: ServiceFlags, - - /// Whether the peer asked us to relay transactions. - pub relaytxes: bool, - - /// Last send time (Unix seconds). - pub lastsend: UnixTime, - - /// Last receive time (Unix seconds). - pub lastrecv: UnixTime, - - /// Total bytes sent. - pub bytessent: Bytes, - - /// Total bytes received. - pub bytesrecv: Bytes, - - /// Connection time (Unix seconds). - pub conntime: UnixTime, - - /// Clock offset (seconds, can be negative). - pub timeoffset: TimeOffsetSeconds, - - /// Ping time (seconds). - pub pingtime: SecondsF64, - - /// Protocol version. - pub version: ProtocolVersion, - - /// User agent string. - pub subver: String, - - /// Whether the connection is inbound. - pub inbound: bool, - - /// Starting block height advertised by the peer. - pub startingheight: MaybeHeight, - - /// Count of processed addr messages. - pub addr_processed: u64, - - /// Count of rate-limited addr messages. - pub addr_rate_limited: u64, - - /// Whether the peer is whitelisted. - pub whitelisted: bool, - - /// Local address `host:port`. - #[serde(default)] - pub addrlocal: Option, - - /// Ping wait time in seconds. Only present if > 0.0. - #[serde(default)] - pub pingwait: Option, - - /// Grouped validation/sync state (present when zcashd exposes state stats). - #[serde(flatten)] - pub state: Option, -} - impl<'de> Deserialize<'de> for GetPeerInfo { - /// Deserialize either a `ZcashdPeerInfo` or a `ZebradPeerInfo` depending on the shape of the JSON. + /// Deserialize a `ZebradPeerInfo` array, preserving any other array shape + /// as `Unknown` for passthrough/logging. /// - /// In the `Unkown` variant, the raw array is preserved for passthrough/logging. /// If the value is not an array, an error is returned. fn deserialize(de: D) -> Result where @@ -126,11 +42,6 @@ impl<'de> Deserialize<'de> for GetPeerInfo { { let v = Value::deserialize(de)?; - // zcashd first - #[cfg(feature = "zcashd_support")] - if let Ok(zd) = serde_json::from_value::>(v.clone()) { - return Ok(GetPeerInfo::Zcashd(zd)); - } // zebrad if let Ok(zebra) = serde_json::from_value::>(v.clone()) { return Ok(GetPeerInfo::Zebrad(zebra)); @@ -149,155 +60,9 @@ impl ResponseToError for GetPeerInfo { type RpcError = Infallible; } -/// Bitflags for the peer's advertised services (backed by a u64). -/// Serialized as a zero-padded 16-digit lowercase hex string. -#[cfg(feature = "zcashd_support")] -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct ServiceFlags(pub u64); - -#[cfg(feature = "zcashd_support")] -impl ServiceFlags { - /// Returns the underlying bits - pub fn bits(self) -> u64 { - self.0 - } - - /// Returns true if the given bit is set - pub fn has(self, mask: u64) -> bool { - (self.0 & mask) != 0 - } - - /// Node offers full network services (bit 0). - pub const NODE_NETWORK: u64 = 1 << 0; - - /// Legacy Bloom filter support (bit 2). - pub const NODE_BLOOM: u64 = 1 << 2; - - /// Returns true if the `NODE_NETWORK` bit is set - pub fn has_node_network(self) -> bool { - self.has(Self::NODE_NETWORK) - } - - /// Returns true if the `NODE_BLOOM` bit is set - pub fn has_node_bloom(self) -> bool { - self.has(Self::NODE_BLOOM) - } - - /// Bits not recognized by this crate. - pub fn unknown_bits(self) -> u64 { - let known = Self::NODE_NETWORK | Self::NODE_BLOOM; - self.bits() & !known - } -} - -#[cfg(feature = "zcashd_support")] -impl From for ServiceFlags { - fn from(x: u64) -> Self { - ServiceFlags(x) - } -} -#[cfg(feature = "zcashd_support")] -impl From for u64 { - fn from(f: ServiceFlags) -> Self { - f.0 - } -} - -#[cfg(feature = "zcashd_support")] -impl Serialize for ServiceFlags { - fn serialize(&self, ser: S) -> Result { - ser.serialize_str(&format!("{:016x}", self.0)) - } -} -#[cfg(feature = "zcashd_support")] -impl<'de> Deserialize<'de> for ServiceFlags { - fn deserialize>(de: D) -> Result { - let s = String::deserialize(de)?; - - // Optional `0x` - let s = s.strip_prefix("0x").unwrap_or(&s); - u64::from_str_radix(s, 16) - .map(ServiceFlags) - .map_err(|e| serde::de::Error::custom(format!("invalid services hex: {e}"))) - } -} - -/// Per-peer validation/sync state. Present when state stats are set. `zcashd` only. -#[cfg(feature = "zcashd_support")] -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct PeerStateStats { - /// Misbehavior score. - pub banscore: i64, - /// Last header height in common. - pub synced_headers: BlockHeight, - /// Last block height in common. - pub synced_blocks: BlockHeight, - /// Block heights currently requested from this peer. - pub inflight: Vec, -} - #[cfg(test)] mod tests { use super::*; - // use pretty_assertions::assert_eq; - - // TODO: get a real testvector - #[cfg(feature = "zcashd_support")] - #[test] - fn parses_zcashd_payload() { - let zcashd_json = r#" - [ - { - "id": 1, - "addr": "127.0.0.1:8233", - "services": "0000000000000001", - "relaytxes": true, - "lastsend": 1690000000, - "lastrecv": 1690000100, - "bytessent": 1234, - "bytesrecv": 5678, - "conntime": 1690000000, - "timeoffset": 0, - "pingtime": 0.001, - "version": 170002, - "subver": "/MagicBean:5.8.0/", - "inbound": false, - "startingheight": 2000000, - "addr_processed": 1, - "addr_rate_limited": 0, - "whitelisted": false, - "addrlocal": "192.168.1.10:8233", - "pingwait": 0.1, - "banscore": 0, - "synced_headers": 1999999, - "synced_blocks": 1999999, - "inflight": [2000000, 2000001] - } - ] - "#; - - let parsed: GetPeerInfo = serde_json::from_str(zcashd_json).unwrap(); - match parsed { - GetPeerInfo::Zcashd(items) => { - let p = &items[0]; - assert_eq!(p.id, NodeId(1)); - assert_eq!(p.addr, "127.0.0.1:8233"); - assert_eq!(p.version, ProtocolVersion(170002)); - assert!(!p.inbound); - assert_eq!(p.pingwait, Some(SecondsF64(0.1))); - - let st = p.state.as_ref().expect("expected state stats"); - assert_eq!(st.synced_blocks, BlockHeight::from(1999999)); - assert_eq!(st.synced_headers, BlockHeight::from(1999999)); - assert_eq!(st.banscore, 0); - assert_eq!( - st.inflight, - vec![BlockHeight::from(2000000), BlockHeight::from(2000001),] - ); - } - other => panic!("expected Zcashd, got: {:?}", other), - } - } // TODO: get a real testvector #[test] @@ -322,36 +87,16 @@ mod tests { } } - #[cfg(feature = "zcashd_support")] - #[test] - fn zcashd_rejects_extra_fields() { - let j = r#"[{ - "id":1,"addr":"127.0.0.1:8233","services":"0000000000000001", - "relaytxes":true,"lastsend":1,"lastrecv":2,"bytessent":3,"bytesrecv":4, - "conntime":5,"timeoffset":0,"pingtime":0.1,"version":170002,"subver":"/X/","inbound":false, - "startingheight":-1,"addr_processed":0,"addr_rate_limited":0,"whitelisted":false, - "unexpected":"oops" - }]"#; - - // zcashd fails due to unknown field - let err = serde_json::from_str::>(j).unwrap_err(); - assert!(err.to_string().contains("unknown field")); - - // Should be `Unknown` - let parsed = serde_json::from_str::(j).unwrap(); - matches!(parsed, GetPeerInfo::Unknown(_)); - } - /// Integrity test that ensures no Downgrade-to-Zebrad via type poisoning is possible. #[test] fn zebrad_does_not_act_as_catchall() { - let invalid_zcashd = r#" + let extra_field_json = r#" [ { "addr": "1.2.3.4:8233", "inbound": false, "whitelisted": "true" } ] "#; - let parsed: GetPeerInfo = serde_json::from_str(invalid_zcashd).unwrap(); + let parsed: GetPeerInfo = serde_json::from_str(extra_field_json).unwrap(); match parsed { GetPeerInfo::Unknown(items) => { @@ -391,90 +136,10 @@ mod tests { assert_eq!(err.to_string(), "getpeerinfo: expected JSON array"); } - #[cfg(feature = "zcashd_support")] - #[test] - fn getpeerinfo_serializes_as_raw_array() { - let val = GetPeerInfo::Zcashd(Vec::new()); - let s = serde_json::to_string(&val).unwrap(); - assert_eq!(s, "[]"); - } - #[test] fn getpeerinfo_unknown_serializes_as_raw_array() { let val = GetPeerInfo::Unknown(vec![serde_json::json!({"foo":1})]); let s = serde_json::to_string(&val).unwrap(); assert_eq!(s, r#"[{"foo":1}]"#); } - - #[cfg(feature = "zcashd_support")] - mod serviceflags { - use crate::jsonrpsee::response::{ - common::{ - BlockHeight, Bytes, MaybeHeight, NodeId, ProtocolVersion, SecondsF64, - TimeOffsetSeconds, UnixTime, - }, - peer_info::{ServiceFlags, ZcashdPeerInfo}, - }; - - #[test] - fn serviceflags_roundtrip() { - let f = ServiceFlags(0x0000_0000_0000_0001); - let s = serde_json::to_string(&f).unwrap(); - assert_eq!(s, r#""0000000000000001""#); // zero-padded, lowercase - let back: ServiceFlags = serde_json::from_str(&s).unwrap(); - assert_eq!(back.bits(), 1); - assert!(back.has(1)); - } - - #[test] - fn zcashd_peerinfo_deser_with_typed_services() { - let j = r#"[{ - "id":1, - "addr":"127.0.0.1:8233", - "services":"0000000000000003", - "relaytxes":true, - "lastsend":1,"lastrecv":2,"bytessent":3,"bytesrecv":4, - "conntime":5,"timeoffset":0,"pingtime":0.001, - "version":170002,"subver":"/MagicBean:5.8.0/","inbound":false, - "startingheight":2000000,"addr_processed":7,"addr_rate_limited":8,"whitelisted":false - }]"#; - - let v: Vec = serde_json::from_str(j).unwrap(); - assert_eq!(v[0].services.bits(), 3); - assert!(v[0].services.has(1)); - assert!(v[0].services.has(2)); - } - - #[test] - fn zcashd_peerinfo_serializes_back_to_hex() { - let pi = ZcashdPeerInfo { - id: NodeId(1), - addr: "127.0.0.1:8233".into(), - services: ServiceFlags(0x0A0B_0C0D_0E0F), - relaytxes: true, - lastsend: UnixTime(1), - lastrecv: UnixTime(2), - bytessent: Bytes(3), - bytesrecv: Bytes(4), - conntime: UnixTime(5), - timeoffset: TimeOffsetSeconds(0), - pingtime: SecondsF64(0.1), - version: ProtocolVersion(170002), - subver: "/X/".into(), - inbound: false, - startingheight: MaybeHeight(Some(BlockHeight::from(42))), - addr_processed: 0, - addr_rate_limited: 0, - whitelisted: false, - addrlocal: None, - pingwait: None, - state: None, - }; - - let v = serde_json::to_value(&pi).unwrap(); - let services_str = v["services"].as_str().unwrap(); - let expected = format!("{:016x}", u64::from(pi.services)); - assert_eq!(services_str, expected); // "00000a0b0c0d0e0f" - } - } } diff --git a/packages/zaino-fetch/src/lib.rs b/packages/zaino-fetch/src/lib.rs index 0299020a2..ae908f756 100644 --- a/packages/zaino-fetch/src/lib.rs +++ b/packages/zaino-fetch/src/lib.rs @@ -1,4 +1,4 @@ -//! A mempool-fetching, chain-fetching and transaction submission service that uses zcashd's JsonRPC interface. +//! A mempool-fetching, chain-fetching and transaction submission service that uses the Zcash JsonRPC interface. //! //! Usable as a backwards-compatible, legacy option. diff --git a/packages/zaino-serve/Cargo.toml b/packages/zaino-serve/Cargo.toml index c421c8a4e..33e9be748 100644 --- a/packages/zaino-serve/Cargo.toml +++ b/packages/zaino-serve/Cargo.toml @@ -16,11 +16,6 @@ default = [] # open socket over race-free. Not part of the production API. test_dependencies = [] -# Support for connecting to a zcashd validator node. Opt-in (default off, docs/adr/0005); being -# deprecated. Forwards to zaino-fetch and zaino-state. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = ["zaino-fetch/zcashd_support", "zaino-state/zcashd_support"] - # Removes network restrictions. no_tls_use_unencrypted_traffic = ["tonic/tls-native-roots"] diff --git a/packages/zaino-state/Cargo.toml b/packages/zaino-state/Cargo.toml index 0f60eab31..7c46cf499 100644 --- a/packages/zaino-state/Cargo.toml +++ b/packages/zaino-state/Cargo.toml @@ -19,11 +19,6 @@ default = [] # excludes the live-test crates from production builds. fast-test-seam = [] -# Support for connecting to a zcashd validator node. Opt-in (default off, docs/adr/0005); being -# deprecated. Forwards to zaino-fetch. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = ["zaino-fetch/zcashd_support"] - # Prometheus metrics emission (gauge! calls in sync paths). prometheus = ["metrics"] diff --git a/packages/zaino-state/src/chain_index.rs b/packages/zaino-state/src/chain_index.rs index 1571d3b8a..8846e4c66 100644 --- a/packages/zaino-state/src/chain_index.rs +++ b/packages/zaino-state/src/chain_index.rs @@ -211,7 +211,7 @@ fn branch_len_to_active_chain( /// /// The primary implementation is [`NodeBackedChainIndex`], which can be backed by either: /// - Direct read access to a zebrad database via `ReadStateService` (preferred) -/// - A JSON-RPC connection to a validator node (zcashd, zebrad, or another zainod) +/// - A JSON-RPC connection to a validator node (zebrad or another zainod) /// /// # Example with ReadStateService (Preferred) /// @@ -720,7 +720,7 @@ pub trait ChainIndexRpcExt: ChainIndex { /// This is the primary implementation backing [`ChainIndex`] and replaces the functionality /// previously provided by `FetchService` and `StateService`. It can be backed by either: /// - A zebra `ReadStateService` for direct database access (preferred for performance) -/// - A JSON-RPC connection to any validator node (zcashd, zebrad, or another zainod) +/// - A JSON-RPC connection to any validator node (zebrad or another zainod) /// /// To use the [`ChainIndex`] trait methods, call [`subscriber()`](NodeBackedChainIndex::subscriber) /// to get a [`NodeBackedChainIndexSubscriber`] which implements the trait. diff --git a/packages/zaino-state/src/config.rs b/packages/zaino-state/src/config.rs index 3cfff0d76..5fa9fae89 100644 --- a/packages/zaino-state/src/config.rs +++ b/packages/zaino-state/src/config.rs @@ -52,7 +52,7 @@ impl std::fmt::Display for DonationAddress { pub enum ValidatorConnectionType { /// JSON-RPC connection (formerly `Fetch`). /// - /// Compatible with Zcashd, Zebra, or another Zaino instance. + /// Compatible with Zebra or another Zaino instance. Rpc, /// Direct Zebra `ReadStateService` connection (formerly `State`). /// diff --git a/packages/zaino-state/src/indexer/node_backed_indexer.rs b/packages/zaino-state/src/indexer/node_backed_indexer.rs index 0aeaa446d..742a4cb5a 100644 --- a/packages/zaino-state/src/indexer/node_backed_indexer.rs +++ b/packages/zaino-state/src/indexer/node_backed_indexer.rs @@ -1,4 +1,4 @@ -//! Zcash chain fetch and tx submission service backed by zcashds JsonRPC service. +//! Zcash chain fetch and tx submission service backed by the validator's JsonRPC service. use futures::StreamExt; use hex::FromHex; diff --git a/packages/zaino-state/src/lib.rs b/packages/zaino-state/src/lib.rs index a2c0d67a6..54183b8fa 100644 --- a/packages/zaino-state/src/lib.rs +++ b/packages/zaino-state/src/lib.rs @@ -2,7 +2,7 @@ //! //! Built to use a configurable backend: //! - FetchService -//! - Built using the Zcash Json RPC Services for backwards compatibility with Zcashd and other JsonRPC based validators. +//! - Built using the Zcash Json RPC Services for backwards compatibility with JsonRPC based validators. //! - StateService //! - Built using Zebra's ReadStateService for efficient chain access. diff --git a/packages/zainod/Cargo.toml b/packages/zainod/Cargo.toml index beba27ad9..626aebc2b 100644 --- a/packages/zainod/Cargo.toml +++ b/packages/zainod/Cargo.toml @@ -24,16 +24,6 @@ default = [] # zaino-serve. test_dependencies = ["zaino-serve/test_dependencies"] -# Support for connecting to a zcashd validator node. Opt-in (default off, docs/adr/0005); being -# deprecated. Forwards to the zaino libs. Build with `--no-default-features` -# to compile zcashd out end-to-end. See -# docs/adr/0001-zcashd-support-feature-gate.md. -zcashd_support = [ - "zaino-fetch/zcashd_support", - "zaino-state/zcashd_support", - "zaino-serve/zcashd_support", -] - # Removes network restrictions. no_tls_use_unencrypted_traffic = ["zaino-serve/no_tls_use_unencrypted_traffic"] diff --git a/packages/zainod/README.md b/packages/zainod/README.md index 100060bd0..b65523c53 100644 --- a/packages/zainod/README.md +++ b/packages/zainod/README.md @@ -3,7 +3,7 @@ `zainod` is the Zaino indexer daemon — an indexer for the Zcash blockchain, written in Rust. -It sits between a Zcash full validator (Zebra or Zcashd) and client +It sits between a Zcash full validator (Zebra) and client applications, serving: - the [lightclient protocol API](https://github.com/zcash/lightwallet-protocol), the interface today diff --git a/packages/zainod/src/config.rs b/packages/zainod/src/config.rs index 889359c65..35ee1d17b 100644 --- a/packages/zainod/src/config.rs +++ b/packages/zainod/src/config.rs @@ -41,7 +41,7 @@ pub enum BackendType { Direct, /// JSON-RPC access (formerly `fetch`). /// - /// Compatible with Zcashd, Zebra, or another Zaino instance. + /// Compatible with Zebra or another Zaino instance. #[default] #[serde(alias = "fetch")] Rpc, diff --git a/tools/scripts/build-image.sh b/tools/scripts/build-image.sh index 1233965e2..8f3d3bfde 100755 --- a/tools/scripts/build-image.sh +++ b/tools/scripts/build-image.sh @@ -20,7 +20,7 @@ source ./tools/scripts/functions.sh # root. mkdir -p target -TARGET=$(resolve_build_target "$ZCASH_VERSION" "$ZEBRA_VERSION") +TARGET=$(resolve_build_target "$ZEBRA_VERSION") # For local builds, use the current user's UID/GID to avoid permission # issues. CI builds will use the default UID=1001 from the Containerfile. @@ -51,7 +51,6 @@ info "Resolved ZEBRA_VERSION=$ZEBRA_VERSION to ZEBRA_GIT_REF=$ZEBRA_GIT_REF" cd live-tests/test_environment && \ podman build -f Containerfile \ --target "$TARGET" \ - --build-arg "ZCASH_VERSION=$ZCASH_VERSION" \ --build-arg "ZEBRA_VERSION=$ZEBRA_VERSION" \ --build-arg "ZEBRA_GIT_REF=$ZEBRA_GIT_REF" \ --build-arg "DEVTOOL_VERSION=$DEVTOOL_VERSION" \ diff --git a/tools/scripts/check-zaino-proto-heavy.rs b/tools/scripts/check-zaino-proto-heavy.rs deleted file mode 100644 index f4819181c..000000000 --- a/tools/scripts/check-zaino-proto-heavy.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Guard: `zaino-proto`'s `heavy` feature must stay enabled when a workspace is -// built with `--no-default-features`. -// -// The test suite runs with `--no-default-features` (the zcashd-off world; -// `zcashd_support` is opt-in and deprecating, docs/adr/0005). `heavy` is a -// *separate* default feature, on `zaino-proto` only, that -// pulls in zebra-state / zebra-chain / which. It survives `--no-default-features` -// only because every dependent pulls `zaino-proto` with default features (no -// `default-features = false` on those edges). If someone adds -// `default-features = false` to a `zaino-proto` dependency, `--no-default-features` -// would silently strip `heavy` and change the test build. This guard fails in -// that case. -// -// Run by the `check-zaino-proto-heavy` task via cargo-make's `@rust` runner. -// See docs/adr/0001-zcashd-support-feature-gate.md. -#![forbid(unsafe_code)] - -use std::process::Command; - -// Workspaces whose test suites run with --no-default-features, by manifest path. -const WORKSPACES: &[(&str, &str)] = &[ - ("production", "Cargo.toml"), - ("live-tests", "live-tests/Cargo.toml"), - ("e2e", "live-tests/e2e/Cargo.toml"), -]; - -// The feature node `cargo tree -e features` prints when `heavy` is enabled. -const HEAVY_NODE: &str = "zaino-proto feature \"heavy\""; - -fn main() -> Result<(), Box> { - let mut failed = false; - - for (label, manifest) in WORKSPACES { - let out = Command::new("cargo") - .args([ - "tree", - "--manifest-path", - manifest, - "--no-default-features", - "-e", - "features", - "-i", - "zaino-proto", - ]) - .output()?; - - if !out.status.success() { - eprintln!( - "[{label}] `cargo tree` failed:\n{}", - String::from_utf8_lossy(&out.stderr) - ); - failed = true; - continue; - } - - let stdout = String::from_utf8_lossy(&out.stdout); - if stdout.contains(HEAVY_NODE) { - println!( - "[{label}] OK: zaino-proto `heavy` stays enabled under --no-default-features" - ); - } else { - eprintln!( - "[{label}] FAIL: zaino-proto `heavy` is NOT enabled under --no-default-features.\n\ - A `zaino-proto` dependency likely sets `default-features = false`, which strips\n\ - `heavy` (zebra-state / zebra-chain / which) from the no-zcashd test build that\n\ - `makers container-test` / `live` use. Remove that\n\ - `default-features = false`. See docs/adr/0001-zcashd-support-feature-gate.md.\n\ - --- cargo tree output ---\n{stdout}" - ); - failed = true; - } - } - - if failed { - return Err("zaino-proto `heavy` invariant violated under --no-default-features".into()); - } - Ok(()) -} diff --git a/tools/scripts/get-ci-image-tag.sh b/tools/scripts/get-ci-image-tag.sh index 25138080d..bd2c5fb6c 100755 --- a/tools/scripts/get-ci-image-tag.sh +++ b/tools/scripts/get-ci-image-tag.sh @@ -16,8 +16,8 @@ main() { devtool_rev=$(resolve_devtool_rev "$DEVTOOL_VERSION") local tag_vars - tag_vars="RUST_$RUST_VERSION-ZCASH_$ZCASH_VERSION" - tag_vars+="-ZEBRA_$ZEBRA_VERSION-DEVTOOL_${devtool_rev:0:12}" + tag_vars="RUST_$RUST_VERSION-ZEBRA_$ZEBRA_VERSION" + tag_vars+="-DEVTOOL_${devtool_rev:0:12}" tag_vars+="-CONTAINER_$container_hash" echo "$tag_vars" } diff --git a/tools/scripts/help.sh b/tools/scripts/help.sh index 7f962451c..83ecb50cf 100755 --- a/tools/scripts/help.sh +++ b/tools/scripts/help.sh @@ -85,7 +85,7 @@ echo " set-worktree-parent-tools Copy .cargo/config.toml to common \ worktree parent" echo "" echo "Environment:" -echo " ZCASH_VERSION, ZEBRA_VERSION Defined by: .env.testing-artifacts" +echo " ZEBRA_VERSION Defined by: .env.testing-artifacts" echo " RUST_VERSION Derived from rust-toolchain.toml" echo " via the workbench get-rust-version bin" echo "" diff --git a/tools/scripts/helpers.sh b/tools/scripts/helpers.sh index b705c5422..2a11eb828 100755 --- a/tools/scripts/helpers.sh +++ b/tools/scripts/helpers.sh @@ -19,17 +19,12 @@ is_tag() { } resolve_build_target() { - local zcash="$1" - local zebra="$2" + local zebra="$1" - if is_tag "$zcash" && is_tag "$zebra"; then + if is_tag "$zebra"; then echo "final-prebuilt" - elif ! is_tag "$zcash" && is_tag "$zebra"; then - echo "final-zcashd-source" - elif is_tag "$zcash" && ! is_tag "$zebra"; then - echo "final-zebrad-source" else - echo "final-all-source" + echo "final-zebrad-source" fi } diff --git a/tools/scripts/validate-makefile-tasks.rs b/tools/scripts/validate-makefile-tasks.rs index 16d440347..1f577989e 100644 --- a/tools/scripts/validate-makefile-tasks.rs +++ b/tools/scripts/validate-makefile-tasks.rs @@ -49,7 +49,7 @@ fn main() -> Result<(), Box> { &format!("{}:{}", image_name, tag), "cargo", "test", "--package", "zaino-testutils", - "--lib", "launch_testmanager::zcashd::basic", + "--lib", "launch_testmanager::zebrad::fetch_service::basic", "--", "--nocapture" ]) .stdout(Stdio::inherit()) diff --git a/tools/scripts/verify-all.sh b/tools/scripts/verify-all.sh index 8ac5b053c..92b879873 100755 --- a/tools/scripts/verify-all.sh +++ b/tools/scripts/verify-all.sh @@ -126,14 +126,10 @@ podman tag "${IMAGE_NAME}:${TAG}" "${IMAGE_NAME}:verify-${TAG}" \ 2>/dev/null || true # === Tier 3: Container execution === -# One test per component: zcashd, zebrad, lightwallet gRPC, -# wallet-to-validator. Tests live in the live-tests sub-workspace. +# One test per component: zebrad, lightwallet gRPC, wallet-to-validator +# (devtool). Tests live in the live-tests sub-workspace. ITESTS=(--manifest-path live-tests/Cargo.toml) -run_task "container-test (zcashd)" makers container-test \ - "${ITESTS[@]}" \ - -E "binary(wallet_to_validator) & test(=zcashd::connect_to_node_get_info)" - run_task "container-test (zebrad)" makers container-test \ "${ITESTS[@]}" \ -E "binary(wallet_to_validator) & \ @@ -145,7 +141,7 @@ run_task "container-test (lightwallet)" makers container-test \ run_task "container-test (wallet-to-validator)" makers container-test \ "${ITESTS[@]}" \ - -E "binary(wallet_to_validator) & test(=zcashd::sent_to::transparent)" + -E "binary(devtool) & test(=zebrad::fetch_service::receives_mining_reward)" if command -v jq &>/dev/null && command -v yq &>/dev/null; then run_task "validate-test-targets" makers validate-test-targets diff --git a/tools/test-runner/src/bin/container-test.rs b/tools/test-runner/src/bin/container-test.rs index eac6eb891..3ef23a077 100644 --- a/tools/test-runner/src/bin/container-test.rs +++ b/tools/test-runner/src/bin/container-test.rs @@ -2,7 +2,7 @@ //! //! Invoked from the `container-test` task (Makefile.toml) as //! `cargo run --bin container-test -- `. The container's entrypoint.sh sets -//! up the validator binaries (zcashd, zebrad, zcash-cli) by symlinking +//! up the validator binaries (zebrad, zcash-devtool) by symlinking //! `$TEST_BINARIES_DIR` into the expected location. //! //! Inputs from the environment (the Makefile `[env]` block exports the first @@ -14,9 +14,7 @@ //! TAG is computed here via tools/scripts/get-ci-image-tag.sh (it is a shell //! variable in the base-script pre-script, not exported, so we recompute it). //! -//! Feature selection (docs/adr/0005): `zcashd_support` is opt-in, not a default. -//! The run is always `--no-default-features` (the zcashd-off world CI builds); -//! passing `--with-zcashd` additionally enables `--features zcashd_support`. +//! The run is always `--no-default-features`, matching what CI builds. //! Any other arguments (e.g. `-p clientless`, `--test-threads 6`) pass straight //! through to `cargo nextest run`. //! @@ -50,28 +48,11 @@ fn main() -> Result<(), Box> { } let tag = String::from_utf8(tag_out.stdout)?.trim().to_string(); - // Pull `--with-zcashd` out of the forwarded args; everything else (e.g. - // `-p clientless`) passes through to `cargo nextest run`. - let mut with_zcashd = false; - let mut forwarded: Vec = Vec::new(); - for arg in env::args().skip(1) { - if arg == "--with-zcashd" { - with_zcashd = true; - } else { - forwarded.push(arg); - } - } + // Everything (e.g. `-p clientless`) passes through to `cargo nextest run`. + let forwarded: Vec = env::args().skip(1).collect(); - // Always build the no-zcashd world (`--no-default-features`, matching CI); - // `--with-zcashd` adds the opt-in feature back (docs/adr/0005). - let mut feature_args: Vec = vec!["--no-default-features".to_string()]; - if with_zcashd { - feature_args.push("--features".to_string()); - feature_args.push("zcashd_support".to_string()); - info("-- zcashd_support = ON (--features zcashd_support)"); - } else { - info("-- zcashd_support = OFF (--no-default-features)"); - } + // Always build with `--no-default-features` (matching CI). + let feature_args: Vec = vec!["--no-default-features".to_string()]; info(&format!("-- IMAGE = {image_name}")); info(&format!("-- TAG = {tag}")); diff --git a/tools/test-runner/src/bin/live-summary.rs b/tools/test-runner/src/bin/live-summary.rs index 3af1d56ed..fe692b810 100644 --- a/tools/test-runner/src/bin/live-summary.rs +++ b/tools/test-runner/src/bin/live-summary.rs @@ -12,9 +12,7 @@ //! partitions even when the first fails, so the summary reflects the whole //! suite. It then exits non-zero if either partition failed, so CI still //! catches it. -//! -//! `--with-zcashd` is forwarded as a flag to the child `makers` calls so the -//! zcashd-backed tests are included; otherwise nothing enables them. + #![forbid(unsafe_code)] use std::error::Error; @@ -54,15 +52,11 @@ impl Summary { /// Run one partition's `makers` task, streaming its combined output to our /// stdout while capturing it for parsing. Returns (exit_code, captured_output). -fn run_partition(task: &str, with_zcashd: bool) -> Result<(i32, String), Box> { +fn run_partition(task: &str) -> Result<(i32, String), Box> { // `bash -c '... 2>&1'` merges stderr into stdout so the single captured // stream carries the nextest summary line wherever nextest emits it. let mut cmd = Command::new("bash"); - // Forward `--with-zcashd` as an explicit flag (no implicit env var): the - // partition task passes it through to `container-test`, which adds - // `--features zcashd_support`. - let zcashd_flag = if with_zcashd { " --with-zcashd" } else { "" }; - cmd.arg("-c").arg(format!("makers {task}{zcashd_flag} 2>&1")); + cmd.arg("-c").arg(format!("makers {task} 2>&1")); let mut child = cmd.stdout(Stdio::piped()).spawn()?; let stdout = child @@ -169,7 +163,6 @@ fn print_row(label: &str, s: &Summary) { } fn main() -> Result<(), Box> { - let with_zcashd = std::env::args().any(|a| a == "--with-zcashd"); let set = if std::env::args().any(|a| a == "--all") { TestSet::All } else { @@ -179,17 +172,18 @@ fn main() -> Result<(), Box> { let packages = match set { TestSet::All => { println!(">>> all: running packages set"); - let (rc, log) = run_partition("container-test", with_zcashd)?; + let (rc, log) = run_partition("container-test")?; Some((rc, parse_summary(&log))) } TestSet::Live => None, }; + println!(">>> live: running clientless partition"); - let (cl_rc, cl_log) = run_partition("live-clientless", with_zcashd)?; + let (cl_rc, cl_log) = run_partition("live-clientless")?; println!(">>> live: running e2e partition"); - let (e2e_rc, e2e_log) = run_partition("live-e2e", with_zcashd)?; + let (e2e_rc, e2e_log) = run_partition("live-e2e")?; let cl = parse_summary(&cl_log); let e2e = parse_summary(&e2e_log);