diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 7a9871203e..c994fd64b9 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -31,6 +31,7 @@ runs: transparent-inputs sapling unstable + unstable-spanning-tree ${{ inputs.extra-features }} ${{ steps.test.outputs.feature }} '" >> $GITHUB_OUTPUT diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef0d54b436..ccb6bd343a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,9 +193,9 @@ jobs: - name: Add zcash_proofs as a dependency of the synthetic crate working-directory: ./ci-build run: cargo add --no-default-features --path ../crates/zcash_proofs -# - name: Add zcash_client_backend as a dependency of the synthetic crate -# working-directory: ./ci-build -# run: cargo add --features lightwalletd-tonic --path ../crates/zcash_client_backend + - name: Add zcash_client_backend as a dependency of the synthetic crate + working-directory: ./ci-build + run: cargo add --features lightwalletd-tonic --path ../crates/zcash_client_backend - name: Copy pinned dependencies into synthetic crate run: cp crates/Cargo.lock ci-build/ - name: Add target diff --git a/Cargo.lock b/Cargo.lock index 1ef8a40f09..970849ca1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,6 +66,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + [[package]] name = "arrayref" version = "0.3.7" @@ -84,6 +90,39 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "async-trait" +version = "0.1.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + [[package]] name = "atty" version = "0.2.14" @@ -101,6 +140,51 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -286,6 +370,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + [[package]] name = "cast" version = "0.3.0" @@ -441,7 +531,7 @@ dependencies = [ "ciborium", "clap", "criterion-plot", - "itertools", + "itertools 0.10.5", "lazy_static", "num-traits", "oorandom", @@ -462,7 +552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -687,6 +777,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "fnv" version = "1.0.7" @@ -713,6 +809,58 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[package]] +name = "futures-macro" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "futures-sink" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" + +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -753,6 +901,45 @@ dependencies = [ "subtle", ] +[[package]] +name = "gumdrop" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" +dependencies = [ + "gumdrop_derive", +] + +[[package]] +name = "gumdrop_derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "1.8.2" @@ -831,6 +1018,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -870,6 +1063,76 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.4.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "incrementalmerkletree" version = "0.5.1" @@ -949,6 +1212,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1050,6 +1322,12 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "maybe-rayon" version = "0.1.1" @@ -1093,6 +1371,12 @@ dependencies = [ "nonempty", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1121,6 +1405,23 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "mio" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "nix" version = "0.26.4" @@ -1229,7 +1530,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "orchard" version = "0.8.0" -source = "git+https://github.com/QED-it/orchard?branch=zsa1#410037df38ec60eed49c157d4d430f0eb06604be" +source = "git+https://github.com/QED-it/orchard?branch=zsa1#a7c02d22a1e2f4310130ae2e7b9813136071bc75" dependencies = [ "aes", "bitvec", @@ -1338,12 +1639,48 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.1.0", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + [[package]] name = "pin-project-lite" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkcs8" version = "0.10.2" @@ -1421,6 +1758,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn 2.0.53", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -1460,6 +1807,60 @@ dependencies = [ "unarray", ] +[[package]] +name = "prost" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.53", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "prost-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +dependencies = [ + "prost", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -1722,6 +2123,12 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "rusty-fork" version = "0.3.0" @@ -1855,7 +2262,7 @@ checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.53", ] [[package]] @@ -1880,6 +2287,20 @@ dependencies = [ "digest", ] +[[package]] +name = "shardtree" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d766257c56a1bdd75479c256b97c92e72788a9afb18b5199f58faf7188dc99d9" +dependencies = [ + "assert_matches", + "bitflags 2.4.2", + "either", + "incrementalmerkletree", + "proptest", + "tracing", +] + [[package]] name = "signature" version = "2.2.0" @@ -1890,12 +2311,41 @@ dependencies = [ "rand_core", ] +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.5.2" @@ -1965,6 +2415,17 @@ dependencies = [ "symbolic-common", ] +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.53" @@ -1976,6 +2437,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "tap" version = "1.0.1" @@ -2018,9 +2485,25 @@ checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.53", +] + +[[package]] +name = "time" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +dependencies = [ + "serde", + "time-core", ] +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + [[package]] name = "tinytemplate" version = "1.2.1" @@ -2046,6 +2529,129 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.5", + "windows-sys", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.40" @@ -2065,7 +2671,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.53", ] [[package]] @@ -2077,6 +2683,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + [[package]] name = "typenum" version = "1.17.0" @@ -2219,6 +2831,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2246,7 +2867,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.53", "wasm-bindgen-shared", ] @@ -2268,7 +2889,7 @@ checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.53", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2295,6 +2916,18 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2420,6 +3053,56 @@ dependencies = [ "zcash_protocol", ] +[[package]] +name = "zcash_client_backend" +version = "0.12.1" +dependencies = [ + "assert_matches", + "async-trait", + "base64", + "bech32", + "bls12_381", + "bs58", + "byteorder", + "crossbeam-channel", + "document-features", + "futures-util", + "group", + "gumdrop", + "hdwallet", + "hex", + "incrementalmerkletree", + "jubjub", + "memuse", + "nom", + "nonempty", + "orchard", + "percent-encoding", + "proptest", + "prost", + "rand_core", + "rayon", + "sapling-crypto", + "secrecy", + "shardtree", + "subtle", + "time", + "tokio", + "tonic", + "tonic-build", + "tracing", + "which", + "zcash_address", + "zcash_encoding", + "zcash_keys", + "zcash_note_encryption", + "zcash_primitives", + "zcash_proofs", + "zcash_protocol", + "zip32", + "zip321", +] + [[package]] name = "zcash_encoding" version = "0.2.0" @@ -2599,7 +3282,7 @@ checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.53", ] [[package]] @@ -2619,7 +3302,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.53", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ea4dc87ac0..355f209baa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,8 @@ members = [ "components/zcash_encoding", "components/zcash_protocol", "components/zip321", -# "zcash_client_backend", + # zcash_client_backend and zcash_client_sqlite are not compatible with OrchardZSA + "zcash_client_backend", # "zcash_client_sqlite", "zcash_extensions", "zcash_history", @@ -31,7 +32,7 @@ categories = ["cryptography::cryptocurrencies"] # Intra-workspace dependencies equihash = { version = "0.2", path = "components/equihash" } zcash_address = { version = "0.3", path = "components/zcash_address" } -#zcash_client_backend = { version = "0.12", path = "zcash_client_backend" } +zcash_client_backend = { version = "0.12", path = "zcash_client_backend" } zcash_encoding = { version = "0.2", path = "components/zcash_encoding" } zcash_keys = { version = "0.2", path = "zcash_keys" } zcash_protocol = { version = "0.1", path = "components/zcash_protocol" } @@ -58,7 +59,7 @@ sapling = { package = "sapling-crypto", version = "0.1.3" } # - Orchard nonempty = "0.7" -orchard = { version = "0.8.0", default-features = false, git = "https://github.com/QED-it/orchard", branch = "zsa1" } +orchard = { version = "0.8.0", default-features = false } pasta_curves = "0.5" # - Transparent @@ -95,7 +96,7 @@ maybe-rayon = { version = "0.1.0", default-features = false } rayon = "1.5" # Protobuf and gRPC -prost = "=0.12.3" +prost = "0.12" tonic = { version = "0.10", default-features = false } tonic-build = { version = "0.10", default-features = false } @@ -126,3 +127,4 @@ codegen-units = 1 [patch.crates-io] zcash_note_encryption = { version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "zsa1" } sapling = { package = "sapling-crypto", version = "0.1.3", git = "https://github.com/QED-it/sapling-crypto", branch = "zsa1" } +orchard = { version = "0.8.0", git = "https://github.com/QED-it/orchard", branch = "zsa1" } diff --git a/zcash_client_backend/src/data_api/wallet.rs b/zcash_client_backend/src/data_api/wallet.rs index 69cc88f932..4ea35f4b40 100644 --- a/zcash_client_backend/src/data_api/wallet.rs +++ b/zcash_client_backend/src/data_api/wallet.rs @@ -977,6 +977,7 @@ where orchard_external_ovk.clone(), *ua.orchard().expect("The mapping between payment pool and receiver is checked in step construction"), payment.amount().into(), + orchard::note::AssetBase::native(), memo.clone(), )?; orchard_output_meta.push(( @@ -1081,6 +1082,7 @@ where orchard_internal_ovk(), orchard_fvk.address_at(0u32, orchard::keys::Scope::Internal), change_value.value().into(), + orchard::note::AssetBase::native(), memo.clone(), )?; orchard_output_meta.push(( diff --git a/zcash_client_backend/src/data_api/wallet/input_selection.rs b/zcash_client_backend/src/data_api/wallet/input_selection.rs index ebbeef66a4..36306e8e90 100644 --- a/zcash_client_backend/src/data_api/wallet/input_selection.rs +++ b/zcash_client_backend/src/data_api/wallet/input_selection.rs @@ -468,7 +468,7 @@ where ), #[cfg(feature = "orchard")] &( - ::orchard::builder::BundleType::DEFAULT, + ::orchard::builder::BundleType::DEFAULT_VANILLA, &orchard_inputs[..], &orchard_outputs[..], ), @@ -594,7 +594,7 @@ where ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &Vec::::new()[..], ), @@ -619,7 +619,7 @@ where ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &Vec::::new()[..], ), diff --git a/zcash_client_backend/src/fees/fixed.rs b/zcash_client_backend/src/fees/fixed.rs index a20ab3ef13..853083c96f 100644 --- a/zcash_client_backend/src/fees/fixed.rs +++ b/zcash_client_backend/src/fees/fixed.rs @@ -131,7 +131,7 @@ mod tests { ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &[] as &[Infallible], &[] as &[Infallible], ), @@ -180,7 +180,7 @@ mod tests { ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &[] as &[Infallible], &[] as &[Infallible], ), diff --git a/zcash_client_backend/src/fees/zip317.rs b/zcash_client_backend/src/fees/zip317.rs index e3acacd590..936f6e929d 100644 --- a/zcash_client_backend/src/fees/zip317.rs +++ b/zcash_client_backend/src/fees/zip317.rs @@ -268,7 +268,7 @@ mod tests { ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &Vec::::new()[..], ), @@ -309,7 +309,7 @@ mod tests { &Vec::::new()[..], ), &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &[OrchardPayment::new(NonNegativeAmount::const_from_u64( 30000, @@ -355,7 +355,7 @@ mod tests { ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &Vec::::new()[..], ), @@ -403,7 +403,7 @@ mod tests { ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &Vec::::new()[..], ), @@ -455,7 +455,7 @@ mod tests { ), #[cfg(feature = "orchard")] &( - orchard::builder::BundleType::DEFAULT, + orchard::builder::BundleType::DEFAULT_VANILLA, &Vec::::new()[..], &Vec::::new()[..], ), diff --git a/zcash_client_backend/src/proto.rs b/zcash_client_backend/src/proto.rs index 65d4c483cb..38ed2b4a06 100644 --- a/zcash_client_backend/src/proto.rs +++ b/zcash_client_backend/src/proto.rs @@ -9,8 +9,8 @@ use std::{ io, }; -use sapling::{self, note::ExtractedNoteCommitment, Node}; -use zcash_note_encryption::{EphemeralKeyBytes, COMPACT_NOTE_SIZE}; +use sapling::{self, note::ExtractedNoteCommitment, note_encryption::COMPACT_NOTE_SIZE, Node}; +use zcash_note_encryption::EphemeralKeyBytes; use zcash_primitives::{ block::{BlockHash, BlockHeader}, consensus::BlockHeight, @@ -150,7 +150,7 @@ impl From<&sapling::bundle::OutputDescription> compact_formats::CompactSaplingOutput { cmu: out.cmu().to_bytes().to_vec(), ephemeral_key: out.ephemeral_key().as_ref().to_vec(), - ciphertext: out.enc_ciphertext()[..COMPACT_NOTE_SIZE].to_vec(), + ciphertext: out.enc_ciphertext().as_ref()[..COMPACT_NOTE_SIZE].to_vec(), } } } @@ -186,7 +186,9 @@ impl compact_formats::CompactSaplingSpend { } #[cfg(feature = "orchard")] -impl TryFrom<&compact_formats::CompactOrchardAction> for orchard::note_encryption::CompactAction { +impl TryFrom<&compact_formats::CompactOrchardAction> + for orchard::note_encryption::CompactAction +{ type Error = (); fn try_from(value: &compact_formats::CompactOrchardAction) -> Result { @@ -194,7 +196,9 @@ impl TryFrom<&compact_formats::CompactOrchardAction> for orchard::note_encryptio value.nf()?, value.cmx()?, value.ephemeral_key()?, - value.ciphertext[..].try_into().map_err(|_| ())?, + zcash_note_encryption::note_bytes::NoteBytesData( + value.ciphertext[..].try_into().map_err(|_| ())?, + ), )) } } @@ -247,13 +251,18 @@ impl From<&sapling::bundle::SpendDescription< } #[cfg(feature = "orchard")] -impl From<&orchard::Action> for compact_formats::CompactOrchardAction { - fn from(action: &orchard::Action) -> compact_formats::CompactOrchardAction { +impl From<&orchard::Action> + for compact_formats::CompactOrchardAction +{ + fn from( + action: &orchard::Action, + ) -> compact_formats::CompactOrchardAction { compact_formats::CompactOrchardAction { nullifier: action.nullifier().to_bytes().to_vec(), cmx: action.cmx().to_bytes().to_vec(), ephemeral_key: action.encrypted_note().epk_bytes.to_vec(), - ciphertext: action.encrypted_note().enc_ciphertext[..COMPACT_NOTE_SIZE].to_vec(), + ciphertext: action.encrypted_note().enc_ciphertext.as_ref()[..COMPACT_NOTE_SIZE] + .to_vec(), } } } diff --git a/zcash_client_backend/src/proto/compact_formats.rs b/zcash_client_backend/src/proto/compact_formats.rs index 334a4c44ba..44455378f7 100644 --- a/zcash_client_backend/src/proto/compact_formats.rs +++ b/zcash_client_backend/src/proto/compact_formats.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// Information about the state of the chain as of a given block. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/zcash_client_backend/src/proto/proposal.rs b/zcash_client_backend/src/proto/proposal.rs index 0a664d5cde..a17b83bf8b 100644 --- a/zcash_client_backend/src/proto/proposal.rs +++ b/zcash_client_backend/src/proto/proposal.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// A data structure that describes a series of transactions to be created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/zcash_client_backend/src/proto/service.rs b/zcash_client_backend/src/proto/service.rs index 03ea1b93ec..ccfd3fed7a 100644 --- a/zcash_client_backend/src/proto/service.rs +++ b/zcash_client_backend/src/proto/service.rs @@ -1,4 +1,3 @@ -// This file is @generated by prost-build. /// A BlockID message contains identifiers to select a block: a height or a /// hash. Specification by hash is not implemented, but may be in the future. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/zcash_client_backend/src/scan.rs b/zcash_client_backend/src/scan.rs index e7b8fd3be6..c893dc7a84 100644 --- a/zcash_client_backend/src/scan.rs +++ b/zcash_client_backend/src/scan.rs @@ -8,9 +8,7 @@ use std::sync::{ }; use memuse::DynamicUsage; -use zcash_note_encryption::{ - batch, BatchDomain, Domain, ShieldedOutput, -}; +use zcash_note_encryption::{batch, BatchDomain, Domain, ShieldedOutput}; use zcash_primitives::{block::BlockHash, transaction::TxId}; /// A decrypted transaction output. @@ -58,9 +56,7 @@ pub(crate) trait Decryptor { /// A decryptor of outputs as encoded in transactions. pub(crate) struct FullDecryptor; -impl> Decryptor - for FullDecryptor -{ +impl> Decryptor for FullDecryptor { type Memo = D::Memo; fn batch_decrypt( @@ -85,9 +81,7 @@ impl> Decryptor /// A decryptor of outputs as encoded in compact blocks. pub(crate) struct CompactDecryptor; -impl> Decryptor - for CompactDecryptor -{ +impl> Decryptor for CompactDecryptor { type Memo = (); fn batch_decrypt( diff --git a/zcash_client_backend/src/scanning.rs b/zcash_client_backend/src/scanning.rs index d95f321fd1..dd67882d84 100644 --- a/zcash_client_backend/src/scanning.rs +++ b/zcash_client_backend/src/scanning.rs @@ -32,6 +32,7 @@ use crate::{ #[cfg(feature = "orchard")] use orchard::{ note_encryption::{CompactAction, OrchardDomain}, + orchard_flavor::OrchardVanilla, tree::MerkleHashOrchard, }; @@ -161,7 +162,7 @@ impl ScanningKeyOps } #[cfg(feature = "orchard")] -impl ScanningKeyOps +impl ScanningKeyOps, AccountId, orchard::note::Nullifier> for ScanningKey { fn prepare(&self) -> orchard::keys::PreparedIncomingViewingKey { @@ -191,7 +192,7 @@ pub struct ScanningKeys { #[cfg(feature = "orchard")] orchard: HashMap< IvkTag, - Box>, + Box, AccountId, orchard::note::Nullifier>>, >, } @@ -204,7 +205,13 @@ impl ScanningKeys { >, #[cfg(feature = "orchard")] orchard: HashMap< IvkTag, - Box>, + Box< + dyn ScanningKeyOps< + OrchardDomain, + AccountId, + orchard::note::Nullifier, + >, + >, >, ) -> Self { Self { @@ -235,8 +242,10 @@ impl ScanningKeys { #[cfg(feature = "orchard")] pub fn orchard( &self, - ) -> &HashMap>> - { + ) -> &HashMap< + IvkTag, + Box, AccountId, orchard::note::Nullifier>>, + > { &self.orchard } } @@ -256,7 +265,13 @@ impl ScanningKeys>, + Box< + dyn ScanningKeyOps< + OrchardDomain, + AccountId, + orchard::note::Nullifier, + >, + >, > = HashMap::new(); for (account_id, ufvk) in ufvks { @@ -519,13 +534,17 @@ type TaggedSaplingBatchRunner = BatchRunner< >; #[cfg(feature = "orchard")] -type TaggedOrchardBatch = - Batch; +type TaggedOrchardBatch = Batch< + IvkTag, + OrchardDomain, + orchard::note_encryption::CompactAction, + CompactDecryptor, +>; #[cfg(feature = "orchard")] type TaggedOrchardBatchRunner = BatchRunner< IvkTag, - OrchardDomain, - orchard::note_encryption::CompactAction, + OrchardDomain, + orchard::note_encryption::CompactAction, CompactDecryptor, Tasks, >; @@ -1038,7 +1057,7 @@ fn find_received< Nf, IvkTag: Copy + std::hash::Hash + Eq + Send + 'static, SK: ScanningKeyOps, - Output: ShieldedOutput, + Output: ShieldedOutput, NoteCommitment, >( block_height: BlockHeight, @@ -1155,13 +1174,13 @@ pub mod testing { use rand_core::{OsRng, RngCore}; use sapling::{ constants::SPENDING_KEY_GENERATOR, - note_encryption::{sapling_note_encryption, SaplingDomain}, + note_encryption::{sapling_note_encryption, SaplingDomain, COMPACT_NOTE_SIZE}, util::generate_random_rseed, value::NoteValue, zip32::DiversifiableFullViewingKey, Nullifier, }; - use zcash_note_encryption::{Domain, COMPACT_NOTE_SIZE}; + use zcash_note_encryption::Domain; use zcash_primitives::{ block::BlockHash, consensus::{BlockHeight, Network},