From fa716979f36f943686f9924823066efe7e33d40c Mon Sep 17 00:00:00 2001 From: roman Date: Fri, 24 Apr 2026 17:24:53 -0300 Subject: [PATCH] Bump valar-orchard to 0.12 and voting-circuits to 0.2 voting-circuits 0.2.0 is the first release that depends on valar-orchard 0.12, which carries the post-0.12.0 upstream-orchard fixes plus the governance-visibility additions that the shielded-voting Halo 2 circuits need. Staying on 0.11 leaves this crate out of step with the rest of the shielded-voting stack (vote-sdk/circuits is already on 0.12/0.2, and the librustzcash fork is moving behind valargroup/librustzcash#42), and produces duplicate valar-orchard nodes in any consumer that pulls in both. voting-circuits 0.2.0 gates share_reveal behind a feature flag that it did not enforce in 0.1.0, so the feature is requested explicitly for the existing share_tracking code path. The orchard_compat byte-round-trip bridge and the orchard_upstream dep on upstream orchard 0.11 stay in place: crates.io zcash_keys 0.12.0 and valar-pczt 0.5.1 still pin upstream orchard ^0.11, so the two-orchard problem is not yet gone. FullViewingKey and SpendingKey wire formats did not change between upstream orchard 0.11 and 0.12, so the bridge is still correct; the doc comment is tightened to say so explicitly. Collapse this bridge (and orchard_upstream) once the librustzcash fork republishes zcash_keys/valar-pczt on top of valar-orchard. halo2_proofs 0.3.0 -> 0.3.2 in Cargo.lock is forced by the halo2_gadgets 0.4.0 that valar-orchard 0.12 and voting-circuits 0.2.0 pull in: it references Error::IllegalHashFromPrivatePoint, which was only added in halo2_proofs 0.3.2. Verified: - cargo check --workspace --all-features --tests -> OK - cargo test --workspace --all-features -> 84 passed, 1 ignored (same ignored test as main), including the vote_commitment_tree <-> voting-circuits Poseidon cross-validation tests that anchor the halo2_gadgets 0.3.1 / 0.4.0 coexistence to the same halo2_poseidon output. Made-with: Cursor --- Cargo.lock | 64 ++++++++++++++++++++++++------ vote-commitment-tree/Cargo.toml | 4 +- zcash_voting/Cargo.toml | 8 ++-- zcash_voting/src/orchard_compat.rs | 12 +++--- 4 files changed, 65 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86e23913..7d1c2d0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -980,7 +980,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap", + "indexmap 2.14.0", "slab", "tokio", "tokio-util", @@ -1007,6 +1007,26 @@ dependencies = [ "uint", ] +[[package]] +name = "halo2_gadgets" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45824ce0dd12e91ec0c68ebae2a7ed8ae19b70946624c849add59f1d1a62a143" +dependencies = [ + "arrayvec", + "bitvec", + "ff", + "group", + "halo2_poseidon", + "halo2_proofs", + "lazy_static", + "pasta_curves", + "rand 0.8.5", + "sinsemilla", + "subtle", + "uint", +] + [[package]] name = "halo2_legacy_pdqsort" version = "0.1.0" @@ -1027,20 +1047,27 @@ dependencies = [ [[package]] name = "halo2_proofs" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b867a8d9bbb85fca76fff60652b5cd19b853a1c4d0665cb89bee68b18d2caf0" +checksum = "05713f117155643ce10975e0bee44a274bcda2f4bb5ef29a999ad67c1fa8d4d3" dependencies = [ "blake2b_simd", "ff", "group", "halo2_legacy_pdqsort", + "indexmap 1.9.3", "maybe-rayon", "pasta_curves", "rand_core 0.6.4", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.15.5" @@ -1342,7 +1369,7 @@ checksum = "7d10acb863735c6c82c0c79e8752696096a86eb4d1e2fe0005ded4fae066297e" dependencies = [ "anyhow", "ff", - "halo2_gadgets", + "halo2_gadgets 0.3.1", "hex", "pasta_curves", "rayon", @@ -1357,6 +1384,16 @@ dependencies = [ "either", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.14.0" @@ -1756,7 +1793,7 @@ dependencies = [ "fpe", "getset", "group", - "halo2_gadgets", + "halo2_gadgets 0.3.1", "halo2_poseidon", "halo2_proofs", "hex", @@ -3013,9 +3050,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valar-orchard" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45d5f9db2dc2fa6f9f61de23fbbee163eed2a92c06395b18f7406e38c6af4f8" +checksum = "0415fc8aba029019c974bb0b0cc47e0bca53a27fdc2da263a2e6c99c9b3727f8" dependencies = [ "aes", "bitvec", @@ -3025,7 +3062,7 @@ dependencies = [ "fpe", "getset", "group", - "halo2_gadgets", + "halo2_gadgets 0.4.0", "halo2_poseidon", "halo2_proofs", "hex", @@ -3035,6 +3072,7 @@ dependencies = [ "nonempty", "pasta_curves", "rand 0.8.5", + "rand_core 0.6.4", "reddsa", "serde", "sinsemilla", @@ -3145,7 +3183,7 @@ version = "0.1.0" dependencies = [ "anyhow", "ff", - "halo2_gadgets", + "halo2_gadgets 0.3.1", "imt-tree", "incrementalmerkletree", "lazy_static", @@ -3176,14 +3214,14 @@ dependencies = [ [[package]] name = "voting-circuits" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "635228062a71424eaecb4c3407bced117e9573ab32258d1e56b6f03ba2678a45" +checksum = "92ce96b6c906e2df417f66e0bbef5d61ec0931d03e5951e7e36c5e292b17b40b" dependencies = [ "blake2b_simd", "ff", "group", - "halo2_gadgets", + "halo2_gadgets 0.4.0", "halo2_poseidon", "halo2_proofs", "incrementalmerkletree", @@ -3687,7 +3725,7 @@ dependencies = [ "blake2b_simd", "ff", "group", - "halo2_gadgets", + "halo2_gadgets 0.3.1", "halo2_proofs", "hex", "incrementalmerkletree", diff --git a/vote-commitment-tree/Cargo.toml b/vote-commitment-tree/Cargo.toml index 69b09a1a..d82b0536 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.11.0", package = "valar-orchard" } -voting-circuits = "0.1.0" +orchard = { version = "0.12.0", package = "valar-orchard" } +voting-circuits = "0.2.0" diff --git a/zcash_voting/Cargo.toml b/zcash_voting/Cargo.toml index a23076a8..0f8eafeb 100644 --- a/zcash_voting/Cargo.toml +++ b/zcash_voting/Cargo.toml @@ -42,11 +42,13 @@ thiserror = "2" # Dual orchard: voting-circuits takes valar-orchard in its public API; zcash_keys, # valar-pczt, and zcash_primitives expose upstream orchard. Both must be namable # here until the valar visibility changes land in zcash/orchard upstream; -# orchard_compat.rs bridges them via byte-round-trip (wire formats are identical). +# orchard_compat.rs bridges them via byte-round-trip (FullViewingKey and +# SpendingKey wire formats are unchanged across the 0.11 → 0.12 bump and +# between upstream orchard and valar-orchard). subtle = "2.6" -orchard = { version = "0.11.0", package = "valar-orchard" } +orchard = { version = "0.12.0", package = "valar-orchard" } orchard_upstream = { version = "0.11.0", package = "orchard" } -voting-circuits = "0.1.0" +voting-circuits = { version = "0.2.0", features = ["share-reveal"] } zcash_keys = { version = "0.12", features = ["orchard"] } zcash_protocol = "0.7" nonempty = "0.11" diff --git a/zcash_voting/src/orchard_compat.rs b/zcash_voting/src/orchard_compat.rs index 433efff2..6be8b04f 100644 --- a/zcash_voting/src/orchard_compat.rs +++ b/zcash_voting/src/orchard_compat.rs @@ -1,10 +1,12 @@ //! Byte-round-trip conversions between upstream orchard and valar-orchard types. //! -//! valar-orchard is a pure superset of upstream orchard 0.11 — same wire -//! formats, additive governance-visibility methods only. Conversions here -//! serialize through the public byte APIs and cannot fail for well-formed -//! inputs. Delete this module (and the `orchard_upstream` dep) when the -//! governance-visibility changes land in zcash/orchard upstream. +//! valar-orchard 0.12 is a pure superset of upstream orchard 0.12 with the +//! governance-visibility additions, and the `FullViewingKey` / `SpendingKey` +//! wire formats are unchanged all the way back to upstream orchard 0.11 — no +//! key-format-affecting changes landed between 0.11 and 0.12. The conversions +//! here serialize through the public byte APIs and cannot fail for +//! well-formed inputs. Delete this module (and the `orchard_upstream` dep) +//! when the governance-visibility changes land in zcash/orchard upstream. pub fn fvk_upstream_to_valar( upstream: &orchard_upstream::keys::FullViewingKey,