Skip to content

feat: widen visibility on orchard_internal for external reuse#1

Closed
czarcas7ic wants to merge 27 commits into
ebfull:mainfrom
valargroup:adam/visibility-widening
Closed

feat: widen visibility on orchard_internal for external reuse#1
czarcas7ic wants to merge 27 commits into
ebfull:mainfrom
valargroup:adam/visibility-widening

Conversation

@czarcas7ic
Copy link
Copy Markdown

@czarcas7ic czarcas7ic commented Apr 13, 2026

Summary

Blanket pub(crate)pub and pub(in crate::circuit) / pub(super) in circuit/pub across orchard_internal. Adds doc comments on newly-public items to satisfy #![deny(missing_docs)].

5 pub(super) items in note/commitment.rs + note/nullifier.rs are left unchanged. They are not needed by the voting circuits.

@czarcas7ic czarcas7ic marked this pull request as ready for review April 13, 2026 19:34
@czarcas7ic czarcas7ic changed the title feat: widen visibility on orchard_internal primitives for external reuse feat: widen visibility on orchard_internal for external reuse Apr 13, 2026
@czarcas7ic czarcas7ic force-pushed the adam/visibility-widening branch from 1295071 to 195be7a Compare April 13, 2026 21:23
Comment thread src/keys.rs
Comment on lines +124 to 126
pub fn derive_inner(sk: &SpendingKey) -> pallas::Scalar {
to_scalar(PrfExpand::ORCHARD_ASK.with(&sk.0))
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be private, now public

nuttycom and others added 9 commits April 17, 2026 13:25
Migrate from yanked `core2` library to `corez`
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Path-only deps without a `version` field cause `cargo publish` to reject
the `orchard` shim crate: once published, cargo resolves the
`orchard_internal` dep from crates.io, which requires a version to
match against. Centralize the dep spec in the workspace table so the
version and path stay in one place, and pin it to `=0.12.0` so the two
crates can only ever be consumed as a matched set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`readme = \"../README.md\"` produced a `cargo package` warning because
the in-package `public/README.md` (developer-facing directory blurb)
took precedence over the referenced root README, meaning crates.io
would have shown the wrong content. Replace the developer blurb with
a symlink to the root README — cargo dereferences symlinks when
packaging, so the published tarball contains a regular file with the
correct content, and there is no longer any copy to keep in sync.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nuttycom and others added 14 commits April 17, 2026 15:08
Return DepthOverflow error instead of panicking at depth 255
Reviewers (kris@nutty.land) flagged that the three-place value
representation preamble (`NoteValue`, `ValueSum`, `valueBalanceOrchard`)
and the `MAX_MONEY`/51-bit downstream guidance were removed without
justification, along with the intra-doc link references.

Restore the preamble and links. No code changes.
`rust-version` in the root `Cargo.toml` is already `1.85.1`; the README
was still claiming 1.70+.
Per daira's review, update the personal email addresses used for Jack
Grigg and Kris Nuttycombe in both `Cargo.toml` files.
Extend the ECC copyright range through 2025 and add a line for Zcash
Open Development Lab for 2026, per daira's review.
The KaTeX header file was duplicated byte-for-byte at the repository
root and under `public/`. Replace the duplicate with a relative
symlink so edits at the root propagate automatically.
typenum 1.20.0 dropped the `no_std` feature (the crate is now no_std by
default), so `cargo add typenum --no-default-features --features "no_std"`
in the synthetic ci-build crate fails with "unrecognized feature for
crate typenum: no_std". Drop the flag from both no_std CI workflows and
the matching README bullet.
Split orchard into `orchard_internal` (wide visibility) + `orchard` (API-preserving shim)
…helper

Widens 40+ pub(crate) items to pub so external circuit crates can reuse
Orchard's circuit primitives (CommitIvk/NoteCommit sub-circuits, addition
chip, key/note/value helpers) without forking the crate.

Also adds a new circuit::gadget::assign_constant helper — a counterpart
to assign_free_advice that loads a compile-time constant into a single
advice cell via Region::assign_advice_from_constant.

All changes are visibility-only (plus the 12-line helper). Zero behavioral
changes to the main Orchard action circuit:
- src/circuit_description/ is byte-identical to v0.11.0
- src/circuit_proof_test_case.bin is byte-identical to v0.11.0
- All 53 existing orchard tests pass unchanged
Converts all 211 `pub(crate)` and 1 remaining `pub(in crate::circuit)`
to `pub`. Adds doc comments on newly-public items to satisfy
`#![deny(missing_docs)]`.

15 `pub(super)` items are left unchanged pending review.
Not used within orchard itself; voting-circuits can define it locally.
These are morally pub(in crate::circuit) — the parent of gadget is circuit.
@czarcas7ic czarcas7ic force-pushed the adam/visibility-widening branch from 1e5b272 to dca364d Compare April 20, 2026 16:13
@czarcas7ic czarcas7ic changed the base branch from orchard_internal to main April 20, 2026 16:13
@ebfull
Copy link
Copy Markdown
Owner

ebfull commented Apr 20, 2026

Since this branch is being repurposed for zcash#488 I will close it and forward my review.

@ebfull ebfull closed this Apr 20, 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.

4 participants