Wire zcash_voting + tree crates for crates.io publish#19
Merged
Conversation
Prep work so vote-commitment-tree, vote-commitment-tree-client, and
zcash_voting can all be published to crates.io. Key changes:
- Rewire every git-dep to its published crates.io equivalent:
pir-client 0.1.0, voting-circuits 0.1.0, valar-pczt 0.5.1 (package
rename of pczt), and the two sibling tree crates via path + version.
- Delete the workspace [patch.crates-io] block — the pinned librustzcash
rev and voting-circuits git ref are superseded by the published
valar-* forks. crates.io forbids patch-on-publish anyway.
- Add required publish metadata (description / license / repository /
readme) and LICENSE-{MIT,APACHE} at repo root. README per crate.
Dual orchard in zcash_voting
----------------------------
zcash_voting sits at a dep-graph boundary: voting-circuits's public API
takes valar-orchard types (governance-visibility methods), while
zcash_keys, valar-pczt internals, and zcash_primitives all expose
upstream orchard types. Cargo sees them as two distinct crates by
package name, so a single `use orchard::…` can't satisfy both callsites.
Fix: declare both as separate Cargo.toml entries —
orchard = valar-orchard 0.11.0 (package rename)
orchard_upstream = orchard 0.11.0 (package rename)
— and add zcash_voting/src/orchard_compat.rs with byte-round-trip
helpers (fvk/sk). Safe because valar-orchard is a pure superset of
upstream orchard with identical wire formats. Conversions happen only
at the zcash_keys boundary (zkp1 reconstruct_note, zkp2
derive_spending_key). action.rs uses orchard_upstream throughout since
it builds a bundle for PcztParts which is upstream-typed.
Drop orchard_upstream + orchard_compat.rs when the valar
governance-visibility changes land in zcash/orchard upstream.
Verified: cargo check --workspace --all-targets clean; 84/84 lib tests
pass.
p0mvn
added a commit
that referenced
this pull request
Apr 25, 2026
…voting-circuits PR #20 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
greg0x
added a commit
that referenced
this pull request
Apr 25, 2026
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.
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.
Summary
Phase 4 prep: make
vote-commitment-tree,vote-commitment-tree-client, andzcash_votingpublishable on crates.io now that all upstream dependencies (pir-client,voting-circuits,valar-orchard,valar-pczt) have been published.What changed
Dep rewiring (the headline — required for publish):
pir-client0.1.0 (was git rev)voting-circuits0.1.0 (was gitHEAD)pczt→valar-pczt0.5.1 (package rename; was git rev pinned tolibrustzcashfork)path + versionpairs so crates.io resolves the version while dev builds stay local.[patch.crates-io]block — the pinnedlibrustzcashrev +voting-circuitsgit ref are superseded by the publishedvalar-*forks, and crates.io doesn't let published crates carry a patch table anyway.Metadata for publish:
description/license(MIT OR Apache-2.0) /repository/readmekeys added to all three crates'Cargo.toml.LICENSE-MIT+LICENSE-APACHEat repo root.README.mddescribing purpose + usage snippet.Dual orchard in zcash_voting — the subtle bit:
zcash_votingsits at a dep-graph boundary where it consumes upstream orchard types (fromzcash_keys,valar-pcztinternals,zcash_primitives) and produces valar-orchard types (consumed byvoting-circuits, which needs the governance-visibility methods we added). Cargo distinguishes these two crates by package name, so a singleuse orchard::…line can't satisfy both callsites.Attempted but ruled out:
[patch.crates-io] orchard = { git=…, package = "valar-orchard" }— would need a second patch forvalar-orchardtoo, which cargo rejects as "two patches resolve to the same result".UnifiedSpendingKey::orchard()returns upstreamSpendingKey; we can't make zcash_keys return valar types without cascade-forking zcash_keys, zcash_primitives, etc.pub(crate) → pubvisibility changes not present upstream.Implementation:
package =rename trick:orchard→valar-orchard0.11.0 (for voting-circuits callsites)orchard_upstream→ upstreamorchard0.11.0 (for zcash_keys / zcash_primitives / PcztParts)zcash_voting/src/orchard_compat.rswith two byte-round-trip helpers (fvk_upstream_to_valar,sk_upstream_to_valar). Safe because valar-orchard is a pure superset of upstream with identical wire formats — the helpers goto_bytes()→from_bytes().zkp1.rs::reconstruct_note+zkp2.rs::derive_spending_key.action.rsusesorchard_upstreamthroughout because it builds a bundle that plugs intoPcztParts.orchard(upstream-typed). Uses only standard orchard APIs, no governance-visibility methods needed.Exit plan: when the valar-orchard visibility changes land in
zcash/orchardupstream, droporchard_upstream+orchard_compat.rs, pointorchardat upstream directly. Clean exit.Test plan
cargo check --workspace --all-targetsclean (no warnings)cargo test --workspace --lib— 84/84 pass (long-running Halo2 proof testtest_real_delegation_proofskipped per normal)cargo publish --dry-run -p vote-commitment-treethen-p vote-commitment-tree-clientthen-p zcash_voting)