From 9ea83d4c62b9a6773de03ccb2df29a88497cceac Mon Sep 17 00:00:00 2001 From: roman Date: Fri, 24 Apr 2026 23:59:52 -0300 Subject: [PATCH 1/7] Migrate to orchard 0.13 + librustzcash zcash/main Drops every reference to the retired valargroup/librustzcash and valar-orchard forks and pins to the upstream rebases instead: - Workspace [patch.crates-io] now redirects orchard, voting-circuits, pczt, transparent and the four librustzcash crates to a single set of authoritative sources (valargroup/orchard valar/0.13-spend-auth-g, valargroup/voting-circuits valar/orchard-0.13, zcash/librustzcash rev 976efa76ca). The old sapling-crypto git pin is removed because sapling-crypto 0.7.0 is now published on crates.io and matches what zcash_primitives 0.27 expects. - Inner zcash_voting crate drops the `package = "valar-orchard"` rename, switches orchard to `version = "0.13"` with the new `unstable-voting-circuits` feature (required by zkp1.rs integration tests that use `Note::new`/`Note::dummy`/`Rho::from_nf_old`), and swaps every git-pinned librustzcash dep for upstream version specs that resolve through the workspace patches. - vote-commitment-tree dev-dep follows the same orchard rename cleanup. All governance librustzcash PRs (#2283, #2284, #2281) are merged upstream so the fork retires entirely; orchard 0.13 added the `unstable-voting-circuits` feature flag that exposes the same internals our valar-orchard fork carried. Made-with: Cursor --- Cargo.toml | 27 ++++++++++++++++++++------- vote-commitment-tree/Cargo.toml | 2 +- zcash_voting/Cargo.toml | 32 ++++++++++++++------------------ 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 71283602..2cb34afc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,24 @@ members = [ ] resolver = "2" -# Mirrors the sapling-crypto git pin used by the librustzcash fork -# (valargroup/librustzcash PR #43, `shielded-vote-for-zodl-3.4.0`). `zcash_primitives` -# depends on `sapling = "0.6.2"` from crates.io; without this patch its build picks -# up the published 0.6.2 crate, diverging from the fork's build graph and -# producing two distinct `sapling` nodes (one for our build, one inside the fork -# crates) that are incompatible at the type level. +# Single-source patches for the orchard 0.13 + librustzcash zcash/main migration. +# +# - `orchard`: pin to the valargroup branch carrying orchard 0.13.0 + zcash/orchard +# PR #489 (SpendAuthG fixed-base multiplication). The same pin is used by every +# downstream consumer so the entire dep graph collapses to a single orchard node. +# - `voting-circuits`: pin to the matching valargroup branch (consumes the orchard +# git pin above; published 0.2.0 still depends on the retired valar-orchard fork +# and would create a duplicate orchard node in the graph). +# - `pczt` / `zcash_*` / `transparent`: pin to the upstream zcash/librustzcash +# `main` HEAD now that all governance PRs (#2283, #2284, #2281) are merged +# upstream — the valargroup/librustzcash fork is fully retired. [patch.crates-io] -sapling = { package = "sapling-crypto", git = "https://github.com/zcash/sapling-crypto.git", rev = "b8a81c22f034d68f9bbd6cba728aab807b9ba2ea" } +orchard = { git = "https://github.com/valargroup/orchard.git", branch = "valar/0.13-spend-auth-g" } +voting-circuits = { git = "https://github.com/valargroup/voting-circuits.git", branch = "valar/orchard-0.13" } +pczt = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } +zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } +zcash_encoding = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } +zcash_keys = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } +zcash_primitives = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } +zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } +transparent = { package = "zcash_transparent", git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } diff --git a/vote-commitment-tree/Cargo.toml b/vote-commitment-tree/Cargo.toml index d82b0536..9a1baa2a 100644 --- a/vote-commitment-tree/Cargo.toml +++ b/vote-commitment-tree/Cargo.toml @@ -20,5 +20,5 @@ libc = "0.2" [dev-dependencies] rand = "0.8" -orchard = { version = "0.12.0", package = "valar-orchard" } +orchard = { version = "0.13", features = ["unstable-voting-circuits"] } voting-circuits = "0.2.0" diff --git a/zcash_voting/Cargo.toml b/zcash_voting/Cargo.toml index f7a5595b..12d582ea 100644 --- a/zcash_voting/Cargo.toml +++ b/zcash_voting/Cargo.toml @@ -39,27 +39,23 @@ rusqlite = { version = "0.37", features = ["bundled"] } # Error handling thiserror = "2" -# Single orchard: zcash_keys / pczt / zcash_primitives are pulled from the fork tip -# (valargroup/librustzcash PR #43), which internally resolves `orchard` through the -# `valar-orchard` package on crates.io — the same crate voting-circuits depends on. -# Cargo sees one Orchard node in the graph, so no compat bridge is needed. +# Single orchard node: every consumer (this crate, voting-circuits, and the +# librustzcash crates we pin below) resolves `orchard` through the workspace's +# `[patch.crates-io]` redirect to valargroup/orchard `valar/0.13-spend-auth-g` +# (orchard 0.13.0 + zcash/orchard PR #489). The `unstable-voting-circuits` +# feature is required by integration tests in `zkp1.rs` (`Note::new`, +# `Note::dummy`, `Rho::from_nf_old`). subtle = "2.6" -orchard = { version = "0.12.0", package = "valar-orchard" } +orchard = { version = "0.13", features = ["unstable-voting-circuits"] } voting-circuits = { version = "0.2.0", features = ["share-reveal"] } nonempty = "0.11" zip32 = "0.2" incrementalmerkletree = "0.8" -# librustzcash pins — valargroup/librustzcash PR #43 tip -# (`shielded-vote-for-zodl-3.4.0`, rebased onto upstream zcash/main 95b000e, -# i.e. the last commit before sapling-crypto 0.7 / orchard 0.13). Bump in lockstep -# when that PR advances or merges. -# -# `zcash_protocol` is pinned alongside the other librustzcash crates so the graph -# has a single version; pulling it from crates.io would let zcash_keys / pczt / -# zcash_primitives see a second `zcash_protocol` node and Cargo would reject the -# trait impls as "different types". -zcash_protocol = { git = "https://github.com/valargroup/librustzcash", rev = "6534482c1cc595f38e0aaa63c4c7c4689360d766" } -zcash_keys = { git = "https://github.com/valargroup/librustzcash", rev = "6534482c1cc595f38e0aaa63c4c7c4689360d766", features = ["orchard"] } -pczt = { git = "https://github.com/valargroup/librustzcash", rev = "6534482c1cc595f38e0aaa63c4c7c4689360d766", features = ["orchard", "io-finalizer", "signer", "zcp-builder"] } -zcash_primitives = { git = "https://github.com/valargroup/librustzcash", rev = "6534482c1cc595f38e0aaa63c4c7c4689360d766" } +# librustzcash pins — upstream zcash/librustzcash `main` HEAD. All governance +# PRs (#2283, #2284, #2281) that previously kept the valargroup fork alive are +# now merged upstream; bump this rev in lockstep when zcash/main advances. +zcash_protocol = "0.8" +zcash_keys = { version = "0.12", features = ["orchard"] } +pczt = { version = "0.5", features = ["orchard", "io-finalizer", "signer", "zcp-builder"] } +zcash_primitives = "0.27" From a6448d8e8b7ed0adb5c0474894977d9f71acdaf1 Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 25 Apr 2026 02:14:23 -0300 Subject: [PATCH 2/7] Update dep notes + lock against orchard PR #19 (NoteValue::ZERO) and voting-circuits PR #20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Companion to the previous "Migrate to orchard 0.13 + librustzcash zcash/main" commit (which only flipped the Cargo.toml [patch.crates-io] entries). This commit catches the lockfile and the surrounding documentation up to where the orchard / voting-circuits stack actually lives now. * Cargo.lock — regenerated against the git URL pins so a fresh `cargo build` reproduces the exact dep graph that the migration was tested against: orchard 7fa213ae valargroup/orchard valar/0.13-spend-auth-g = orchard 0.13.0 + cherry-picks of zcash/orchard #489 (SpendAuthG fixed-base multiplication) + zcash/orchard #495 (NoteValue::ZERO public associated constant) (tracked by valargroup/orchard PR #19) voting-circuits ec6d3adb valargroup/voting-circuits valar/orchard-0.13 (= valargroup/voting-circuits PR #20 head) pczt / zcash_address / zcash_encoding / zcash_keys / zcash_primitives / zcash_protocol / zcash_transparent 976efa76ca zcash/librustzcash main (commit-pinned) * Cargo.toml + zcash_voting/Cargo.toml — comments now mention both zcash/orchard #489 and #495, tracked by valargroup/orchard PR #19, instead of just #489. No semantic change. * zcash_voting/README.md — drop the "depends on valar-orchard + valar-pczt" wording (those forks are retired), replace with the current pin: orchard 0.13 + valargroup/orchard PR #19 (carrying zcash/orchard #489 + #495), plus a librustzcash commit-pin pointing at zcash/main now that PRs #2281 / #2283 / #2284 are merged upstream. Notes that the pin collapses back to the published `orchard 0.14` crate + a librustzcash release once both upstream PRs land. Verification: * `cargo check --tests --workspace --all-features` clean. * No drift between Cargo.toml [patch.crates-io] entries and the resolved [[package]] sources in Cargo.lock. Made-with: Cursor --- Cargo.lock | 129 ++++++++++++++++++++-------------------- Cargo.toml | 9 ++- zcash_voting/Cargo.toml | 7 ++- zcash_voting/README.md | 8 +-- 4 files changed, 77 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 477e18ef..37072330 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -677,8 +677,8 @@ dependencies = [ [[package]] name = "equihash" -version = "0.2.2" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +version = "0.3.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "blake2b_simd", "corez", @@ -714,7 +714,7 @@ dependencies = [ [[package]] name = "f4jumble" version = "0.1.1" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "blake2b_simd", ] @@ -1768,6 +1768,41 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "orchard" +version = "0.13.0" +source = "git+https://github.com/valargroup/orchard.git?branch=valar%2F0.13-spend-auth-g#7fa213ae7057eb959e5aba4a4195d6ca2e26b252" +dependencies = [ + "aes", + "bitvec", + "blake2b_simd", + "corez", + "ff", + "fpe", + "getset", + "group", + "halo2_gadgets 0.4.0", + "halo2_poseidon", + "halo2_proofs", + "hex", + "incrementalmerkletree", + "lazy_static", + "memuse", + "nonempty", + "pasta_curves", + "rand 0.8.5", + "rand_core 0.6.4", + "reddsa", + "serde", + "sinsemilla", + "subtle", + "tracing", + "visibility", + "zcash_note_encryption", + "zcash_spec", + "zip32", +] + [[package]] name = "pairing" version = "0.23.0" @@ -1818,7 +1853,7 @@ dependencies = [ [[package]] name = "pczt" version = "0.5.1" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "blake2b_simd", "bls12_381", @@ -1827,6 +1862,7 @@ dependencies = [ "getset", "jubjub", "nonempty", + "orchard", "pasta_curves", "postcard", "rand_core 0.6.4", @@ -1835,7 +1871,6 @@ dependencies = [ "secp256k1", "serde", "serde_with", - "valar-orchard", "zcash_note_encryption", "zcash_primitives", "zcash_protocol", @@ -2302,8 +2337,9 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "sapling-crypto" -version = "0.6.2" -source = "git+https://github.com/zcash/sapling-crypto.git?rev=b8a81c22f034d68f9bbd6cba728aab807b9ba2ea#b8a81c22f034d68f9bbd6cba728aab807b9ba2ea" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d70756ede56b5e4dd417979777bd87ddb83dfcbd0815dbf8175a9920537f8a0" dependencies = [ "aes", "bellman", @@ -3029,47 +3065,11 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "valar-orchard" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0415fc8aba029019c974bb0b0cc47e0bca53a27fdc2da263a2e6c99c9b3727f8" -dependencies = [ - "aes", - "bitvec", - "blake2b_simd", - "corez", - "ff", - "fpe", - "getset", - "group", - "halo2_gadgets 0.4.0", - "halo2_poseidon", - "halo2_proofs", - "hex", - "incrementalmerkletree", - "lazy_static", - "memuse", - "nonempty", - "pasta_curves", - "rand 0.8.5", - "rand_core 0.6.4", - "reddsa", - "serde", - "sinsemilla", - "subtle", - "tracing", - "visibility", - "zcash_note_encryption", - "zcash_spec", - "zip32", -] - [[package]] name = "valar-spiral-rs" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce897de77f8b80c06e3457da2db3585333d2882f9e9f420ac8a79ab6e6a43f09" +checksum = "c501f15052c202b2c9934226b1b16572e7ee6dfe77c014b6782e2580f205417a" dependencies = [ "fastrand", "getrandom 0.2.10", @@ -3082,9 +3082,9 @@ dependencies = [ [[package]] name = "valar-ypir" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38a86b46d9519c49680c58a222cd6891e08e382fb24ea281819de7f2fa64985c" +checksum = "0bb09e03af16c344a2e205924808978776fc12b48a4f6a388f4c8f55c56c6394" dependencies = [ "cc", "clap", @@ -3140,10 +3140,10 @@ dependencies = [ "incrementalmerkletree", "lazy_static", "libc", + "orchard", "pasta_curves", "rand 0.8.5", "shardtree", - "valar-orchard", "voting-circuits", ] @@ -3167,8 +3167,7 @@ dependencies = [ [[package]] name = "voting-circuits" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ce96b6c906e2df417f66e0bbef5d61ec0931d03e5951e7e36c5e292b17b40b" +source = "git+https://github.com/valargroup/voting-circuits.git?branch=valar%2Forchard-0.13#ec6d3adbe6928b5a52f3f0306dd3bcf7f1a8f514" dependencies = [ "blake2b_simd", "ff", @@ -3178,10 +3177,10 @@ dependencies = [ "halo2_proofs", "incrementalmerkletree", "lazy_static", + "orchard", "pasta_curves", "rand 0.8.5", "sinsemilla", - "valar-orchard", ] [[package]] @@ -3502,8 +3501,8 @@ dependencies = [ [[package]] name = "zcash_address" -version = "0.10.1" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +version = "0.11.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "bech32", "bs58", @@ -3515,8 +3514,8 @@ dependencies = [ [[package]] name = "zcash_encoding" -version = "0.3.0" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +version = "0.4.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "corez", "hex", @@ -3526,7 +3525,7 @@ dependencies = [ [[package]] name = "zcash_keys" version = "0.12.0" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "bech32", "blake2b_simd", @@ -3537,12 +3536,12 @@ dependencies = [ "group", "memuse", "nonempty", + "orchard", "rand_core 0.6.4", "sapling-crypto", "secrecy", "subtle", "tracing", - "valar-orchard", "zcash_address", "zcash_encoding", "zcash_protocol", @@ -3565,8 +3564,8 @@ dependencies = [ [[package]] name = "zcash_primitives" -version = "0.26.4" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +version = "0.27.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "blake2b_simd", "block-buffer 0.11.0-rc.3", @@ -3580,11 +3579,11 @@ dependencies = [ "jubjub", "memuse", "nonempty", + "orchard", "rand_core 0.6.4", "redjubjub", "sapling-crypto", "sha2 0.10.9", - "valar-orchard", "zcash_encoding", "zcash_note_encryption", "zcash_protocol", @@ -3594,8 +3593,8 @@ dependencies = [ [[package]] name = "zcash_protocol" -version = "0.7.2" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +version = "0.8.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "corez", "document-features", @@ -3632,8 +3631,8 @@ dependencies = [ [[package]] name = "zcash_transparent" -version = "0.6.4" -source = "git+https://github.com/valargroup/librustzcash?rev=6534482c1cc595f38e0aaa63c4c7c4689360d766#6534482c1cc595f38e0aaa63c4c7c4689360d766" +version = "0.7.0" +source = "git+https://github.com/zcash/librustzcash.git?rev=976efa76ca2195d693f373aeaa201a2c50b6e0ab#976efa76ca2195d693f373aeaa201a2c50b6e0ab" dependencies = [ "bip32", "bs58", @@ -3666,6 +3665,7 @@ dependencies = [ "hex", "incrementalmerkletree", "nonempty", + "orchard", "pasta_curves", "pczt", "pir-client", @@ -3675,7 +3675,6 @@ dependencies = [ "serde_json", "subtle", "thiserror 2.0.18", - "valar-orchard", "vote-commitment-tree", "vote-commitment-tree-client", "voting-circuits", diff --git a/Cargo.toml b/Cargo.toml index 2cb34afc..b0dd2125 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,12 @@ resolver = "2" # Single-source patches for the orchard 0.13 + librustzcash zcash/main migration. # -# - `orchard`: pin to the valargroup branch carrying orchard 0.13.0 + zcash/orchard -# PR #489 (SpendAuthG fixed-base multiplication). The same pin is used by every -# downstream consumer so the entire dep graph collapses to a single orchard node. +# - `orchard`: pin to the valargroup branch carrying orchard 0.13.0 plus the +# cherry-picks tracked by valargroup/orchard PR #19: +# * zcash/orchard PR #489 — SpendAuthG fixed-base multiplication, and +# * zcash/orchard PR #495 — `NoteValue::ZERO` public associated constant. +# The same pin is used by every downstream consumer so the entire dep graph +# collapses to a single orchard node. # - `voting-circuits`: pin to the matching valargroup branch (consumes the orchard # git pin above; published 0.2.0 still depends on the retired valar-orchard fork # and would create a duplicate orchard node in the graph). diff --git a/zcash_voting/Cargo.toml b/zcash_voting/Cargo.toml index 12d582ea..b027d6f2 100644 --- a/zcash_voting/Cargo.toml +++ b/zcash_voting/Cargo.toml @@ -42,9 +42,10 @@ thiserror = "2" # Single orchard node: every consumer (this crate, voting-circuits, and the # librustzcash crates we pin below) resolves `orchard` through the workspace's # `[patch.crates-io]` redirect to valargroup/orchard `valar/0.13-spend-auth-g` -# (orchard 0.13.0 + zcash/orchard PR #489). The `unstable-voting-circuits` -# feature is required by integration tests in `zkp1.rs` (`Note::new`, -# `Note::dummy`, `Rho::from_nf_old`). +# (orchard 0.13.0 + zcash/orchard #489 SpendAuthG + zcash/orchard #495 +# `NoteValue::ZERO`; tracked by valargroup/orchard PR #19). The +# `unstable-voting-circuits` feature is required by integration tests in +# `zkp1.rs` (`Note::new`, `Note::dummy`, `Rho::from_nf_old`). subtle = "2.6" orchard = { version = "0.13", features = ["unstable-voting-circuits"] } voting-circuits = { version = "0.2.0", features = ["share-reveal"] } diff --git a/zcash_voting/README.md b/zcash_voting/README.md index 03f71abd..1cdeb9be 100644 --- a/zcash_voting/README.md +++ b/zcash_voting/README.md @@ -21,12 +21,10 @@ See the [wallet integration guide](https://github.com/valargroup/vote-sdk/blob/m ## Dependency notes -`zcash_voting` depends on two Valar Group maintenance forks published on crates.io under `valar-*` names: +`zcash_voting` tracks the upstream Zcash crates directly: -- **`valar-orchard 0.11`** — fork of [`orchard`](https://github.com/zcash/orchard) adding governance-visibility methods needed by the voting circuits. -- **`valar-pczt 0.5`** — fork of [`pczt`](https://github.com/zcash/librustzcash) adding shielded-voting getters. - -Both are consumed via cargo's `package = "valar-*"` rename trick so consumer code writes `use orchard::…` and `use pczt::…` unchanged. These forks will be dropped once the changes land in upstream ECC releases. +- **`orchard 0.13`** — upstream [`zcash/orchard`](https://github.com/zcash/orchard), pinned via a `[patch.crates-io]` redirect to the `valargroup/orchard` `valar/0.13-spend-auth-g` branch (tracked by [valargroup/orchard PR #19](https://github.com/valargroup/orchard/pull/19)). That branch carries orchard 0.13.0 plus the `unstable-voting-circuits` feature gate that exposes the governance-visibility APIs, plus cherry-picks of [zcash/orchard #489](https://github.com/zcash/orchard/pull/489) (SpendAuthG fixed-base multiplication) and [zcash/orchard #495](https://github.com/zcash/orchard/pull/495) (`NoteValue::ZERO` public associated constant). Once both upstream PRs land and an `orchard 0.14` ships, this pin will collapse to the published crate. +- **`pczt`, `zcash_keys`, `zcash_primitives`, `zcash_protocol`, `zcash_address`, `zcash_encoding`, `zcash_transparent`** — pinned to a recent commit of upstream [`zcash/librustzcash`](https://github.com/zcash/librustzcash) `main`. The previous `valargroup/librustzcash` fork (with shielded-voting getters in PCZT and friends) has been fully retired now that the relevant PRs (#2281, #2283, #2284) have all merged upstream. ## License From 214163da9c204b1d5c45c0a96fc9d88b45a38315 Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 25 Apr 2026 02:17:41 -0300 Subject: [PATCH 3/7] Bump voting-circuits pin to 84726847 (latest valargroup/voting-circuits PR #20 head) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit valargroup/voting-circuits PR #20 was rewritten/force-pushed since the previous lockfile bump in this branch, so the `ec6d3adb` SHA the lock referenced is no longer reachable on the PR. Re-resolve the `branch = "valar/orchard-0.13"` patch entry and pick up the current two-commit PR head: voting-circuits ec6d3adb → 84726847 = valargroup/voting-circuits commits 1d5a455 Drop vendored valar-orchard 0.12 fork; depend on orchard 0.13 via git 8472684 Migrate to orchard 0.13 public APIs (NoteValue::ZERO, Nullifier accessors, local assign_constant) = https://github.com/valargroup/voting-circuits/pull/20 No source or Cargo.toml changes — strictly a lockfile pin bump so a fresh `cargo build` against this branch resolves to the actual head of the upstream PR rather than a force-pushed-out SHA. Verification: * `cargo check --tests --workspace --all-features` clean. * No drift between Cargo.toml [patch.crates-io] entries and the resolved [[package]] sources in Cargo.lock. Made-with: Cursor --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 37072330..21fdb460 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3167,7 +3167,7 @@ dependencies = [ [[package]] name = "voting-circuits" version = "0.2.0" -source = "git+https://github.com/valargroup/voting-circuits.git?branch=valar%2Forchard-0.13#ec6d3adbe6928b5a52f3f0306dd3bcf7f1a8f514" +source = "git+https://github.com/valargroup/voting-circuits.git?branch=valar%2Forchard-0.13#84726847c17add95cb55390c3d649b779adb0ebe" dependencies = [ "blake2b_simd", "ff", From 577d92049857fe30f4536aa0bdbdd50f65f05649 Mon Sep 17 00:00:00 2001 From: Greg Nagy Date: Sat, 25 Apr 2026 18:56:44 +0200 Subject: [PATCH 4/7] Fix stale public_inputs.len() assertion in test_real_delegation_proof The assertion was hardcoded to 12 in the test's initial commit, but the delegation circuit's `to_halo2_instance()` has produced 13 inputs since voting-circuits was split out of the monorepo, and 14 since the ZIP-1199 alignment commit added the `dom` public input (`Poseidon("governance authorization", vote_round_id)`) used by the alternate-nullifier hash. voting-circuits' own MockProver test in `delegation/circuit.rs` correctly asserts 14. The test is `#[ignore]`'d, so the stale assertion never tripped in CI; it surfaced when the orchard 0.13 / librustzcash zcash/main migration made the surrounding workspace build clean enough to actually run `--ignored` end-to-end again. The proof itself generates and verifies correctly under the new orchard 0.13 + voting-circuits PR #20 dep graph; only the count assertion needed adjusting. --- zcash_voting/src/zkp1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zcash_voting/src/zkp1.rs b/zcash_voting/src/zkp1.rs index 172a0b8a..430d11a7 100644 --- a/zcash_voting/src/zkp1.rs +++ b/zcash_voting/src/zkp1.rs @@ -868,8 +868,8 @@ mod tests { assert!(!result.proof.is_empty(), "proof bytes should be non-empty"); assert_eq!( result.public_inputs.len(), - 12, - "should have 12 public inputs" + 14, + "should have 14 public inputs" ); for (i, pi) in result.public_inputs.iter().enumerate() { assert_eq!(pi.len(), 32, "public_input[{i}] should be 32 bytes"); From 63eae822bee7aa5d294b0e1a518e86e43ffcd12c Mon Sep 17 00:00:00 2001 From: Greg Nagy Date: Sat, 25 Apr 2026 18:58:34 +0200 Subject: [PATCH 5/7] =?UTF-8?q?Bump=20halo2=5Fgadgets=200.3=20=E2=86=92=20?= =?UTF-8?q?0.4=20in=20zcash=5Fvoting=20and=20vote-commitment-tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligns this repo's direct deps with the rest of the migration: orchard 0.13 and voting-circuits PR #20 already use halo2_gadgets 0.4. After this bump, imt-tree 0.1.0 (transitive via vote-commitment-tree) is the only remaining 0.3 contributor in the lockfile — separate follow-up in vote-nullifier-pir. The bump is purely a Cargo.toml edit: the only halo2_gadgets surface this crate uses is `halo2_gadgets::poseidon::primitives::*`, which in both 0.3.1 and 0.4.0 is `pub use ::halo2_poseidon as primitives` — a re-export of the standalone halo2_poseidon 0.1.0 crate (single version in the graph). So the imported types are identical regardless of which halo2_gadgets we go through. --- Cargo.lock | 4 ++-- vote-commitment-tree/Cargo.toml | 2 +- zcash_voting/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21fdb460..889794c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3135,7 +3135,7 @@ version = "0.1.0" dependencies = [ "anyhow", "ff", - "halo2_gadgets 0.3.1", + "halo2_gadgets 0.4.0", "imt-tree", "incrementalmerkletree", "lazy_static", @@ -3660,7 +3660,7 @@ dependencies = [ "blake2b_simd", "ff", "group", - "halo2_gadgets 0.3.1", + "halo2_gadgets 0.4.0", "halo2_proofs", "hex", "incrementalmerkletree", diff --git a/vote-commitment-tree/Cargo.toml b/vote-commitment-tree/Cargo.toml index 9a1baa2a..55a93dff 100644 --- a/vote-commitment-tree/Cargo.toml +++ b/vote-commitment-tree/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" imt-tree = "0.1" pasta_curves = "0.5" ff = "0.13" -halo2_gadgets = { version = "0.3", default-features = false } +halo2_gadgets = { version = "0.4", default-features = false } anyhow = "1.0" incrementalmerkletree = "0.8.1" shardtree = "0.6" diff --git a/zcash_voting/Cargo.toml b/zcash_voting/Cargo.toml index b027d6f2..662e4adb 100644 --- a/zcash_voting/Cargo.toml +++ b/zcash_voting/Cargo.toml @@ -18,7 +18,7 @@ rand = "0.8" # Hashing blake2b_simd = "1" -halo2_gadgets = "0.3" +halo2_gadgets = "0.4" halo2_proofs = "0.3" # Serialization From ec46a9595119c4a2a5dcc9a4a3c1560c6411801c Mon Sep 17 00:00:00 2001 From: Greg Nagy Date: Sat, 25 Apr 2026 21:31:25 +0200 Subject: [PATCH 6/7] Bump imt-tree to 0.1.1 in lockfile imt-tree 0.1.1 (just published to crates.io) now depends on halo2_gadgets 0.4 instead of 0.3, matching the rest of the orchard 0.13 stack. Updating the lockfile drops the duplicate halo2_gadgets 0.3.1 we'd been pulling transitively through the older imt-tree 0.1.0 (vote-commitment-tree depends on imt-tree). --- Cargo.lock | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 889794c4..dc661e79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -976,26 +976,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "halo2_gadgets" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a5e510d58a07d8ed238a5a8a436fe6c2c79e1bb2611f62688bc65007b4e6e7" -dependencies = [ - "arrayvec", - "bitvec", - "ff", - "group", - "halo2_poseidon", - "halo2_proofs", - "lazy_static", - "pasta_curves", - "rand 0.8.5", - "sinsemilla", - "subtle", - "uint", -] - [[package]] name = "halo2_gadgets" version = "0.4.0" @@ -1352,13 +1332,13 @@ dependencies = [ [[package]] name = "imt-tree" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d10acb863735c6c82c0c79e8752696096a86eb4d1e2fe0005ded4fae066297e" +checksum = "c378a3c5c44b985233906c966bd82a4f775a83aa4e1bde1635961c2eb8673d7b" dependencies = [ "anyhow", "ff", - "halo2_gadgets 0.3.1", + "halo2_gadgets", "hex", "pasta_curves", "rayon", @@ -1781,7 +1761,7 @@ dependencies = [ "fpe", "getset", "group", - "halo2_gadgets 0.4.0", + "halo2_gadgets", "halo2_poseidon", "halo2_proofs", "hex", @@ -3135,7 +3115,7 @@ version = "0.1.0" dependencies = [ "anyhow", "ff", - "halo2_gadgets 0.4.0", + "halo2_gadgets", "imt-tree", "incrementalmerkletree", "lazy_static", @@ -3172,7 +3152,7 @@ dependencies = [ "blake2b_simd", "ff", "group", - "halo2_gadgets 0.4.0", + "halo2_gadgets", "halo2_poseidon", "halo2_proofs", "incrementalmerkletree", @@ -3660,7 +3640,7 @@ dependencies = [ "blake2b_simd", "ff", "group", - "halo2_gadgets 0.4.0", + "halo2_gadgets", "halo2_proofs", "hex", "incrementalmerkletree", From d7a0eb6350decad9a18c3e53c88ebb9f032961a9 Mon Sep 17 00:00:00 2001 From: Greg Nagy Date: Sat, 25 Apr 2026 21:32:39 +0200 Subject: [PATCH 7/7] Pin orchard and voting-circuits to merged main commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that valargroup/orchard PR #19 and valargroup/voting-circuits PR #20 are merged, repoint both from migration branches to the respective merge commits on main: - orchard → c26a6ec6 (PR #19 merge) - voting-circuits → 66777e27 (PR #20 merge) Retires the valar/0.13-spend-auth-g and valar/orchard-0.13 branch refs as manifest dependencies in favor of deterministic rev pins. --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc661e79..6ccebe65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1751,7 +1751,7 @@ dependencies = [ [[package]] name = "orchard" version = "0.13.0" -source = "git+https://github.com/valargroup/orchard.git?branch=valar%2F0.13-spend-auth-g#7fa213ae7057eb959e5aba4a4195d6ca2e26b252" +source = "git+https://github.com/valargroup/orchard.git?rev=c26a6ec6860cc62bb15d208c3d790dfb616bfbe7#c26a6ec6860cc62bb15d208c3d790dfb616bfbe7" dependencies = [ "aes", "bitvec", @@ -3147,7 +3147,7 @@ dependencies = [ [[package]] name = "voting-circuits" version = "0.2.0" -source = "git+https://github.com/valargroup/voting-circuits.git?branch=valar%2Forchard-0.13#84726847c17add95cb55390c3d649b779adb0ebe" +source = "git+https://github.com/valargroup/voting-circuits.git?rev=66777e27e10970c38dc1ebb93d8c7715a5b984c7#66777e27e10970c38dc1ebb93d8c7715a5b984c7" dependencies = [ "blake2b_simd", "ff", diff --git a/Cargo.toml b/Cargo.toml index b0dd2125..f4d8dff5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,8 @@ resolver = "2" # `main` HEAD now that all governance PRs (#2283, #2284, #2281) are merged # upstream — the valargroup/librustzcash fork is fully retired. [patch.crates-io] -orchard = { git = "https://github.com/valargroup/orchard.git", branch = "valar/0.13-spend-auth-g" } -voting-circuits = { git = "https://github.com/valargroup/voting-circuits.git", branch = "valar/orchard-0.13" } +orchard = { git = "https://github.com/valargroup/orchard.git", rev = "c26a6ec6860cc62bb15d208c3d790dfb616bfbe7" } +voting-circuits = { git = "https://github.com/valargroup/voting-circuits.git", rev = "66777e27e10970c38dc1ebb93d8c7715a5b984c7" } pczt = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" } zcash_encoding = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" }