From 277cdbeda73f86cb8f19b3e101391fa7cf62f622 Mon Sep 17 00:00:00 2001 From: Arya Date: Wed, 19 Feb 2025 19:38:17 -0500 Subject: [PATCH 01/10] Bumps ECC dep versions (using git sources) and updates their usage in Zebra --- Cargo.lock | 284 ++++++++++++------ Cargo.toml | 32 +- zebra-chain/Cargo.toml | 1 + .../src/primitives/zcash_primitives.rs | 6 +- 4 files changed, 229 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9095e4f1ee5..6b5c52db9c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "generic-array", ] @@ -372,9 +372,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bech32" -version = "0.9.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "bellman" @@ -448,16 +448,16 @@ dependencies = [ [[package]] name = "bip32" -version = "0.5.3" +version = "0.6.0-pre.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db40d3dfbeab4e031d78c844642fa0caa0b0db11ce1607ac9d2986dff1405c69" +checksum = "143f5327f23168716be068f8e1014ba2ea16a6c91e8777bc8927da7b51e1df1f" dependencies = [ "bs58", "hmac", "rand_core 0.6.4", - "ripemd", - "secp256k1", - "sha2", + "ripemd 0.2.0-pre.4", + "secp256k1 0.29.1", + "sha2 0.11.0-pre.4", "subtle", "zeroize", ] @@ -542,6 +542,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" +dependencies = [ + "hybrid-array", +] + [[package]] name = "bls12_381" version = "0.8.0" @@ -558,10 +567,9 @@ dependencies = [ [[package]] name = "bridgetree" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef977c7f8e75aa81fc589064c121ab8d32448b7939d34d58df479aa93e65ea5" +source = "git+https://github.com/zcash/incrementalmerkletree.git?rev=561a6dc29bbaaa32db7c81bbb5f98a3df7051643#561a6dc29bbaaa32db7c81bbb5f98a3df7051643" dependencies = [ - "incrementalmerkletree", + "incrementalmerkletree 0.7.1", ] [[package]] @@ -570,7 +578,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2", + "sha2 0.10.8", "tinyvec", ] @@ -770,7 +778,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "inout", "zeroize", ] @@ -1058,6 +1066,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-common" +version = "0.2.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" +dependencies = [ + "hybrid-array", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -1067,7 +1084,7 @@ dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest", + "digest 0.10.7", "fiat-crypto", "rustc_version", "serde", @@ -1157,8 +1174,18 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", - "crypto-common", + "block-buffer 0.10.4", + "crypto-common 0.1.6", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +dependencies = [ + "block-buffer 0.11.0-rc.3", + "crypto-common 0.2.0-rc.1", "subtle", ] @@ -1232,7 +1259,7 @@ dependencies = [ "hex", "rand_core 0.6.4", "serde", - "sha2", + "sha2 0.10.8", "zeroize", ] @@ -1290,6 +1317,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "equihash" +version = "0.2.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +dependencies = [ + "blake2b_simd", + "core2", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1319,8 +1355,7 @@ dependencies = [ [[package]] name = "f4jumble" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d42773cb15447644d170be20231a3268600e0c4cea8987d013b93ac973d3cf7" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "blake2b_simd", ] @@ -1797,11 +1832,11 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" -version = "0.12.1" +version = "0.13.0-pre.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" dependencies = [ - "digest", + "digest 0.11.0-pre.9", ] [[package]] @@ -1903,6 +1938,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hybrid-array" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +dependencies = [ + "typenum", +] + [[package]] name = "hyper" version = "1.6.0" @@ -2171,6 +2215,15 @@ dependencies = [ "either", ] +[[package]] +name = "incrementalmerkletree" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30821f91f0fa8660edca547918dc59812893b497d07c1144f326f07fdd94aba9" +dependencies = [ + "either", +] + [[package]] name = "indenter" version = "0.3.3" @@ -2774,9 +2827,9 @@ dependencies = [ [[package]] name = "nonempty" -version = "0.7.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" +checksum = "549e471b99ccaf2f89101bec68f4d244457d5a95a9c3d0672e9564124397741d" [[package]] name = "nu-ansi-term" @@ -2893,8 +2946,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchard" version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f7152474406422f572de163e0bc63b2126cdbfe17bc849efbbde36fcfe647e" +source = "git+https://github.com/zcash/orchard.git?rev=b1c22c07300db22239235d16dab096e23369948f#b1c22c07300db22239235d16dab096e23369948f" dependencies = [ "aes", "bitvec", @@ -2908,7 +2960,7 @@ dependencies = [ "halo2_poseidon", "halo2_proofs", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "lazy_static", "memuse", "nonempty", @@ -3085,7 +3137,7 @@ checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", - "sha2", + "sha2 0.10.8", ] [[package]] @@ -3633,8 +3685,7 @@ dependencies = [ [[package]] name = "redjubjub" version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a60db2c3bc9c6fd1e8631fee75abc008841d27144be744951d6b9b75f9b569c" +source = "git+https://github.com/ZcashFoundation/redjubjub?rev=eae848c5c14d9c795d000dd9f4c4762d1aee7ee1#eae848c5c14d9c795d000dd9f4c4762d1aee7ee1" dependencies = [ "rand_core 0.6.4", "reddsa", @@ -3783,7 +3834,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest", + "digest 0.10.7", +] + +[[package]] +name = "ripemd" +version = "0.2.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48cf93482ea998ad1302c42739bc73ab3adc574890c373ec89710e219357579" +dependencies = [ + "digest 0.11.0-pre.9", ] [[package]] @@ -3947,9 +4007,8 @@ dependencies = [ [[package]] name = "sapling-crypto" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfff8cfce16aeb38da50b8e2ed33c9018f30552beff2210c266662a021b17f38" +version = "0.4.0" +source = "git+https://github.com/zcash/sapling-crypto.git?rev=6ca338532912adcd82369220faeea31aab4720c5#6ca338532912adcd82369220faeea31aab4720c5" dependencies = [ "aes", "bellman", @@ -3957,13 +4016,14 @@ dependencies = [ "blake2b_simd", "blake2s_simd", "bls12_381", - "byteorder", + "core2", "document-features", "ff", "fpe", + "getset", "group", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "jubjub", "lazy_static", "memuse", @@ -3989,10 +4049,19 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "secp256k1-sys", + "secp256k1-sys 0.8.1", "serde", ] +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "secp256k1-sys 0.10.1", +] + [[package]] name = "secp256k1-sys" version = "0.8.1" @@ -4002,6 +4071,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -4223,7 +4301,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4234,7 +4312,18 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.11.0-pre.9", ] [[package]] @@ -4248,13 +4337,13 @@ dependencies = [ [[package]] name = "shardtree" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f2390975ebfe8838f9e861f7a588123d49a7a7a0a08568ea831d8ad53fc9b4" +checksum = "637e95dcd06bc1bb3f86ed9db1e1832a70125f32daae071ef37dcb7701b7d4fe" dependencies = [ "bitflags 2.8.0", "either", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "tracing", ] @@ -5188,7 +5277,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "subtle", ] @@ -5510,14 +5599,14 @@ dependencies = [ [[package]] name = "which" -version = "4.4.2" +version = "6.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "once_cell", "rustix", + "winsafe", ] [[package]] @@ -5691,6 +5780,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "wit-bindgen-rt" version = "0.33.0" @@ -5765,12 +5860,12 @@ dependencies = [ [[package]] name = "zcash_address" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff95eac82f71286a79c750e674550d64fb2b7aadaef7b89286b2917f645457d" +version = "0.6.2" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "bech32", "bs58", + "core2", "f4jumble", "zcash_encoding", "zcash_protocol", @@ -5778,9 +5873,8 @@ dependencies = [ [[package]] name = "zcash_client_backend" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbeeede366fdb642710d3c59fc2090489affd075f66db53ed11bb7138d2d0258" +version = "0.16.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "base64 0.22.1", "bech32", @@ -5790,7 +5884,7 @@ dependencies = [ "document-features", "group", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "memuse", "nom", "nonempty", @@ -5812,6 +5906,7 @@ dependencies = [ "zcash_note_encryption", "zcash_primitives", "zcash_protocol", + "zcash_transparent", "zip32", "zip321", ] @@ -5819,8 +5914,7 @@ dependencies = [ [[package]] name = "zcash_encoding" version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3654116ae23ab67dd1f849b01f8821a8a156f884807ff665eac109bf28306c4d" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "core2", "nonempty", @@ -5829,8 +5923,7 @@ dependencies = [ [[package]] name = "zcash_history" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fde17bf53792f9c756b313730da14880257d7661b5bfc69d0571c3a7c11a76d" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "blake2b_simd", "byteorder", @@ -5839,14 +5932,14 @@ dependencies = [ [[package]] name = "zcash_keys" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8162c94957f1e379b8e2fb30f97b95cfa93ac9c6bc02895946ca6392d1abb81" +version = "0.6.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "bech32", "blake2b_simd", "bls12_381", "bs58", + "core2", "document-features", "group", "memuse", @@ -5858,8 +5951,8 @@ dependencies = [ "tracing", "zcash_address", "zcash_encoding", - "zcash_primitives", "zcash_protocol", + "zcash_transparent", "zip32", ] @@ -5878,22 +5971,21 @@ dependencies = [ [[package]] name = "zcash_primitives" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab47d526d7fd6f88b3a2854ad81b54757a80c2aeadd1d8b06f690556af9743c" +version = "0.21.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ - "aes", "bip32", "blake2b_simd", "bs58", - "byteorder", + "core2", "document-features", - "equihash", + "equihash 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749)", "ff", "fpe", + "getset", "group", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "jubjub", "memuse", "nonempty", @@ -5901,10 +5993,10 @@ dependencies = [ "rand 0.8.5", "rand_core 0.6.4", "redjubjub", - "ripemd", + "ripemd 0.1.3", "sapling-crypto", - "secp256k1", - "sha2", + "secp256k1 0.29.1", + "sha2 0.10.8", "subtle", "tracing", "zcash_address", @@ -5912,14 +6004,14 @@ dependencies = [ "zcash_note_encryption", "zcash_protocol", "zcash_spec", + "zcash_transparent", "zip32", ] [[package]] name = "zcash_proofs" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daba607872e60d91a09248d8e1ea3d6801c819fb80d67016d9de02d81323c10d" +version = "0.21.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "bellman", "blake2b_simd", @@ -5940,11 +6032,12 @@ dependencies = [ [[package]] name = "zcash_protocol" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bc22b9155b2c7eb20105cd06de170d188c1bc86489b92aa3fda7b8da8d96acf" +version = "0.4.3" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ + "core2", "document-features", + "hex", "memuse", ] @@ -5967,6 +6060,29 @@ dependencies = [ "blake2b_simd", ] +[[package]] +name = "zcash_transparent" +version = "0.1.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +dependencies = [ + "bip32", + "blake2b_simd", + "bs58", + "core2", + "document-features", + "getset", + "hex", + "ripemd 0.1.3", + "secp256k1 0.29.1", + "sha2 0.10.8", + "subtle", + "zcash_address", + "zcash_encoding", + "zcash_protocol", + "zcash_spec", + "zip32", +] + [[package]] name = "zebra-chain" version = "1.0.0-beta.45" @@ -5984,13 +6100,13 @@ dependencies = [ "criterion", "dirs", "ed25519-zebra", - "equihash", + "equihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures", "group", "halo2_proofs", "hex", "humantime", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "itertools 0.14.0", "jubjub", "lazy_static", @@ -6005,14 +6121,14 @@ dependencies = [ "rayon", "reddsa", "redjubjub", - "ripemd", + "ripemd 0.1.3", "sapling-crypto", - "secp256k1", + "secp256k1 0.27.0", "serde", "serde-big-array", "serde_json", "serde_with", - "sha2", + "sha2 0.10.8", "spandoc", "static_assertions", "tempfile", @@ -6029,6 +6145,7 @@ dependencies = [ "zcash_note_encryption", "zcash_primitives", "zcash_protocol", + "zcash_transparent", "zebra-test", ] @@ -6530,8 +6647,7 @@ dependencies = [ [[package]] name = "zip321" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3e613defb0940acef1f54774b51c7f48f2fa705613dd800870dc69f35cd2ea" +source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" dependencies = [ "base64 0.22.1", "nom", diff --git a/Cargo.toml b/Cargo.toml index 6aef936bc39..02833aabc49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,16 +22,17 @@ resolver = "2" # `cargo release` settings [workspace.dependencies] -incrementalmerkletree = { version = "0.7.1", features = ["legacy-api"] } -orchard = "0.10.0" -sapling-crypto = "0.3.0" +incrementalmerkletree = { version = "0.8.2", features = ["legacy-api"] } +orchard = "0.10.1" +sapling-crypto = "0.4.0" zcash_address = "0.6.0" -zcash_client_backend = "0.14.0" +zcash_client_backend = "0.16.0" zcash_encoding = "0.2.2" zcash_history = "0.4.0" -zcash_keys = "0.4.0" -zcash_primitives = "0.19.0" -zcash_proofs = "0.19.0" +zcash_keys = "0.6.0" +zcash_primitives = "0.21.0" +zcash_proofs = "0.21.0" +zcash_transparent = "0.1.0" zcash_protocol = "0.4.0" abscissa_core = "0.7.0" atty = "0.2.14" @@ -152,6 +153,23 @@ x25519-dalek = "2.0.1" zcash_note_encryption = "0.4.1" zcash_script = "0.2.0" +# We can remove this patches after we get out of 2.0 release candidate and upgrade the ECC dependencies above. +# This revisions are at the commit just before setting mainnet activation heights. +[patch.crates-io] +zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_client_backend = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_encoding = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_transparent = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_keys = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } +orchard = { git = "https://github.com/zcash/orchard.git", rev = "b1c22c07300db22239235d16dab096e23369948f" } +redjubjub = { git = "https://github.com/ZcashFoundation/redjubjub", rev = "eae848c5c14d9c795d000dd9f4c4762d1aee7ee1" } +sapling-crypto = { git = "https://github.com/zcash/sapling-crypto.git", rev = "6ca338532912adcd82369220faeea31aab4720c5" } +bridgetree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "561a6dc29bbaaa32db7c81bbb5f98a3df7051643" } + [workspace.metadata.release] # We always do releases from the main branch diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index fb4833027d3..fc25c8b329d 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -103,6 +103,7 @@ zcash_primitives = { workspace = true, features = ["transparent-inputs"] } sapling-crypto.workspace = true zcash_protocol.workspace = true zcash_address.workspace = true +zcash_transparent.workspace = true # Time chrono = { workspace = true, features = ["clock", "std", "serde"] } diff --git a/zebra-chain/src/primitives/zcash_primitives.rs b/zebra-chain/src/primitives/zcash_primitives.rs index 6dbff2df09c..45d6ba96856 100644 --- a/zebra-chain/src/primitives/zcash_primitives.rs +++ b/zebra-chain/src/primitives/zcash_primitives.rs @@ -29,7 +29,7 @@ impl zp_tx::components::transparent::Authorization for TransparentAuth<'_> { // In this block we convert our Output to a librustzcash to TxOut. // (We could do the serialize/deserialize route but it's simple enough to convert manually) -impl zp_tx::sighash::TransparentAuthorizingContext for TransparentAuth<'_> { +impl zcash_transparent::sighash::TransparentAuthorizingContext for TransparentAuth<'_> { fn input_amounts(&self) -> Vec { self.all_prev_outputs .iter() @@ -293,7 +293,7 @@ pub(crate) fn sighash( let output = &precomputed_tx_data.all_previous_outputs[input_index]; lock_script = output.lock_script.clone().into(); unlock_script = zcash_primitives::legacy::Script(script_code); - zp_tx::sighash::SignableInput::Transparent { + zp_tx::sighash::SignableInput::Transparent(zcash_transparent::sighash::SignableInput { hash_type: hash_type.bits() as _, index: input_index, script_code: &unlock_script, @@ -302,7 +302,7 @@ pub(crate) fn sighash( .value .try_into() .expect("amount was previously validated"), - } + }) } None => zp_tx::sighash::SignableInput::Shielded, }; From 4606c9a64d9fac71c7bc311232877161d18a4f46 Mon Sep 17 00:00:00 2001 From: Arya Date: Wed, 19 Feb 2025 20:36:58 -0500 Subject: [PATCH 02/10] removes dependency on bridgetree and imports types from incrementalmerkletree directly instead --- Cargo.lock | 30 ++++--------------- Cargo.toml | 2 -- zebra-chain/Cargo.toml | 1 - zebra-chain/src/orchard/tree.rs | 11 ++++--- .../src/primitives/zcash_primitives.rs | 14 ++++----- zebra-chain/src/sapling/tree.rs | 10 ++++--- zebra-chain/src/sprout/tree.rs | 6 ++-- 7 files changed, 27 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b5c52db9c8..1a9c0d24af1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -564,14 +564,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "bridgetree" -version = "0.6.0" -source = "git+https://github.com/zcash/incrementalmerkletree.git?rev=561a6dc29bbaaa32db7c81bbb5f98a3df7051643#561a6dc29bbaaa32db7c81bbb5f98a3df7051643" -dependencies = [ - "incrementalmerkletree 0.7.1", -] - [[package]] name = "bs58" version = "0.5.1" @@ -2206,15 +2198,6 @@ dependencies = [ "syn 2.0.96", ] -[[package]] -name = "incrementalmerkletree" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216c71634ac6f6ed13c2102d64354c0a04dcbdc30e31692c5972d3974d8b6d97" -dependencies = [ - "either", -] - [[package]] name = "incrementalmerkletree" version = "0.8.2" @@ -2960,7 +2943,7 @@ dependencies = [ "halo2_poseidon", "halo2_proofs", "hex", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "lazy_static", "memuse", "nonempty", @@ -4023,7 +4006,7 @@ dependencies = [ "getset", "group", "hex", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "jubjub", "lazy_static", "memuse", @@ -4343,7 +4326,7 @@ checksum = "637e95dcd06bc1bb3f86ed9db1e1832a70125f32daae071ef37dcb7701b7d4fe" dependencies = [ "bitflags 2.8.0", "either", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "tracing", ] @@ -5884,7 +5867,7 @@ dependencies = [ "document-features", "group", "hex", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "memuse", "nom", "nonempty", @@ -5985,7 +5968,7 @@ dependencies = [ "getset", "group", "hex", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "jubjub", "memuse", "nonempty", @@ -6092,7 +6075,6 @@ dependencies = [ "bitvec", "blake2b_simd", "blake2s_simd", - "bridgetree", "bs58", "byteorder", "chrono", @@ -6106,7 +6088,7 @@ dependencies = [ "halo2_proofs", "hex", "humantime", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "itertools 0.14.0", "jubjub", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 02833aabc49..f7b29a2f7ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,6 @@ bitvec = "1.0.1" blake2b_simd = "1.0.2" blake2s_simd = "1.0.2" bls12_381 = "0.8.0" -bridgetree = "0.6.0" bs58 = "0.5.1" byteorder = "1.5.0" bytes = "1.9.0" @@ -168,7 +167,6 @@ zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "7b6 orchard = { git = "https://github.com/zcash/orchard.git", rev = "b1c22c07300db22239235d16dab096e23369948f" } redjubjub = { git = "https://github.com/ZcashFoundation/redjubjub", rev = "eae848c5c14d9c795d000dd9f4c4762d1aee7ee1" } sapling-crypto = { git = "https://github.com/zcash/sapling-crypto.git", rev = "6ca338532912adcd82369220faeea31aab4720c5" } -bridgetree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "561a6dc29bbaaa32db7c81bbb5f98a3df7051643" } [workspace.metadata.release] diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index fc25c8b329d..579b3304b45 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -68,7 +68,6 @@ bitflags = { workspace = true } bitflags-serde-legacy = { workspace = true } blake2b_simd = { workspace = true } blake2s_simd = { workspace = true } -bridgetree = { workspace = true } bs58 = { workspace = true, features = ["check"] } byteorder = { workspace = true } diff --git a/zebra-chain/src/orchard/tree.rs b/zebra-chain/src/orchard/tree.rs index b3433a99c6d..81dd3f8e089 100644 --- a/zebra-chain/src/orchard/tree.rs +++ b/zebra-chain/src/orchard/tree.rs @@ -18,10 +18,9 @@ use std::{ }; use bitvec::prelude::*; -use bridgetree::NonEmptyFrontier; use halo2::pasta::{group::ff::PrimeField, pallas}; use hex::ToHex; -use incrementalmerkletree::Hashable; +use incrementalmerkletree::{frontier::NonEmptyFrontier, Hashable}; use lazy_static::lazy_static; use thiserror::Error; use zcash_primitives::merkle_tree::HashSer; @@ -248,7 +247,7 @@ impl ToHex for Node { /// [`z_gettreestate`][2] RPC requires [`CommitmentTree`][3]s. Implementing /// [`HashSer`] for [`Node`]s allows the conversion. /// -/// [1]: bridgetree::Frontier +/// [1]: incrementalmerkletree::frontier::Frontier /// [2]: https://zcash.github.io/rpc/z_gettreestate.html /// [3]: incrementalmerkletree::frontier::CommitmentTree impl HashSer for Node { @@ -348,7 +347,7 @@ pub struct NoteCommitmentTree { /// /// /// Note: MerkleDepth^Orchard = MERKLE_DEPTH = 32. - inner: bridgetree::Frontier, + inner: incrementalmerkletree::frontier::Frontier, /// A cached root of the tree. /// @@ -637,7 +636,7 @@ impl NoteCommitmentTree { /// Serializes [`Self`] to a format compatible with `zcashd`'s RPCs. pub fn to_rpc_bytes(&self) -> Vec { - // Convert the tree from [`Frontier`](bridgetree::Frontier) to + // Convert the tree from [`Frontier`](incrementalmerkletree::frontier::Frontier) to // [`CommitmentTree`](merkle_tree::CommitmentTree). let tree = incrementalmerkletree::frontier::CommitmentTree::from_frontier(&self.inner); @@ -665,7 +664,7 @@ impl Clone for NoteCommitmentTree { impl Default for NoteCommitmentTree { fn default() -> Self { Self { - inner: bridgetree::Frontier::empty(), + inner: incrementalmerkletree::frontier::Frontier::empty(), cached_root: Default::default(), } } diff --git a/zebra-chain/src/primitives/zcash_primitives.rs b/zebra-chain/src/primitives/zcash_primitives.rs index 45d6ba96856..8fb610974ab 100644 --- a/zebra-chain/src/primitives/zcash_primitives.rs +++ b/zebra-chain/src/primitives/zcash_primitives.rs @@ -30,7 +30,7 @@ impl zp_tx::components::transparent::Authorization for TransparentAuth<'_> { // In this block we convert our Output to a librustzcash to TxOut. // (We could do the serialize/deserialize route but it's simple enough to convert manually) impl zcash_transparent::sighash::TransparentAuthorizingContext for TransparentAuth<'_> { - fn input_amounts(&self) -> Vec { + fn input_amounts(&self) -> Vec { self.all_prev_outputs .iter() .map(|prevout| { @@ -151,7 +151,7 @@ impl<'a> zp_tx::Authorization for PrecomputedAuth<'a> { // End of (mostly) copied code /// Convert a Zebra transparent::Output into a librustzcash one. -impl TryFrom<&transparent::Output> for zp_tx::components::TxOut { +impl TryFrom<&transparent::Output> for zcash_transparent::bundle::TxOut { type Error = io::Error; #[allow(clippy::unwrap_in_result)] @@ -160,12 +160,12 @@ impl TryFrom<&transparent::Output> for zp_tx::components::TxOut { .zcash_serialize_to_vec() .expect("zcash_primitives and Zebra transparent output formats must be compatible"); - zp_tx::components::TxOut::read(&mut serialized_output_bytes.as_slice()) + zcash_transparent::bundle::TxOut::read(&mut serialized_output_bytes.as_slice()) } } /// Convert a Zebra transparent::Output into a librustzcash one. -impl TryFrom for zp_tx::components::TxOut { +impl TryFrom for zcash_transparent::bundle::TxOut { type Error = io::Error; // The borrow is actually needed to use TryFrom<&transparent::Output> @@ -176,11 +176,11 @@ impl TryFrom for zp_tx::components::TxOut { } /// Convert a Zebra non-negative Amount into a librustzcash one. -impl TryFrom> for zp_tx::components::amount::NonNegativeAmount { +impl TryFrom> for zcash_protocol::value::Zatoshis { type Error = BalanceError; fn try_from(amount: Amount) -> Result { - zp_tx::components::amount::NonNegativeAmount::from_nonnegative_i64(amount.into()) + zcash_protocol::value::Zatoshis::from_nonnegative_i64(amount.into()) } } @@ -344,7 +344,7 @@ pub(crate) fn transparent_output_address( output: &transparent::Output, network: &Network, ) -> Option { - let tx_out = zp_tx::components::TxOut::try_from(output) + let tx_out = zcash_transparent::bundle::TxOut::try_from(output) .expect("zcash_primitives and Zebra transparent output formats must be compatible"); let alt_addr = tx_out.recipient_address(); diff --git a/zebra-chain/src/sapling/tree.rs b/zebra-chain/src/sapling/tree.rs index a532f7dfcda..f1320be32f8 100644 --- a/zebra-chain/src/sapling/tree.rs +++ b/zebra-chain/src/sapling/tree.rs @@ -18,9 +18,11 @@ use std::{ }; use bitvec::prelude::*; -use bridgetree::NonEmptyFrontier; use hex::ToHex; -use incrementalmerkletree::{frontier::Frontier, Hashable}; +use incrementalmerkletree::{ + frontier::{Frontier, NonEmptyFrontier}, + Hashable, +}; use lazy_static::lazy_static; use thiserror::Error; @@ -637,7 +639,7 @@ impl NoteCommitmentTree { /// Serializes [`Self`] to a format matching `zcashd`'s RPCs. pub fn to_rpc_bytes(&self) -> Vec { - // Convert the tree from [`Frontier`](bridgetree::Frontier) to + // Convert the tree from [`Frontier`](incrementalmerkletree::frontier::Frontier) to // [`CommitmentTree`](merkle_tree::CommitmentTree). let tree = incrementalmerkletree::frontier::CommitmentTree::from_frontier(&self.inner); @@ -666,7 +668,7 @@ impl Clone for NoteCommitmentTree { impl Default for NoteCommitmentTree { fn default() -> Self { Self { - inner: bridgetree::Frontier::empty(), + inner: incrementalmerkletree::frontier::Frontier::empty(), cached_root: Default::default(), } } diff --git a/zebra-chain/src/sprout/tree.rs b/zebra-chain/src/sprout/tree.rs index c5ad74a7d6e..d6bec56d134 100644 --- a/zebra-chain/src/sprout/tree.rs +++ b/zebra-chain/src/sprout/tree.rs @@ -197,7 +197,7 @@ pub enum NoteCommitmentTreeError { /// job of this tree to protect against double-spending, as it is append-only; double-spending /// is prevented by maintaining the [nullifier set] for each shielded pool. /// -/// Internally this wraps [`bridgetree::Frontier`], so that we can maintain and increment +/// Internally this wraps [`incrementalmerkletree::frontier::Frontier`], so that we can maintain and increment /// the full tree with only the minimal amount of non-empty nodes/leaves required. /// /// Note that the default value of the [`Root`] type is `[0, 0, 0, 0]`. However, this value differs @@ -210,9 +210,9 @@ pub enum NoteCommitmentTreeError { #[serde(into = "LegacyNoteCommitmentTree")] #[serde(from = "LegacyNoteCommitmentTree")] pub struct NoteCommitmentTree { - /// The tree represented as a [`bridgetree::Frontier`]. + /// The tree represented as a [`incrementalmerkletree::frontier::Frontier`]. /// - /// A [`bridgetree::Frontier`] is a subset of the tree that allows to fully specify it. It + /// A [`incrementalmerkletree::frontier::Frontier`] is a subset of the tree that allows to fully specify it. It /// consists of nodes along the rightmost (newer) branch of the tree that /// has non-empty nodes. Upper (near root) empty nodes of the branch are not /// stored. From bda10abfacefa198355ae8c45782c340559f30ed Mon Sep 17 00:00:00 2001 From: ar Date: Tue, 25 Feb 2025 15:44:18 -0500 Subject: [PATCH 03/10] Removes unused patches --- Cargo.lock | 225 +++++++++++++++++++---------------------------------- Cargo.toml | 16 ---- 2 files changed, 82 insertions(+), 159 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a9c0d24af1..0753a0ef902 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ - "crypto-common 0.1.6", + "crypto-common", "generic-array", ] @@ -448,16 +448,16 @@ dependencies = [ [[package]] name = "bip32" -version = "0.6.0-pre.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143f5327f23168716be068f8e1014ba2ea16a6c91e8777bc8927da7b51e1df1f" +checksum = "db40d3dfbeab4e031d78c844642fa0caa0b0db11ce1607ac9d2986dff1405c69" dependencies = [ "bs58", "hmac", "rand_core 0.6.4", - "ripemd 0.2.0-pre.4", - "secp256k1 0.29.1", - "sha2 0.11.0-pre.4", + "ripemd", + "secp256k1", + "sha2", "subtle", "zeroize", ] @@ -542,15 +542,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-buffer" -version = "0.11.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd016a0ddc7cb13661bf5576073ce07330a693f8608a1320b4e20561cc12cdc" -dependencies = [ - "hybrid-array", -] - [[package]] name = "bls12_381" version = "0.8.0" @@ -570,7 +561,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2 0.10.8", + "sha2", "tinyvec", ] @@ -770,7 +761,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "crypto-common 0.1.6", + "crypto-common", "inout", "zeroize", ] @@ -1058,15 +1049,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-common" -version = "0.2.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" -dependencies = [ - "hybrid-array", -] - [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -1076,7 +1058,7 @@ dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest 0.10.7", + "digest", "fiat-crypto", "rustc_version", "serde", @@ -1166,18 +1148,8 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", - "crypto-common 0.1.6", -] - -[[package]] -name = "digest" -version = "0.11.0-pre.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" -dependencies = [ - "block-buffer 0.11.0-rc.3", - "crypto-common 0.2.0-rc.1", + "block-buffer", + "crypto-common", "subtle", ] @@ -1251,7 +1223,7 @@ dependencies = [ "hex", "rand_core 0.6.4", "serde", - "sha2 0.10.8", + "sha2", "zeroize", ] @@ -1309,15 +1281,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "equihash" -version = "0.2.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" -dependencies = [ - "blake2b_simd", - "core2", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1347,7 +1310,8 @@ dependencies = [ [[package]] name = "f4jumble" version = "0.1.1" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d42773cb15447644d170be20231a3268600e0c4cea8987d013b93ac973d3cf7" dependencies = [ "blake2b_simd", ] @@ -1824,11 +1788,11 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" -version = "0.13.0-pre.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.11.0-pre.9", + "digest", ] [[package]] @@ -1930,15 +1894,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hybrid-array" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" -dependencies = [ - "typenum", -] - [[package]] name = "hyper" version = "1.6.0" @@ -2198,6 +2153,15 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "incrementalmerkletree" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216c71634ac6f6ed13c2102d64354c0a04dcbdc30e31692c5972d3974d8b6d97" +dependencies = [ + "either", +] + [[package]] name = "incrementalmerkletree" version = "0.8.2" @@ -2810,9 +2774,9 @@ dependencies = [ [[package]] name = "nonempty" -version = "0.11.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549e471b99ccaf2f89101bec68f4d244457d5a95a9c3d0672e9564124397741d" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" [[package]] name = "nu-ansi-term" @@ -2929,7 +2893,8 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchard" version = "0.10.1" -source = "git+https://github.com/zcash/orchard.git?rev=b1c22c07300db22239235d16dab096e23369948f#b1c22c07300db22239235d16dab096e23369948f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f7152474406422f572de163e0bc63b2126cdbfe17bc849efbbde36fcfe647e" dependencies = [ "aes", "bitvec", @@ -2943,7 +2908,7 @@ dependencies = [ "halo2_poseidon", "halo2_proofs", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.7.1", "lazy_static", "memuse", "nonempty", @@ -3120,7 +3085,7 @@ checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", - "sha2 0.10.8", + "sha2", ] [[package]] @@ -3668,7 +3633,8 @@ dependencies = [ [[package]] name = "redjubjub" version = "0.7.0" -source = "git+https://github.com/ZcashFoundation/redjubjub?rev=eae848c5c14d9c795d000dd9f4c4762d1aee7ee1#eae848c5c14d9c795d000dd9f4c4762d1aee7ee1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a60db2c3bc9c6fd1e8631fee75abc008841d27144be744951d6b9b75f9b569c" dependencies = [ "rand_core 0.6.4", "reddsa", @@ -3817,16 +3783,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "ripemd" -version = "0.2.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48cf93482ea998ad1302c42739bc73ab3adc574890c373ec89710e219357579" -dependencies = [ - "digest 0.11.0-pre.9", + "digest", ] [[package]] @@ -3991,7 +3948,8 @@ dependencies = [ [[package]] name = "sapling-crypto" version = "0.4.0" -source = "git+https://github.com/zcash/sapling-crypto.git?rev=6ca338532912adcd82369220faeea31aab4720c5#6ca338532912adcd82369220faeea31aab4720c5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c2acdbbab83d554fc2dceea5f7d6d3da71e57adb18a6c80b8901bd0eee54b0" dependencies = [ "aes", "bellman", @@ -3999,14 +3957,14 @@ dependencies = [ "blake2b_simd", "blake2s_simd", "bls12_381", - "core2", + "byteorder", "document-features", "ff", "fpe", "getset", "group", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.7.1", "jubjub", "lazy_static", "memuse", @@ -4032,19 +3990,10 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "secp256k1-sys 0.8.1", + "secp256k1-sys", "serde", ] -[[package]] -name = "secp256k1" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" -dependencies = [ - "secp256k1-sys 0.10.1", -] - [[package]] name = "secp256k1-sys" version = "0.8.1" @@ -4054,15 +4003,6 @@ dependencies = [ "cc", ] -[[package]] -name = "secp256k1-sys" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" -dependencies = [ - "cc", -] - [[package]] name = "secrecy" version = "0.8.0" @@ -4284,7 +4224,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -4295,18 +4235,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.11.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.11.0-pre.9", + "digest", ] [[package]] @@ -4320,13 +4249,13 @@ dependencies = [ [[package]] name = "shardtree" -version = "0.6.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637e95dcd06bc1bb3f86ed9db1e1832a70125f32daae071ef37dcb7701b7d4fe" +checksum = "b5f2390975ebfe8838f9e861f7a588123d49a7a7a0a08568ea831d8ad53fc9b4" dependencies = [ "bitflags 2.8.0", "either", - "incrementalmerkletree", + "incrementalmerkletree 0.7.1", "tracing", ] @@ -5260,7 +5189,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "crypto-common 0.1.6", + "crypto-common", "subtle", ] @@ -5844,7 +5773,8 @@ dependencies = [ [[package]] name = "zcash_address" version = "0.6.2" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b955fe87f2d9052e3729bdbeb0e94975355f4fe39f7d26aea9457bec6a0bb55" dependencies = [ "bech32", "bs58", @@ -5857,7 +5787,8 @@ dependencies = [ [[package]] name = "zcash_client_backend" version = "0.16.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a187ad05cdfe13707c07e6aedca8026b34921d081decfd0b43aac1efd438a7" dependencies = [ "base64 0.22.1", "bech32", @@ -5867,7 +5798,7 @@ dependencies = [ "document-features", "group", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.7.1", "memuse", "nom", "nonempty", @@ -5889,7 +5820,6 @@ dependencies = [ "zcash_note_encryption", "zcash_primitives", "zcash_protocol", - "zcash_transparent", "zip32", "zip321", ] @@ -5897,7 +5827,8 @@ dependencies = [ [[package]] name = "zcash_encoding" version = "0.2.2" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3654116ae23ab67dd1f849b01f8821a8a156f884807ff665eac109bf28306c4d" dependencies = [ "core2", "nonempty", @@ -5906,7 +5837,8 @@ dependencies = [ [[package]] name = "zcash_history" version = "0.4.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fde17bf53792f9c756b313730da14880257d7661b5bfc69d0571c3a7c11a76d" dependencies = [ "blake2b_simd", "byteorder", @@ -5916,7 +5848,8 @@ dependencies = [ [[package]] name = "zcash_keys" version = "0.6.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ad3cf576c6e6094cd03f446fcb83ad241ec315a088593cd50940f135cb03ce1" dependencies = [ "bech32", "blake2b_simd", @@ -5955,20 +5888,22 @@ dependencies = [ [[package]] name = "zcash_primitives" version = "0.21.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b45f3ca3a9df34fcdbf036c2c814417bb417bde742812abc09d744bb3d7ed72" dependencies = [ + "aes", "bip32", "blake2b_simd", "bs58", - "core2", + "byteorder", "document-features", - "equihash 0.2.0 (git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749)", + "equihash", "ff", "fpe", "getset", "group", "hex", - "incrementalmerkletree", + "incrementalmerkletree 0.7.1", "jubjub", "memuse", "nonempty", @@ -5976,10 +5911,10 @@ dependencies = [ "rand 0.8.5", "rand_core 0.6.4", "redjubjub", - "ripemd 0.1.3", + "ripemd", "sapling-crypto", - "secp256k1 0.29.1", - "sha2 0.10.8", + "secp256k1", + "sha2", "subtle", "tracing", "zcash_address", @@ -5994,7 +5929,8 @@ dependencies = [ [[package]] name = "zcash_proofs" version = "0.21.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5826910c516675eca1f34b3557e159f4e35a4a1711b39fa4f01fb0adb9a9c24" dependencies = [ "bellman", "blake2b_simd", @@ -6016,7 +5952,8 @@ dependencies = [ [[package]] name = "zcash_protocol" version = "0.4.3" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cb36b15b5a1be70b30c32ce40372dead6561df8a467e297f96b892873a63a2" dependencies = [ "core2", "document-features", @@ -6046,7 +5983,8 @@ dependencies = [ [[package]] name = "zcash_transparent" version = "0.1.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed0512e8e02af804e852fbbc4bd5db35a9037bc253d2ce396506293a6e7dd745" dependencies = [ "bip32", "blake2b_simd", @@ -6055,9 +5993,9 @@ dependencies = [ "document-features", "getset", "hex", - "ripemd 0.1.3", - "secp256k1 0.29.1", - "sha2 0.10.8", + "ripemd", + "secp256k1", + "sha2", "subtle", "zcash_address", "zcash_encoding", @@ -6082,13 +6020,13 @@ dependencies = [ "criterion", "dirs", "ed25519-zebra", - "equihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "equihash", "futures", "group", "halo2_proofs", "hex", "humantime", - "incrementalmerkletree", + "incrementalmerkletree 0.8.2", "itertools 0.14.0", "jubjub", "lazy_static", @@ -6103,14 +6041,14 @@ dependencies = [ "rayon", "reddsa", "redjubjub", - "ripemd 0.1.3", + "ripemd", "sapling-crypto", - "secp256k1 0.27.0", + "secp256k1", "serde", "serde-big-array", "serde_json", "serde_with", - "sha2 0.10.8", + "sha2", "spandoc", "static_assertions", "tempfile", @@ -6629,7 +6567,8 @@ dependencies = [ [[package]] name = "zip321" version = "0.2.0" -source = "git+https://github.com/zcash/librustzcash.git?rev=7b61fe5025374f7d58d396e449d2b66e3340b749#7b61fe5025374f7d58d396e449d2b66e3340b749" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3e613defb0940acef1f54774b51c7f48f2fa705613dd800870dc69f35cd2ea" dependencies = [ "base64 0.22.1", "nom", diff --git a/Cargo.toml b/Cargo.toml index f7b29a2f7ed..a6581507ef2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,22 +152,6 @@ x25519-dalek = "2.0.1" zcash_note_encryption = "0.4.1" zcash_script = "0.2.0" -# We can remove this patches after we get out of 2.0 release candidate and upgrade the ECC dependencies above. -# This revisions are at the commit just before setting mainnet activation heights. -[patch.crates-io] -zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_client_backend = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_encoding = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_history = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_transparent = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_keys = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_proofs = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "7b61fe5025374f7d58d396e449d2b66e3340b749" } -orchard = { git = "https://github.com/zcash/orchard.git", rev = "b1c22c07300db22239235d16dab096e23369948f" } -redjubjub = { git = "https://github.com/ZcashFoundation/redjubjub", rev = "eae848c5c14d9c795d000dd9f4c4762d1aee7ee1" } -sapling-crypto = { git = "https://github.com/zcash/sapling-crypto.git", rev = "6ca338532912adcd82369220faeea31aab4720c5" } - [workspace.metadata.release] # We always do releases from the main branch From 3e2cb0a760a17b8478013f28c1b255e9caa71c81 Mon Sep 17 00:00:00 2001 From: ar Date: Tue, 25 Feb 2025 18:29:52 -0500 Subject: [PATCH 04/10] bumps ECC dep versions and replaces Zebra's usage of the now-deprecated API. --- Cargo.lock | 261 ++++++++++++------ Cargo.toml | 24 +- zebra-chain/src/parameters/network.rs | 2 +- .../src/parameters/network/tests/vectors.rs | 3 +- zebra-chain/src/primitives/address.rs | 29 +- .../src/primitives/viewing_key/sapling.rs | 2 +- .../src/primitives/zcash_primitives.rs | 22 +- 7 files changed, 220 insertions(+), 123 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0753a0ef902..7c389076e99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "generic-array", ] @@ -448,16 +448,16 @@ dependencies = [ [[package]] name = "bip32" -version = "0.5.3" +version = "0.6.0-pre.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db40d3dfbeab4e031d78c844642fa0caa0b0db11ce1607ac9d2986dff1405c69" +checksum = "143f5327f23168716be068f8e1014ba2ea16a6c91e8777bc8927da7b51e1df1f" dependencies = [ "bs58", "hmac", "rand_core 0.6.4", - "ripemd", - "secp256k1", - "sha2", + "ripemd 0.2.0-pre.4", + "secp256k1 0.29.1", + "sha2 0.11.0-pre.4", "subtle", "zeroize", ] @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" dependencies = [ "arrayref", "arrayvec", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "e90f7deecfac93095eb874a40febd69427776e24e1bd7f87f33ac62d6f0174df" dependencies = [ "arrayref", "arrayvec", @@ -542,6 +542,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.11.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a229bfd78e4827c91b9b95784f69492c1b77c1ab75a45a8a037b139215086f94" +dependencies = [ + "hybrid-array", +] + [[package]] name = "bls12_381" version = "0.8.0" @@ -561,7 +570,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2", + "sha2 0.10.8", "tinyvec", ] @@ -761,7 +770,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "inout", "zeroize", ] @@ -1049,6 +1058,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-common" +version = "0.2.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170d71b5b14dec99db7739f6fc7d6ec2db80b78c3acb77db48392ccc3d8a9ea0" +dependencies = [ + "hybrid-array", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -1058,7 +1076,7 @@ dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest", + "digest 0.10.7", "fiat-crypto", "rustc_version", "serde", @@ -1148,8 +1166,18 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", - "crypto-common", + "block-buffer 0.10.4", + "crypto-common 0.1.6", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" +dependencies = [ + "block-buffer 0.11.0-rc.4", + "crypto-common 0.2.0-rc.2", "subtle", ] @@ -1223,7 +1251,7 @@ dependencies = [ "hex", "rand_core 0.6.4", "serde", - "sha2", + "sha2 0.10.8", "zeroize", ] @@ -1788,11 +1816,11 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hmac" -version = "0.12.1" +version = "0.13.0-pre.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "e4b1fb14e4df79f9406b434b60acef9f45c26c50062cccf1346c6103b8c47d58" dependencies = [ - "digest", + "digest 0.11.0-pre.9", ] [[package]] @@ -1894,6 +1922,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hybrid-array" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dab50e193aebe510fe0e40230145820e02f48dae0cf339ea4204e6e708ff7bd" +dependencies = [ + "typenum", +] + [[package]] name = "hyper" version = "1.6.0" @@ -2155,20 +2192,24 @@ dependencies = [ [[package]] name = "incrementalmerkletree" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216c71634ac6f6ed13c2102d64354c0a04dcbdc30e31692c5972d3974d8b6d97" +checksum = "30821f91f0fa8660edca547918dc59812893b497d07c1144f326f07fdd94aba9" dependencies = [ "either", + "proptest", + "rand 0.8.5", + "rand_core 0.6.4", ] [[package]] -name = "incrementalmerkletree" -version = "0.8.2" +name = "incrementalmerkletree-testing" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30821f91f0fa8660edca547918dc59812893b497d07c1144f326f07fdd94aba9" +checksum = "ad20fb6cf815e76ce9b9eca74f347740ab99059fe4b5e4a002403d0441a02983" dependencies = [ - "either", + "incrementalmerkletree", + "proptest", ] [[package]] @@ -2774,9 +2815,9 @@ dependencies = [ [[package]] name = "nonempty" -version = "0.7.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" +checksum = "549e471b99ccaf2f89101bec68f4d244457d5a95a9c3d0672e9564124397741d" [[package]] name = "nu-ansi-term" @@ -2892,9 +2933,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchard" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f7152474406422f572de163e0bc63b2126cdbfe17bc849efbbde36fcfe647e" +checksum = "b1ef66fcf99348242a20d582d7434da381a867df8dc155b3a980eca767c56137" dependencies = [ "aes", "bitvec", @@ -2908,7 +2949,7 @@ dependencies = [ "halo2_poseidon", "halo2_proofs", "hex", - "incrementalmerkletree 0.7.1", + "incrementalmerkletree", "lazy_static", "memuse", "nonempty", @@ -3085,7 +3126,7 @@ checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", - "sha2", + "sha2 0.10.8", ] [[package]] @@ -3643,6 +3684,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "redjubjub" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b0ac1bc6bb3696d2c6f52cff8fba57238b81da8c0214ee6cd146eb8fde364e" +dependencies = [ + "rand_core 0.6.4", + "reddsa", + "thiserror 1.0.69", + "zeroize", +] + [[package]] name = "redox_syscall" version = "0.5.8" @@ -3783,7 +3836,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest", + "digest 0.10.7", +] + +[[package]] +name = "ripemd" +version = "0.2.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48cf93482ea998ad1302c42739bc73ab3adc574890c373ec89710e219357579" +dependencies = [ + "digest 0.11.0-pre.9", ] [[package]] @@ -3947,9 +4009,9 @@ dependencies = [ [[package]] name = "sapling-crypto" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c2acdbbab83d554fc2dceea5f7d6d3da71e57adb18a6c80b8901bd0eee54b0" +checksum = "f9d3c081c83f1dc87403d9d71a06f52301c0aa9ea4c17da2a3435bbf493ffba4" dependencies = [ "aes", "bellman", @@ -3957,20 +4019,20 @@ dependencies = [ "blake2b_simd", "blake2s_simd", "bls12_381", - "byteorder", + "core2", "document-features", "ff", "fpe", "getset", "group", "hex", - "incrementalmerkletree 0.7.1", + "incrementalmerkletree", "jubjub", "lazy_static", "memuse", "rand 0.8.5", "rand_core 0.6.4", - "redjubjub", + "redjubjub 0.8.0", "subtle", "tracing", "zcash_note_encryption", @@ -3990,10 +4052,19 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "secp256k1-sys", + "secp256k1-sys 0.8.1", "serde", ] +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "secp256k1-sys 0.10.1", +] + [[package]] name = "secp256k1-sys" version = "0.8.1" @@ -4003,6 +4074,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -4224,7 +4304,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4235,7 +4315,18 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540c0893cce56cdbcfebcec191ec8e0f470dd1889b6e7a0b503e310a94a168f5" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.11.0-pre.9", ] [[package]] @@ -4249,13 +4340,13 @@ dependencies = [ [[package]] name = "shardtree" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f2390975ebfe8838f9e861f7a588123d49a7a7a0a08568ea831d8ad53fc9b4" +checksum = "637e95dcd06bc1bb3f86ed9db1e1832a70125f32daae071ef37dcb7701b7d4fe" dependencies = [ "bitflags 2.8.0", "either", - "incrementalmerkletree 0.7.1", + "incrementalmerkletree", "tracing", ] @@ -5189,7 +5280,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "crypto-common", + "crypto-common 0.1.6", "subtle", ] @@ -5772,9 +5863,9 @@ dependencies = [ [[package]] name = "zcash_address" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b955fe87f2d9052e3729bdbeb0e94975355f4fe39f7d26aea9457bec6a0bb55" +checksum = "6a21f218c86b350d706c22489af999b098e19bf92ed6dd71770660ea29ee707d" dependencies = [ "bech32", "bs58", @@ -5786,9 +5877,9 @@ dependencies = [ [[package]] name = "zcash_client_backend" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a187ad05cdfe13707c07e6aedca8026b34921d081decfd0b43aac1efd438a7" +checksum = "cd14f1ef34cacef42dd2149783dad3d1f46949cb72da786f6ab13d6aa142020b" dependencies = [ "base64 0.22.1", "bech32", @@ -5798,7 +5889,7 @@ dependencies = [ "document-features", "group", "hex", - "incrementalmerkletree 0.7.1", + "incrementalmerkletree", "memuse", "nom", "nonempty", @@ -5820,15 +5911,16 @@ dependencies = [ "zcash_note_encryption", "zcash_primitives", "zcash_protocol", + "zcash_transparent", "zip32", "zip321", ] [[package]] name = "zcash_encoding" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3654116ae23ab67dd1f849b01f8821a8a156f884807ff665eac109bf28306c4d" +checksum = "bca38087e6524e5f51a5b0fb3fc18f36d7b84bf67b2056f494ca0c281590953d" dependencies = [ "core2", "nonempty", @@ -5847,9 +5939,9 @@ dependencies = [ [[package]] name = "zcash_keys" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad3cf576c6e6094cd03f446fcb83ad241ec315a088593cd50940f135cb03ce1" +checksum = "2af2839a7bb0489ccf0db9fb12c67234dd83e4a3b81ef50a10beecf1e852a18e" dependencies = [ "bech32", "blake2b_simd", @@ -5887,15 +5979,14 @@ dependencies = [ [[package]] name = "zcash_primitives" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b45f3ca3a9df34fcdbf036c2c814417bb417bde742812abc09d744bb3d7ed72" +checksum = "7574550ec5eba75f4e9d447b186de1541c40251d7f3ae2693ddaa5a477760190" dependencies = [ - "aes", "bip32", "blake2b_simd", "bs58", - "byteorder", + "core2", "document-features", "equihash", "ff", @@ -5903,18 +5994,18 @@ dependencies = [ "getset", "group", "hex", - "incrementalmerkletree 0.7.1", + "incrementalmerkletree", "jubjub", "memuse", "nonempty", "orchard", "rand 0.8.5", "rand_core 0.6.4", - "redjubjub", - "ripemd", + "redjubjub 0.8.0", + "ripemd 0.1.3", "sapling-crypto", - "secp256k1", - "sha2", + "secp256k1 0.29.1", + "sha2 0.10.8", "subtle", "tracing", "zcash_address", @@ -5928,9 +6019,9 @@ dependencies = [ [[package]] name = "zcash_proofs" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5826910c516675eca1f34b3557e159f4e35a4a1711b39fa4f01fb0adb9a9c24" +checksum = "d6bd0b0fe6a98a8b07e30c58457a2c2085f90e57ffac18eec9f72a566b471bde" dependencies = [ "bellman", "blake2b_simd", @@ -5942,7 +6033,7 @@ dependencies = [ "known-folders", "lazy_static", "rand_core 0.6.4", - "redjubjub", + "redjubjub 0.8.0", "sapling-crypto", "tracing", "xdg", @@ -5951,14 +6042,17 @@ dependencies = [ [[package]] name = "zcash_protocol" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82cb36b15b5a1be70b30c32ce40372dead6561df8a467e297f96b892873a63a2" +checksum = "72df627873d103e973b536d34d16cc802d06a3d1494dc010781449789a156dc5" dependencies = [ "core2", "document-features", "hex", + "incrementalmerkletree", + "incrementalmerkletree-testing", "memuse", + "proptest", ] [[package]] @@ -5973,18 +6067,18 @@ dependencies = [ [[package]] name = "zcash_spec" -version = "0.1.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cede95491c2191d3e278cab76e097a44b17fde8d6ca0d4e3a22cf4807b2d857" +checksum = "ded3f58b93486aa79b85acba1001f5298f27a46489859934954d262533ee2915" dependencies = [ "blake2b_simd", ] [[package]] name = "zcash_transparent" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0512e8e02af804e852fbbc4bd5db35a9037bc253d2ce396506293a6e7dd745" +checksum = "97b0c4ea6d9b94b5159106b65b57c4a9ea46859e7f7f8fb1be3e18e2d25bc372" dependencies = [ "bip32", "blake2b_simd", @@ -5993,9 +6087,10 @@ dependencies = [ "document-features", "getset", "hex", - "ripemd", - "secp256k1", - "sha2", + "proptest", + "ripemd 0.1.3", + "secp256k1 0.29.1", + "sha2 0.10.8", "subtle", "zcash_address", "zcash_encoding", @@ -6026,7 +6121,7 @@ dependencies = [ "halo2_proofs", "hex", "humantime", - "incrementalmerkletree 0.8.2", + "incrementalmerkletree", "itertools 0.14.0", "jubjub", "lazy_static", @@ -6040,15 +6135,15 @@ dependencies = [ "rand_core 0.6.4", "rayon", "reddsa", - "redjubjub", - "ripemd", + "redjubjub 0.7.0", + "ripemd 0.1.3", "sapling-crypto", - "secp256k1", + "secp256k1 0.27.0", "serde", "serde-big-array", "serde_json", "serde_with", - "sha2", + "sha2 0.10.8", "spandoc", "static_assertions", "tempfile", @@ -6554,9 +6649,9 @@ dependencies = [ [[package]] name = "zip32" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9943793abf9060b68e1889012dafbd5523ab5b125c0fcc24802d69182f2ac9" +checksum = "13ff9ea444cdbce820211f91e6aa3d3a56bde7202d3c0961b7c38f793abf5637" dependencies = [ "blake2b_simd", "memuse", @@ -6566,9 +6661,9 @@ dependencies = [ [[package]] name = "zip321" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3e613defb0940acef1f54774b51c7f48f2fa705613dd800870dc69f35cd2ea" +checksum = "91b5156b2f2e06d7819c2a5fcd4d515e745f5ac97a06cfb3721205d965de8f13" dependencies = [ "base64 0.22.1", "nom", diff --git a/Cargo.toml b/Cargo.toml index a6581507ef2..d1344eef6bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,17 +23,17 @@ resolver = "2" [workspace.dependencies] incrementalmerkletree = { version = "0.8.2", features = ["legacy-api"] } -orchard = "0.10.1" -sapling-crypto = "0.4.0" -zcash_address = "0.6.0" -zcash_client_backend = "0.16.0" -zcash_encoding = "0.2.2" +orchard = "0.11.0" +sapling-crypto = "0.5.0" +zcash_address = "0.7.0" +zcash_client_backend = "0.17.0" +zcash_encoding = "0.3.0" zcash_history = "0.4.0" -zcash_keys = "0.6.0" -zcash_primitives = "0.21.0" -zcash_proofs = "0.21.0" -zcash_transparent = "0.1.0" -zcash_protocol = "0.4.0" +zcash_keys = "0.7.0" +zcash_primitives = "0.22.0" +zcash_proofs = "0.22.0" +zcash_transparent = { version = "0.2.0", features = ["test-dependencies"] } +zcash_protocol = "0.5.0" abscissa_core = "0.7.0" atty = "0.2.14" base64 = "0.22.1" @@ -42,8 +42,8 @@ bincode = "1.3.3" bitflags = "2.8.0" bitflags-serde-legacy = "0.1.1" bitvec = "1.0.1" -blake2b_simd = "1.0.2" -blake2s_simd = "1.0.2" +blake2b_simd = "1.0.3" +blake2s_simd = "1.0.3" bls12_381 = "0.8.0" bs58 = "0.5.1" byteorder = "1.5.0" diff --git a/zebra-chain/src/parameters/network.rs b/zebra-chain/src/parameters/network.rs index 71ede1ba7f6..90341bc9d41 100644 --- a/zebra-chain/src/parameters/network.rs +++ b/zebra-chain/src/parameters/network.rs @@ -286,7 +286,7 @@ impl FromStr for Network { pub struct InvalidNetworkError(String); impl zcash_protocol::consensus::Parameters for Network { - fn network_type(&self) -> zcash_address::Network { + fn network_type(&self) -> zcash_protocol::consensus::NetworkType { self.kind().into() } diff --git a/zebra-chain/src/parameters/network/tests/vectors.rs b/zebra-chain/src/parameters/network/tests/vectors.rs index 8845090b50c..061fc9cc24f 100644 --- a/zebra-chain/src/parameters/network/tests/vectors.rs +++ b/zebra-chain/src/parameters/network/tests/vectors.rs @@ -1,7 +1,6 @@ //! Fixed test vectors for the network consensus parameters. -use zcash_primitives::consensus::{self as zp_consensus, Parameters}; -use zcash_protocol::consensus::NetworkConstants as _; +use zcash_protocol::consensus::{self as zp_consensus, NetworkConstants as _, Parameters}; use crate::{ block::Height, diff --git a/zebra-chain/src/primitives/address.rs b/zebra-chain/src/primitives/address.rs index 32ffa69b94a..57745a39e86 100644 --- a/zebra-chain/src/primitives/address.rs +++ b/zebra-chain/src/primitives/address.rs @@ -3,6 +3,7 @@ //! Usage: use zcash_address::unified::{self, Container}; +use zcash_protocol::consensus::NetworkType; use crate::{parameters::NetworkKind, transparent, BoxError}; @@ -44,7 +45,7 @@ impl zcash_address::TryFromAddress for Address { type Error = BoxError; fn try_from_transparent_p2pkh( - network: zcash_address::Network, + network: NetworkType, data: [u8; 20], ) -> Result> { Ok(Self::Transparent(transparent::Address::from_pub_key_hash( @@ -54,7 +55,7 @@ impl zcash_address::TryFromAddress for Address { } fn try_from_transparent_p2sh( - network: zcash_address::Network, + network: NetworkType, data: [u8; 20], ) -> Result> { Ok(Self::Transparent(transparent::Address::from_script_hash( @@ -64,7 +65,7 @@ impl zcash_address::TryFromAddress for Address { } fn try_from_sapling( - network: zcash_address::Network, + network: NetworkType, data: [u8; 43], ) -> Result> { let network = network.into(); @@ -74,7 +75,7 @@ impl zcash_address::TryFromAddress for Address { } fn try_from_unified( - network: zcash_address::Network, + network: NetworkType, unified_address: zcash_address::unified::Address, ) -> Result> { let network = network.into(); @@ -170,27 +171,27 @@ impl Address { } } -impl From for NetworkKind { - fn from(network: zcash_address::Network) -> Self { +impl From for NetworkKind { + fn from(network: NetworkType) -> Self { match network { - zcash_address::Network::Main => NetworkKind::Mainnet, - zcash_address::Network::Test => NetworkKind::Testnet, - zcash_address::Network::Regtest => NetworkKind::Regtest, + NetworkType::Main => NetworkKind::Mainnet, + NetworkType::Test => NetworkKind::Testnet, + NetworkType::Regtest => NetworkKind::Regtest, } } } -impl From for zcash_address::Network { +impl From for NetworkType { fn from(network: NetworkKind) -> Self { match network { - NetworkKind::Mainnet => zcash_address::Network::Main, - NetworkKind::Testnet => zcash_address::Network::Test, - NetworkKind::Regtest => zcash_address::Network::Regtest, + NetworkKind::Mainnet => NetworkType::Main, + NetworkKind::Testnet => NetworkType::Test, + NetworkKind::Regtest => NetworkType::Regtest, } } } -impl From<&NetworkKind> for zcash_address::Network { +impl From<&NetworkKind> for NetworkType { fn from(network: &NetworkKind) -> Self { (*network).into() } diff --git a/zebra-chain/src/primitives/viewing_key/sapling.rs b/zebra-chain/src/primitives/viewing_key/sapling.rs index 846b9835fa9..85c0d0d2da9 100644 --- a/zebra-chain/src/primitives/viewing_key/sapling.rs +++ b/zebra-chain/src/primitives/viewing_key/sapling.rs @@ -5,7 +5,7 @@ use zcash_client_backend::{ encoding::decode_extended_full_viewing_key, keys::sapling::DiversifiableFullViewingKey as SaplingDfvk, }; -use zcash_primitives::constants::*; +use zcash_protocol::constants::*; use crate::parameters::Network; diff --git a/zebra-chain/src/primitives/zcash_primitives.rs b/zebra-chain/src/primitives/zcash_primitives.rs index 8fb610974ab..31242122905 100644 --- a/zebra-chain/src/primitives/zcash_primitives.rs +++ b/zebra-chain/src/primitives/zcash_primitives.rs @@ -293,16 +293,18 @@ pub(crate) fn sighash( let output = &precomputed_tx_data.all_previous_outputs[input_index]; lock_script = output.lock_script.clone().into(); unlock_script = zcash_primitives::legacy::Script(script_code); - zp_tx::sighash::SignableInput::Transparent(zcash_transparent::sighash::SignableInput { - hash_type: hash_type.bits() as _, - index: input_index, - script_code: &unlock_script, - script_pubkey: &lock_script, - value: output - .value - .try_into() - .expect("amount was previously validated"), - }) + zp_tx::sighash::SignableInput::Transparent( + zcash_transparent::sighash::SignableInput::from_parts( + hash_type.bits() as _, + input_index, + &unlock_script, + &lock_script, + output + .value + .try_into() + .expect("amount was previously validated"), + ), + ) } None => zp_tx::sighash::SignableInput::Shielded, }; From f3ab7325bbc4b6ee43f2c807dca80f2ac8e9e84c Mon Sep 17 00:00:00 2001 From: ar Date: Tue, 25 Feb 2025 18:49:48 -0500 Subject: [PATCH 05/10] Adds conversion impl from `HashType` for `SighashType` --- .../src/primitives/zcash_primitives.rs | 2 +- zebra-chain/src/transaction/sighash.rs | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/zebra-chain/src/primitives/zcash_primitives.rs b/zebra-chain/src/primitives/zcash_primitives.rs index 31242122905..b5b83466d73 100644 --- a/zebra-chain/src/primitives/zcash_primitives.rs +++ b/zebra-chain/src/primitives/zcash_primitives.rs @@ -295,7 +295,7 @@ pub(crate) fn sighash( unlock_script = zcash_primitives::legacy::Script(script_code); zp_tx::sighash::SignableInput::Transparent( zcash_transparent::sighash::SignableInput::from_parts( - hash_type.bits() as _, + hash_type.try_into().expect("hash type should be ALL"), input_index, &unlock_script, &lock_script, diff --git a/zebra-chain/src/transaction/sighash.rs b/zebra-chain/src/transaction/sighash.rs index c2460a7101c..c0f0fc406a3 100644 --- a/zebra-chain/src/transaction/sighash.rs +++ b/zebra-chain/src/transaction/sighash.rs @@ -1,5 +1,7 @@ //! Signature hashes for Zcash transactions +use zcash_transparent::sighash::SighashType; + use super::Transaction; use crate::parameters::NetworkUpgrade; @@ -19,6 +21,29 @@ bitflags::bitflags! { const SINGLE = Self::ALL.bits() | Self::NONE.bits(); /// Anyone can add inputs to this transaction const ANYONECANPAY = 0b1000_0000; + + /// Sign all the outputs and Anyone can add inputs to this transaction + const ALL_ANYONECANPAY = Self::ALL.bits() | Self::ANYONECANPAY.bits(); + /// Sign none of the outputs and Anyone can add inputs to this transaction + const NONE_ANYONECANPAY = Self::NONE.bits() | Self::ANYONECANPAY.bits(); + /// Sign one of the outputs and Anyone can add inputs to this transaction + const SINGLE_ANYONECANPAY = Self::SINGLE.bits() | Self::ANYONECANPAY.bits(); + } +} + +impl TryFrom for SighashType { + type Error = (); + + fn try_from(hash_type: HashType) -> Result { + Ok(match hash_type { + HashType::ALL => Self::ALL, + HashType::NONE => Self::NONE, + HashType::SINGLE => Self::SINGLE, + HashType::ALL_ANYONECANPAY => Self::ALL_ANYONECANPAY, + HashType::NONE_ANYONECANPAY => Self::NONE_ANYONECANPAY, + HashType::SINGLE_ANYONECANPAY => Self::SINGLE_ANYONECANPAY, + _other => return Err(()), + }) } } From d8ae973bedc5a4f8f841927c29d7a8dad1cd777e Mon Sep 17 00:00:00 2001 From: ar Date: Tue, 25 Feb 2025 19:17:33 -0500 Subject: [PATCH 06/10] fixes lints --- Cargo.lock | 1 + zebra-consensus/src/primitives/halo2/tests.rs | 2 +- zebra-rpc/Cargo.toml | 1 + zebra-rpc/src/methods/get_block_template_rpcs.rs | 8 +++++--- zebra-scan/src/service/scan_task/scan.rs | 7 ++++++- zebra-scan/src/tests.rs | 4 ++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c389076e99..4717e27232c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6319,6 +6319,7 @@ dependencies = [ "tracing", "zcash_address", "zcash_primitives", + "zcash_protocol", "zebra-chain", "zebra-consensus", "zebra-network", diff --git a/zebra-consensus/src/primitives/halo2/tests.rs b/zebra-consensus/src/primitives/halo2/tests.rs index e654adcc546..002a81e8caa 100644 --- a/zebra-consensus/src/primitives/halo2/tests.rs +++ b/zebra-consensus/src/primitives/halo2/tests.rs @@ -50,7 +50,7 @@ fn generate_test_vectors() { for _ in 0..num_recipients { builder - .add_output(None, recipient, NoteValue::from_raw(note_value), None) + .add_output(None, recipient, NoteValue::from_raw(note_value), [0; 512]) .unwrap(); } diff --git a/zebra-rpc/Cargo.toml b/zebra-rpc/Cargo.toml index 4518051a2fe..9012504fe2d 100644 --- a/zebra-rpc/Cargo.toml +++ b/zebra-rpc/Cargo.toml @@ -91,6 +91,7 @@ serde = { workspace = true, features = ["serde_derive"] } nix = { workspace = true, features = ["signal"] } zcash_primitives = { workspace = true, features = ["transparent-inputs"] } +zcash_protocol.workspace = true # ECC deps used by getblocktemplate-rpcs feature zcash_address = { workspace = true, optional = true} diff --git a/zebra-rpc/src/methods/get_block_template_rpcs.rs b/zebra-rpc/src/methods/get_block_template_rpcs.rs index 809fafac69e..df6d686c749 100644 --- a/zebra-rpc/src/methods/get_block_template_rpcs.rs +++ b/zebra-rpc/src/methods/get_block_template_rpcs.rs @@ -1266,9 +1266,11 @@ where async fn z_list_unified_receivers(&self, address: String) -> Result { use zcash_address::unified::Container; - let (network, unified_address): (zcash_address::Network, zcash_address::unified::Address) = - zcash_address::unified::Encoding::decode(address.clone().as_str()) - .map_err(|error| ErrorObject::owned(0, error.to_string(), None::<()>))?; + let (network, unified_address): ( + zcash_protocol::consensus::NetworkType, + zcash_address::unified::Address, + ) = zcash_address::unified::Encoding::decode(address.clone().as_str()) + .map_err(|error| ErrorObject::owned(0, error.to_string(), None::<()>))?; let mut p2pkh = String::new(); let mut p2sh = String::new(); diff --git a/zebra-scan/src/service/scan_task/scan.rs b/zebra-scan/src/service/scan_task/scan.rs index fd662f55560..53e151d21c4 100644 --- a/zebra-scan/src/service/scan_task/scan.rs +++ b/zebra-scan/src/service/scan_task/scan.rs @@ -542,7 +542,12 @@ pub fn scanning_keys<'a>( dfvks .into_iter() .enumerate() - .map(|(i, dfvk)| Ok((AccountId::try_from(u32::try_from(i)?)?, dfvk_to_ufvk(dfvk)?))) + .map(|(i, dfvk)| { + Ok(( + AccountId::try_from(u32::try_from(i)?).map_err(|err| eyre!(err))?, + dfvk_to_ufvk(dfvk)?, + )) + }) .try_collect::<(_, _), Vec<(_, _)>, _>() .map(ScanningKeys::from_account_ufvks) } diff --git a/zebra-scan/src/tests.rs b/zebra-scan/src/tests.rs index ab2e9ea7ea9..499f9d6f048 100644 --- a/zebra-scan/src/tests.rs +++ b/zebra-scan/src/tests.rs @@ -208,7 +208,7 @@ pub fn fake_compact_block( let cout = CompactSaplingOutput { cmu, ephemeral_key, - ciphertext: enc_ciphertext.as_ref()[..52].to_vec(), + ciphertext: enc_ciphertext[..52].to_vec(), }; let mut ctx = CompactTx::default(); let mut txid = vec![0; 32]; @@ -250,7 +250,7 @@ pub fn random_compact_tx(mut rng: impl RngCore) -> CompactTx { }; let fake_cmu = { let fake_cmu = bls12_381::Scalar::random(&mut rng); - fake_cmu.to_repr().as_ref().to_owned() + fake_cmu.to_repr().to_vec() }; let fake_epk = { let mut buffer = [0; 64]; From cad6f8ee06f26e534637fb4b6aacb7a2928a25ff Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 25 Feb 2025 19:58:16 -0500 Subject: [PATCH 07/10] updates deny.toml --- deny.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deny.toml b/deny.toml index 7b73f984f69..81f5a09f1e2 100644 --- a/deny.toml +++ b/deny.toml @@ -89,8 +89,10 @@ skip-tree = [ # Remove after release candicate period is over and the ECC crates are not patched anymore { name = "equihash", version = "=0.2.0" }, - # wait for zcash_client_backend to update bech32 - { name = "bech32", version = "=0.9.1" }, + # wait for all librustzcash crates to update sha2, secp256k1, and ripemd + { name = "sha2", version = "=0.10.8" }, + { name = "secp256k1", version = "=0.27.0" }, + { name = "ripemd", version = "=0.1.3" }, # wait for zcash_script to update itertools { name = "itertools", version = "=0.13.0" }, From f9a841a2561e1add96bdafc2ac92e7cbc1b354cd Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 25 Feb 2025 20:38:48 -0500 Subject: [PATCH 08/10] updates edition, adds redjubjub to cargo deny exceptions --- deny.toml | 1 + zebrad/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deny.toml b/deny.toml index 81f5a09f1e2..3387d59b632 100644 --- a/deny.toml +++ b/deny.toml @@ -92,6 +92,7 @@ skip-tree = [ # wait for all librustzcash crates to update sha2, secp256k1, and ripemd { name = "sha2", version = "=0.10.8" }, { name = "secp256k1", version = "=0.27.0" }, + { name = "redjubjub", version = "=0.7.0" }, { name = "ripemd", version = "=0.1.3" }, # wait for zcash_script to update itertools diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 832a3a4cfb5..9f4364d29de 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -15,11 +15,11 @@ keywords = ["zebra", "zcash"] categories = ["command-line-utilities", "cryptography::cryptocurrencies"] # Settings that impact compilation -edition = "2021" +edition = "2024" # Zebra is only supported on the latest stable Rust version. See the README for details. # Any Zebra release can break compatibility with older Rust versions. -rust-version = "1.81.0" +rust-version = "1.85.0" # Settings that impact runtime behaviour From a727686618360fd647be215c64283719b43ecaa6 Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 25 Feb 2025 20:50:22 -0500 Subject: [PATCH 09/10] reverts Rust edition bump --- zebrad/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 9f4364d29de..355601deecd 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -15,7 +15,7 @@ keywords = ["zebra", "zcash"] categories = ["command-line-utilities", "cryptography::cryptocurrencies"] # Settings that impact compilation -edition = "2024" +edition = "2021" # Zebra is only supported on the latest stable Rust version. See the README for details. # Any Zebra release can break compatibility with older Rust versions. From 15b1e2d5685d516c329fbff6c64414af107e9678 Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 25 Feb 2025 21:40:30 -0500 Subject: [PATCH 10/10] fixes new usage of `add_output()` --- zebra-consensus/src/primitives/halo2/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zebra-consensus/src/primitives/halo2/tests.rs b/zebra-consensus/src/primitives/halo2/tests.rs index 002a81e8caa..75877d7b2b9 100644 --- a/zebra-consensus/src/primitives/halo2/tests.rs +++ b/zebra-consensus/src/primitives/halo2/tests.rs @@ -49,8 +49,10 @@ fn generate_test_vectors() { ); for _ in 0..num_recipients { + let mut memo: [u8; 512] = [0; 512]; + memo[0] = 0xF6; builder - .add_output(None, recipient, NoteValue::from_raw(note_value), [0; 512]) + .add_output(None, recipient, NoteValue::from_raw(note_value), memo) .unwrap(); }