Skip to content

Split orchard into orchard_internal (wide visibility) + orchard (API-preserving shim)#480

Merged
nuttycom merged 15 commits into
zcash:mainfrom
ebfull:orchard_internal
Apr 20, 2026
Merged

Split orchard into orchard_internal (wide visibility) + orchard (API-preserving shim)#480
nuttycom merged 15 commits into
zcash:mainfrom
ebfull:orchard_internal

Conversation

@ebfull
Copy link
Copy Markdown
Collaborator

@ebfull ebfull commented Apr 10, 2026

Downstream extensions to Orchard, such as the new voting protocol, will want to create their own circuits while reusing components of this crate (especially its internal circuits). But, we would prefer that the API is not enlarged on orchard itself.

This PR turns this repository into a workspace. The existing orchard crate becomes orchard_internal (crate name reserved) and orchard is published from the public/ subdirectory, which contains a shim crate implementation that exposes an identical API (and documentation) as the current orchard crate.

Later, orchard_internal will have many components that are currently pub(crate) turned pub, and some very minor refactors to enable the voting circuits will also be folded in.

@ebfull ebfull force-pushed the orchard_internal branch from 028d3a6 to c1d49e6 Compare April 10, 2026 06:17
Comment thread src/address.rs Outdated
Comment thread Cargo.toml
Comment thread README.md Outdated
Copy link
Copy Markdown
Collaborator

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

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

ACK, I have rebased the widening PR and fixed-base multiplication support PR onto this branch as well.

@nuttycom nuttycom self-requested a review April 16, 2026 22:34
@nuttycom
Copy link
Copy Markdown
Contributor

@ebfull what should the plan be with respect to crate publishing here? We're working toward an orchard 0.13 release, and presumably we'll want to publish orchard_internal 0.13 at the same time.

Comment thread public/src/lib.rs Outdated
ebfull and others added 5 commits April 17, 2026 14:34
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
Copy link
Copy Markdown
Contributor

force-pushed to rebase atop the core2 -> corez migration fix.

Copy link
Copy Markdown
Collaborator

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

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

ACK the commits since my last comment.

Copy link
Copy Markdown
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

A couple of minor requests for changes; the main thing is why was some of the module documentation removed? I can't find that it was moved anywhere.

Comment thread src/address.rs
Comment thread src/value.rs Outdated
Comment thread src/value.rs
Comment thread README.md Outdated
Comment thread public/katex-header.html
Comment thread public/LICENSE-MIT Outdated
Comment thread public/Cargo.toml Outdated
Comment thread public/Cargo.toml Outdated
Comment thread Cargo.toml Outdated
Comment thread Cargo.toml Outdated
daira
daira previously approved these changes Apr 18, 2026
Copy link
Copy Markdown
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

utACK modulo Kris' review comments.

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.
@ebfull
Copy link
Copy Markdown
Collaborator Author

ebfull commented Apr 20, 2026

@nuttycom I was in a holding pattern due to the security incidents, and was under the impression there would be a major release of orchard that I needed to wait for here. But, since those incidents have been temporarily resolved without a bump to orchard, we could just ship this crate refactoring as 0.13 yes.

Comment thread src/lib.rs
Comment on lines -3 to -8
//! ## Nomenclature
//!
//! All types in the `orchard` crate, unless otherwise specified, are Orchard-specific
//! types. For example, [`Address`] is documented as being a shielded payment address; we
//! implicitly mean it is an Orchard payment address (as opposed to e.g. a Sapling payment
//! address, which is also shielded).
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note: this documentation is not removed; it's just moved to the public orchard crate.

@ebfull
Copy link
Copy Markdown
Collaborator Author

ebfull commented Apr 20, 2026

Bumping this to 0.13 and releasing should be a separate PR.

@nuttycom
Copy link
Copy Markdown
Contributor

@nuttycom I was in a holding pattern due to the security incidents, and was under the impression there would be a major release of orchard that I needed to wait for here. But, since those incidents have been temporarily resolved without a bump to orchard, we could just ship this crate refactoring as 0.13 yes.

Yup, I'm fine with getting this in to 0.13. I'll finish that today.

Copy link
Copy Markdown
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

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

utACK 106d2d1

@nuttycom nuttycom merged commit 7e90bf2 into zcash:main Apr 20, 2026
15 checks passed
Copy link
Copy Markdown
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

Post-hoc ACK

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.

Split orchard into orchard_internal (wide visibility) + orchard (API-preserving shim)

4 participants