Skip to content

Restore voting-stack [patch.crates-io] entries dropped during PR #25 port#28

Closed
p0mvn wants to merge 3 commits into
shielded-vote-2.4.10from
roman/restore-voting-stack-patches
Closed

Restore voting-stack [patch.crates-io] entries dropped during PR #25 port#28
p0mvn wants to merge 3 commits into
shielded-vote-2.4.10from
roman/restore-voting-stack-patches

Conversation

@p0mvn
Copy link
Copy Markdown

@p0mvn p0mvn commented Apr 26, 2026

Summary

Re-applies PR #25's Cargo.toml + Cargo.lock changes onto the current shielded-vote-2.4.10 HEAD, with all three voting-stack patches rev-pinned at the post-merge main tips of valargroup/orchard, valargroup/voting-circuits, and valargroup/zcash_voting.

When PR #25 ("Migrate libzcashlc to orchard 0.13 + librustzcash zcash/main") was force-ported into this base instead of being merged, two of its three voting-stack [patch.crates-io] entries were dropped and the orchard patch was re-pointed at the wrong source. As a result the FFI build fails on every PR against shielded-vote-2.4.10 (e.g. PR #27 run #146, PR #24 run #143).

Why does the build fail today?

The dep graph on shielded-vote-2.4.10 HEAD currently resolves to three different orchard versions simultaneously:

orchard resolved as Source on base today Pulled in by
0.11.0 (crates.io) published crate zcash_voting 0.1.0 (crates.io — no patch entry)
0.12.0 (zcash/orchard rev 6b12c77) the [patch.crates-io] orchard line on this base librustzcash crates via the patch
0.13.0 (crates.io) published crate libzcashlc's direct orchard = "0.13" dep (no patch matched, since the patch resolves to a 0.12 rev)

Compiler output:

error[E0277]: the trait bound
    `zcash_primitives::consensus::TestNetwork:
     zcash_protocol::consensus::Parameters` is not satisfied
   --> .../zcash_voting-0.1.0/src/zkp2.rs:224:44
note: there are multiple different versions of crate `zcash_protocol`
      in the dependency graph

error[E0308]: mismatched types
   --> .../zcash_voting-0.1.0/src/zkp2.rs:247:71
expected `orchard::keys::SpendingKey`,
found a different `orchard::keys::SpendingKey`
note: there are multiple different versions of crate `orchard`
      in the dependency graph

error: could not compile `zcash_voting` (lib) due to 5 previous errors

The workspace .wiring/states/current/zcash-swift-wallet-sdk.patch already assumes the three voting-stack patch entries this PR restores exist on the upstream side, so today mise run wire:local against a clean checkout would also fail to apply.

What this PR does

Cargo.toml:

 [patch.crates-io]
-orchard = { package = "orchard", git = "https://github.com/zcash/orchard.git", rev = "6b12c77260aa7fac0d804983fc31b71b584d48e0" }
+orchard         = { git = "https://github.com/valargroup/orchard.git",         rev = "c26a6ec6860cc62bb15d208c3d790dfb616bfbe7" }
+voting-circuits = { git = "https://github.com/valargroup/voting-circuits.git", rev = "66777e27e10970c38dc1ebb93d8c7715a5b984c7" }
+zcash_voting    = { git = "https://github.com/valargroup/zcash_voting.git",    rev = "d351e9dc13baa623b95883e0815b194358604c54" }
 pczt = { git = "https://github.com/zcash/librustzcash.git", rev = "976efa76ca2195d693f373aeaa201a2c50b6e0ab" }
 # ...librustzcash entries unchanged...

Cargo.lock: regenerated from scratch against the new patch entries. Diff is large because it's the first lockfile commit since the major version bumps in 9dae462a collided with the missing patches.

After this PR, the lockfile resolves to a single version of every voting-stack crate:

Crate Resolved rev Source
orchard 0.13.0 c26a6ec6 valargroup/orchard main (= PR #19 merged — orchard 0.13.0 + cherry-picks of zcash/orchard #489 + #495)
voting-circuits 0.2.0 66777e27 valargroup/voting-circuits main (= PR #20 merged)
zcash_voting 0.1.0 d351e9dc valargroup/zcash_voting main (= PR #22 merged)

The orchard rev (c26a6ec6) is chosen to match what voting-circuits at 66777e27 internally pins to (its 05f98aa "Pin orchard to valargroup/orchard main" commit). Without this alignment, libzcashlc's direct orchard dep and voting-circuits' transitive orchard dep would resolve to two separate git sources and zcash_voting would once again see "expected SpendingKey, found a different SpendingKey".

Test plan

  • cargo generate-lockfile resolves successfully.
  • cargo check --target aarch64-apple-darwin clean (no warnings).
  • No stale orchard 0.11, orchard 0.12, valar-orchard, voting-circuits 0.1.0, zcash_voting 0.1.0 (crates.io) leftovers in Cargo.lock — single version of every voting-stack crate.
  • Cargo.toml [patch.crates-io] ↔ resolved [[package]] sources in Cargo.lock are in sync.
  • CI green (this PR's build job is the actual end-to-end verification).

What this unblocks

Every open PR currently red on shielded-vote-2.4.10's build job, including:

Made with Cursor

greg0x added 2 commits April 26, 2026 00:24
A bundle of changes that depend on the valargroup forks. Grouped
under one [REVERT_ME] commit so the whole overlay can be reverted
in one step once the upstream story is complete.

The overlay covers:

* Cargo.toml — patches orchard, voting-circuits, and zcash_voting
  at specific valargroup main revs. Unblock: zcash/orchard PRs zcash#489
  and zcash#495 land upstream and ship in the next orchard release;
  voting-circuits and zcash_voting then publish versions that
  depend on it and the patches go away.

* Package.swift — points the binaryTarget at the valargroup fork's
  xcframework release that bundles the voting FFI symbols, plus a
  SystemConfiguration linker setting macOS builds need.

* Scripts/{prepare,publish}-fork-release.sh — automate the fork
  xcframework build + GitHub release + Package.swift binaryTarget
  rewrite, so a fork release PR can land with zero Rust setup for
  reviewers. publish-fork-release.sh refuses to run when
  Package.swift is wired local.

* Scripts/rebuild-local-ffi.sh — adds an ios-all target so a
  single run produces both device and simulator arm64 slices in
  one xcframework.
…port

When PR #25 ("Migrate libzcashlc to orchard 0.13 + librustzcash zcash/main")
was force-ported into `shielded-vote-2.4.10` instead of being merged, two
of the three voting-stack `[patch.crates-io]` entries were dropped and the
`orchard` patch was re-pointed at the wrong source. Result: the FFI build
fails on every PR against this base because the dep graph contains
**three different `orchard` versions simultaneously**:

  orchard 0.11.0 (crates.io)  ← pulled in by `zcash_voting 0.1.0`
                                (crates.io, no patch)
  orchard 0.12.0 (zcash/orchard rev 6b12c77)
                              ← from the broken `[patch.crates-io] orchard`
                                entry pointing at upstream `zcash/orchard`
                                instead of `valargroup/orchard`
  orchard 0.13.0 (crates.io)  ← libzcashlc's direct dep (no patch matched
                                because the patch resolves to 0.12)

Producing:

    error[E0277]: the trait bound
        `zcash_primitives::consensus::TestNetwork:
         zcash_protocol::consensus::Parameters`
        is not satisfied
    error[E0308]: mismatched types
        expected `orchard::keys::SpendingKey`,
        found a different `orchard::keys::SpendingKey`
    note: there are multiple different versions of crate `orchard` in the
          dependency graph

inside `zcash_voting-0.1.0/src/zkp2.rs` and `orchard_compat.rs`.

This commit restores the `[patch.crates-io]` block to a self-consistent
single-version graph, with all three voting-stack crates rev-pinned at
the post-merge `main` tips (so the resolved dep graph is reproducible
across rebuilds even as `main` advances):

  orchard          c26a6ec6  valargroup/orchard          main
                             = orchard 0.13.0 + cherry-picks of
                               zcash/orchard zcash#489 (SpendAuthG fixed-base)
                               + zcash#495 (NoteValue::ZERO)
                               (= valargroup/orchard PR #19, merged)
  voting-circuits  66777e27  valargroup/voting-circuits  main
                             = drop vendored valar-orchard, port to
                               orchard 0.13 public APIs
                               (= valargroup/voting-circuits PR #20, merged;
                                internally pins orchard to c26a6ec6)
  zcash_voting     d351e9dc  valargroup/zcash_voting     main
                             = zcash_voting / vote-commitment-tree[-client]
                               on orchard 0.13 + librustzcash zcash/main
                               (= valargroup/zcash_voting PR #22, merged)

The orchard rev (c26a6ec6) is chosen to match what voting-circuits at
66777e27 internally pins to (its `05f98aa` "Pin orchard to valargroup/
orchard main" commit), so cargo collapses libzcashlc's direct orchard
dep and voting-circuits' transitive orchard dep into a single source.

The previous `[patch.crates-io] orchard` entry pointing at `zcash/orchard`
rev `6b12c77` is dropped — plain upstream `orchard 0.12.0` is incompatible
with the rest of the orchard-0.13 voting stack.

Verification:

* `cargo check --target aarch64-apple-darwin` clean.
* `Cargo.lock` resolves to **one** version each of `orchard`,
  `voting-circuits`, `zcash_voting`, `zcash_protocol`, `zcash_primitives`
  (no stale `valar-orchard` rename left in the graph either).
* No drift between `Cargo.toml` `[patch.crates-io]` entries and the
  resolved `[[package]]` sources in `Cargo.lock`.

Made-with: Cursor
@p0mvn p0mvn force-pushed the roman/restore-voting-stack-patches branch from 3911f38 to c9ab79d Compare April 26, 2026 03:40
@greg0x greg0x force-pushed the shielded-vote-2.4.10 branch from 6678f6e to 8ccd2f9 Compare April 26, 2026 14:33
@p0mvn p0mvn force-pushed the shielded-vote-2.4.10 branch from 8ccd2f9 to 8ee7106 Compare April 26, 2026 22:00
@p0mvn p0mvn closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants