voting-circuits: orchard 0.13 migration#20
Merged
Merged
Conversation
Removes the entire orchard/ subdirectory (the vendored valar-orchard 0.12.0 fork that exposed internal APIs needed by these circuits). Switches the orchard dependency in voting-circuits to a git pin against valargroup/orchard's valar/0.13-spend-auth-g branch (= orchard 0.13.0 + PR #488 visibility-widening + PR #489 SpendAuthG fixed-base multiplication), with the new "unstable-voting-circuits" feature enabled in place of the vendored fork's blanket pub-visibility hacks. Upstream orchard 0.13 added the unstable-voting-circuits feature flag that exposes the same internals (assign_free_advice, AddInstruction, add_chip, commit_ivk, etc.) we previously got by maintaining our own orchard fork in-tree, so the vendored copy is now redundant. Made-with: Cursor
…sors, local assign_constant) Catches voting-circuits up to the rest of the orchard 0.13 + valargroup PR #19 surface area. The previous "Drop vendored valar-orchard fork" commit only flipped the dependency edge over to orchard 0.13 via git; this commit ports the call sites to the public APIs that orchard 0.13 exposes (or, in one case, replicates locally) instead of poking at private fields: * `Nullifier(rho)` → `Nullifier::from_inner(rho)` `nf.0` → `nf.inner()` The `Nullifier` tuple field is no longer accessible from outside the orchard crate; the new public `from_inner` constructor and `inner` accessor are the supported way in. * `NoteValue::zero()` → `NoteValue::ZERO` `NoteValue::zero()` was crate-private in orchard 0.13.0 and stays that way. valargroup/orchard PR #19 stacks zcash/orchard #495 on top of the SpendAuthG branch, which retires `zero()` in favour of a `pub const ZERO: Self = NoteValue(0);` associated constant. All 9 zero-value sites in the delegation builder/circuit (plus the signed-note-commitment-integrity plan markdown) are migrated to the constant. * `orchard::circuit::gadget::assign_constant` is no longer re-exported by orchard 0.13 (it lives under module-private paths). Move our local copy into `crate::circuit::gadget::assign_constant`; the helper is generic halo2 plumbing (load a constant into a free advice cell so it's baked into the verifier key) with no orchard-specific dependencies, so it belongs here anyway. The README is updated to drop the "depends on valar-orchard" wording and explain the current pin: orchard 0.13 + valargroup/orchard PR #19, which carries cherry-picks of zcash/orchard #489 (SpendAuthG fixed-base multiplication) and zcash/orchard #495 (`NoteValue::ZERO`). The pin collapses back to the published crate once both upstream PRs land and an orchard 0.14 ships. Cargo.lock is regenerated against the orchard 0.13 git pin (lock now references commit 7fa213ae7057eb959e5aba4a4195d6ca2e26b252, the head of `valar/0.13-spend-auth-g` / valargroup/orchard PR #19). Verification: * `cargo build --tests --benches --all-features` — clean (only the three pre-existing dead-code warnings in vote_proof::authority_decrement test scaffolding). * No `NoteValue::zero(`, `_nf.0`, or `Nullifier(` constructor calls remain in `src/`. * Downstream consumers (zcash_voting, vote-sdk circuits + e2e-tests, zcash-swift-wallet-sdk libzcashlc) all `cargo check` clean against this voting-circuits + orchard combination. Made-with: Cursor
p0mvn
commented
Apr 25, 2026
| @@ -8,7 +8,7 @@ repository = "https://github.com/valargroup/voting-circuits" | |||
| readme = "README.md" | |||
|
|
|||
| [dependencies] | |||
| orchard = { path = "../orchard", version = "0.12.0", package = "valar-orchard", features = ["circuit"] } | |||
| orchard = { git = "https://github.com/valargroup/orchard.git", branch = "valar/0.13-spend-auth-g", features = ["circuit", "unstable-voting-circuits"] } | |||
This was referenced Apr 25, 2026
ec6d3ad to
8472684
Compare
p0mvn
added a commit
to valargroup/zcash_voting
that referenced
this pull request
Apr 25, 2026
…ts PR #20 head) 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) = valargroup/voting-circuits#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
Closed
6 tasks
greg0x
approved these changes
Apr 25, 2026
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.
Now that valargroup/orchard PR #19 is merged, repoint from the migration branch valar/0.13-spend-auth-g to the merge commit on main. This retires the migration branch as a manifest dependency and gives a deterministic rev pin instead of a moving branch tip.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Catches voting-circuits up to the rest of the orchard 0.13 + valargroup/orchard PR #19 surface area.
Builds on top of #16 (
valar/orchard-0.13)'s "Drop vendored valar-orchard 0.12 fork" commit, which only flipped the dependency edge over to orchard 0.13 via git. This PR ports the call sites to the public APIs orchard 0.13 exposes (or, in one case, replicates locally) instead of poking at private fields.Why
orchard 0.13 closed off the private fields/constructors we used to reach into via the vendored
valar-orchardfork. Combined with PR #19 stacking zcash/orchard #495 (NoteValue::ZERO) on top of zcash/orchard #489 (SpendAuthG fixed-base multiplication), we now have a clean public-API path for everything we need:Nullifier(rho)Nullifier::from_inner(rho)nf.0nf.inner()NoteValue::zero()NoteValue::ZEROorchard::circuit::gadget::assign_constantcrate::circuit::gadget::assign_constant(local copy — generic halo2 plumbing)Changes
src/delegation/builder.rs—Nullifier::from_inner/inner()(4 sites),NoteValue::ZERO(5 sites).src/delegation/circuit.rs—Nullifier::from_inner/inner()(8 sites),NoteValue::ZERO(4 sites), importassign_constantfrom local module instead oforchard::circuit::gadget.src/delegation/prove.rs— onenf.0→nf.inner()in test scaffolding.src/circuit/gadget.rs(new) — localassign_constanthelper (generic halo2 plumbing for baking a constant into a free advice cell so it's pinned in the verifier key). Has no orchard-specific dependencies, so a self-contained copy is the right home.src/circuit/mod.rs— export the newgadgetmodule.src/delegation/plans/signed_note_commitment_integrity_*.plan.md— update doc examples to match the new constant.README.md— drop the "depends onvalar-orchard" wording, document the orchard 0.13 + PR Rename valar-orchard back to orchard, bump to 0.12.1 #19 pin and the path back to the published crate once both upstream PRs land and anorchard 0.14ships.Cargo.lock— regenerated against the orchard 0.13 git pin. Locks to commit7fa213ae7057eb959e5aba4a4195d6ca2e26b252(head ofvalar/0.13-spend-auth-g, i.e. PR Rename valar-orchard back to orchard, bump to 0.12.1 #19 tip).The orchard pin in
Cargo.tomlis unchanged — the existinggit = "https://github.com/valargroup/orchard.git", branch = "valar/0.13-spend-auth-g"already follows the PR #19 branch HEAD;Cargo.lockjust advanced to the new tip.Verification
cargo build --tests --benches --all-features— clean. Only the three pre-existing dead-code warnings invote_proof::authority_decrementtest scaffolding.cargo test --tests --benches --all-features --no-run— all test binaries link.rg 'NoteValue::zero\(|_nf\.0|Nullifier\(' src/— empty (no remaining private-API uses).cargo checkclean against this voting-circuits + orchard combination, in the umbrella workspace:zcash_votingvote-sdk/circuitsvote-sdk/e2e-testszcash-swift-wallet-sdk(libzcashlc)Test plan
cargo test --release -p voting-circuits(Halo2 proving tests are slow in dev profile, intentionally not blocking the local sweep).zcash_voting,vote-sdk,zcash-swift-wallet-sdk) still passcargo testafter this lands.Follow-ups
Once zcash/orchard #489 and #495 merge and a published
orchard 0.14ships, drop the[patch.crates-io]orchard pin in this repo's downstream consumers and bumpvoting-circuitsto depend onorchard = "0.14"directly.Made with Cursor