Skip to content

orchard 0.13: stack upstream zcash/orchard#489 + #495#19

Merged
greg0x merged 5 commits into
mainfrom
valar/0.13-spend-auth-g
Apr 25, 2026
Merged

orchard 0.13: stack upstream zcash/orchard#489 + #495#19
greg0x merged 5 commits into
mainfrom
valar/0.13-spend-auth-g

Conversation

@p0mvn
Copy link
Copy Markdown

@p0mvn p0mvn commented Apr 25, 2026

Stacks two open upstream PRs against zcash/orchard:main for the voting-circuits / vote-sdk migration POC to orchard 0.13. Opened against valargroup/orchard:main (kept in sync with zcash/main) so the entire workspace can pin a single git rev while we wait for the upstream PRs to land.

Upstream PRs stacked

  • zcash/orchard#489 — feat: add SpendAuthG fixed-base multiplication support (commits 27d719a, 0cbaa0d)
  • zcash/orchard#495 — value: Replace NoteValue::zero() with NoteValue::ZERO const (commits 3b21ae3, b20e941, 7fa213a)

Why

Both pieces are required together for the integration branch:

Combining them in one fork branch lets us pin downstream [patch.crates-io] consumers (voting-circuits, zcash_voting, vote-sdk, zcash-swift-wallet-sdk) to a single git rev.

Contents (5 commits on top of zcash/main @ d05a1f6)

From #489:

  1. 27d719a feat: add SpendAuthG fixed-base multiplication support
  2. 0cbaa0d Fix inlining ValueCommitV

From #495:
3. 3b21ae3 value: Replace NoteValue::zero() with NOTE_VALUE_ZERO const (cherry-pick of a331094)
4. b20e941 Update CHANGELOG.md (review wording: drop pub qualifier in changelog) (cherry-pick of 98b21de)
5. 7fa213a Use NoteValue::ZERO instead of NOTE_VALUE_ZERO (use associated constant per maintainer review) (cherry-pick of 0062868)

CHANGELOG.md ### Added carries both new entries (SpendAuthG enums + NoteValue::ZERO).

Verification

  • cargo build --no-default-features --features circuit,unstable-voting-circuits — clean
  • cargo test --no-default-features --features circuit,unstable-voting-circuits --lib — 71 passed, 0 failed
  • All NoteValue::zero() call sites in src/builder.rs, src/bundle.rs, src/note.rs migrated to NoteValue::ZERO; no stale references remain.
  • Fork main synced with zcash/main (d05a1f6, post feat: add unstable-voting-circuits feature to widen internals zcash/orchard#488 merge) before opening this PR.

Notes

  • Intended as the integration target for downstream [patch.crates-io] pins.
  • We'll drop the corresponding commits from this branch as each upstream PR merges into zcash/main.

czarcas7ic and others added 5 commits April 24, 2026 08:47
Adds `OrchardBaseFieldBases` and `OrchardShortScalarBases` enums in
`orchard::constants::fixed_bases`, both including a `SpendAuthG` variant
alongside the existing `NullifierK` / `ValueCommitV`, and both marked
`#[non_exhaustive]` to allow future base additions without a semver
break. Precomputed Z/U tables for the short-scalar variant are generated
via `find_zs_and_us` and exercised by a shared MockProver harness for
both base-field and short-scalar routes.

`OrchardFixedBases` is reshaped to a Full/Base/Short dispatch. The
reshape is behavior-preserving (pinned VK unchanged) and
`From<NullifierK>` / `From<ValueCommitV>` keep routing to the correct
variant. The outer enum is not `#[non_exhaustive]` because its three
variants correspond to halo2's `FixedScalarKind` partition.

These items are reachable externally only under the
`unstable-voting-circuits` feature.
Introduces a public `const NoteValue` zero value in `orchard::value`,
replacing the crate-private `NoteValue::zero()` associated function.
All internal call sites in the builder, bundle testing helpers, and
note dummy construction are rewired to use the new constant.

The new constant is usable in `const` contexts and gives downstream
consumers a direct name for the zero value without going through
`NoteValue::from_raw(0)`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
Review on the note-value PR asked for an associated constant on the public type (consistent with patterns like pallas::Base::ZERO) rather than a module-level name, while keeping a single const zero usable in const contexts.

Made-with: Cursor
@greg0x greg0x merged commit c26a6ec into main Apr 25, 2026
29 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.

4 participants