Skip to content

Resolve orchard via valar-orchard on crates.io (rebased onto PR #40)#41

Merged
p0mvn merged 2 commits into
roman/shielded-vote-for-zodl-3.4.0-rebasedfrom
roman/orchard-use-valar-orchard-on-40
Apr 24, 2026
Merged

Resolve orchard via valar-orchard on crates.io (rebased onto PR #40)#41
p0mvn merged 2 commits into
roman/shielded-vote-for-zodl-3.4.0-rebasedfrom
roman/orchard-use-valar-orchard-on-40

Conversation

@p0mvn
Copy link
Copy Markdown

@p0mvn p0mvn commented Apr 24, 2026

Remake of #39 rebased onto the head of #40 (roman/shielded-vote-for-zodl-3.4.0-rebased).

Same single commit, same logical change — swap the workspace-level orchard dep from the crates.io orchard package (patched to zcash/orchard git rev b0bf2670e2…, which is #40's current patch) to the valar-orchard package on crates.io, aliased locally to orchard via cargo's package = rename trick. Every member keeps orchard.workspace = true and every .rs file keeps use orchard::… — no source changes.

Why rebase it

#40 is already rebased onto upstream zcash/main at 95b000e (pre-orchard 0.13 / sapling-crypto 0.7), which picked up:

Mechanically, the rebase was just a cherry-pick with a single manual resolution in [patch.crates-io]:

Cargo.lock was regenerated from scratch via cargo check --workspace against the new Cargo.toml.

Cargo.toml changes

# [workspace.dependencies]
-orchard = { version = "0.12", default-features = false }
+orchard = { version = "0.12.0", package = "valar-orchard", default-features = false }

 [patch.crates-io]
 sapling = { package = "sapling-crypto", git = "", rev = "b8a81c22f034…" }  # unchanged
-orchard = { package = "orchard", git = "https://github.com/zcash/orchard.git", rev = "b0bf2670e2…" }
+# No orchard patch: the workspace resolves `orchard` via its `package = "valar-orchard"`
+# alias on crates.io, which already carries the post-0.12.0 upstream fixes plus the
+# governance-visibility additions.

Verification

  • cargo check --workspace — clean.
  • cargo tree --all-features | grep -E 'orchard|corez' now shows only valar-orchard v0.12.0 and corez v0.1.1; no orchard v0.12.x and no git+https://github.com/zcash/orchard.git entry.
  • Lockfile diff: orchard 0.12.0@git:b0bf2670e2… is removed, valar-orchard 0.12.0 from crates.io is added, and every consumer (pczt, zcash, zcash_client_backend, zcash_client_memory, zcash_client_sqlite, zcash_keys, zcash_primitives, zcash_proofs) now lists valar-orchard in place of orchard.

Known CI failures on this PR (carried over from #39, addressed separately)

The "Vet Rust dependencies" (cargo vet --locked) and "Readme dependency graph" jobs will fail on this PR for the same reasons they fail on #39 — they need:

  1. A [[exemptions.valar-orchard]] version = "0.12.0" criteria = "safe-to-deploy" entry in supply-chain/config.toml (corez is already covered by the upstream core2 → corez migration commit on Governance wallet support for shielded voting (rebased onto 95b000e, pre-orchard 0.13) #40's base).
  2. A 4-line remap in .github/helpers/check-dep-graph.py so cargo tree's valar-orchard package name maps back to orchard for the README graph comparison.

Both are trivial and I can layer them on as follow-up commits on this branch if you want one green-CI PR; keeping them out here to mirror #39's scope exactly.

The pre-existing core2 yank failures on the three ci-build jobs (macOS-latest, wasm32-wasip1, thumbv7em-none-eabihf) are not caused by this PR and also affect #40's base.

Related

Made with Cursor

p0mvn added 2 commits April 24, 2026 16:21
Changes the workspace-level `orchard` dep from the crates.io `orchard`
package (patched to zcash/orchard git rev 6b12c77) to the
`valar-orchard` package on crates.io, aliased locally to `orchard` via
cargo's `package =` rename trick. Every member keeps its existing
`orchard.workspace = true` line and its source-level `use orchard::…`
imports — no other changes needed.

Why
---
`valar-orchard` is upstream 0.12.0 + the same post-release fixes up to
zcash/orchard 6b12c77 that the previous `[patch.crates-io] orchard`
entry pointed at, plus the `pub` visibility additions that
valargroup/voting-circuits needs for the shielded-voting Halo 2
circuits (constants, spec, shared_primitives gadget).

Before this change, consumers that also depend on `voting-circuits`
(e.g. `zcash_voting`) ended up with two distinct Orchard crates in
their dep-graph: `orchard` (from this fork, via our patch) and
`valar-orchard` (pulled by `voting-circuits` from crates.io). Cargo
treats them as different crates regardless of content, which forced a
byte-round-trip `orchard_compat` bridge at the zcash_keys / pczt
boundary. Routing our fork through `valar-orchard` too collapses that
back to a single node and deletes the bridge.

The `[patch.crates-io] orchard = { git = "zcash/orchard", rev = "6b12c77…" }`
entry is obsolete after this change (no dep resolves crates.io
`orchard` anymore) and is removed.

Verified: `cargo check --workspace` clean. `valar-orchard v0.12.0`
appears in the build graph; no `orchard v0.12.x` or git `orchard`
entry.

Made-with: Cursor
The workspace now resolves `orchard` through the `valar-orchard` package
on crates.io via `package = "valar-orchard"`. Two CI jobs keyed on the
original crate name and needed to learn about the rename:

- supply-chain/config.toml: add a `safe-to-deploy` exemption for
  `valar-orchard 0.12.0` (matches the criteria previously granted to
  `orchard 0.12.0@git:b0bf2670e2…`) and drop the now-unreachable
  orchard@git exemption: nothing in Cargo.lock resolves to it anymore.
  `corez 0.1.1` is already exempted via the upstream `core2 → corez`
  migration on this base, so no change needed there.

- .github/helpers/check-dep-graph.py: add a `PACKAGE_NAME_REMAP` table
  that maps cargo-tree's package names back to the aliases used in the
  README mermaid graph, and apply it while building `cargo_edges`.
  Without this, every README edge mentioning `orchard` looks stale
  because `cargo tree -f ' {p}'` reports the real package name
  (`valar-orchard`), and every real edge mentioning `valar-orchard` is
  silently dropped because it is not in `CRATES_IN_GRAPH`.

Verified locally:

- `cargo vet --locked` → `Vetting Succeeded (262 fully audited,
  120 partially audited, 294 exempted)`
- `python3 .github/helpers/check-dep-graph.py` → exit 0, no output

Made-with: Cursor
@p0mvn p0mvn merged commit a8de87d into roman/shielded-vote-for-zodl-3.4.0-rebased Apr 24, 2026
48 checks passed
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.

1 participant