Skip to content

Make it possible to build with the "circuit" feature for no_std targets #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
echo "#![no_std]" > ./ci-build/src/lib.rs
- name: Add dependencies of the synthetic crate (e.g. sapling-crypto)
working-directory: ./ci-build
run: cargo add --no-default-features --path ../crate_root
run: cargo add --no-default-features --features "circuit" --path ../crate_root
- name: Add lazy_static with the spin_no_std feature
working-directory: ./ci-build
run: cargo add lazy_static --no-default-features --features "spin_no_std"
Expand All @@ -73,6 +73,12 @@ jobs:
- name: Show Cargo.toml for the synthetic crate
working-directory: ./ci-build
run: cat Cargo.toml
- name: DEBUG cargo tree -i -p getrandom -e features
working-directory: ./ci-build
run: cargo tree -i -p getrandom -e features
- name: DEBUG cargo tree -i -p rand_core -e features
working-directory: ./ci-build
run: cargo tree -i -p rand_core -e features
- name: Add target
working-directory: ./ci-build
run: rustup target add ${{ matrix.target }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/lints-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
echo "#![no_std]" > ./ci-build/src/lib.rs
- name: Add dependencies of the synthetic crate (e.g. sapling-crypto)
working-directory: ./ci-build
run: cargo add --no-default-features --path ../crate_root
run: cargo add --no-default-features --features "circuit" --path ../crate_root
- name: Add lazy_static with the spin_no_std feature
working-directory: ./ci-build
run: cargo add lazy_static --no-default-features --features "spin_no_std"
Expand All @@ -53,6 +53,12 @@ jobs:
- name: Show Cargo.toml for the synthetic crate
working-directory: ./ci-build
run: cat Cargo.toml
- name: DEBUG cargo tree -i -p getrandom -e features
working-directory: ./ci-build
run: cargo tree -i -p getrandom -e features
- name: DEBUG cargo tree -i -p rand_core -e features
working-directory: ./ci-build
run: cargo tree -i -p rand_core -e features
- name: Add target
working-directory: ./ci-build
run: rustup target add ${{ matrix.target }}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- The "circuit" feature no longer implies the "std" feature. "circuit" can now
potentially be used in `no_std` environments.
- `orchard::bundle::batch` is now only available when the "std" feature is enabled
together with the "circuit" feature.

## [0.11.0] - 2025-02-20

Expand Down
21 changes: 15 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bench = false
[features]
default = ["circuit", "multicore", "std"]
std = ["core2/std", "group/wnaf-memuse", "reddsa/std"]
circuit = ["dep:halo2_gadgets", "dep:halo2_proofs", "std"]
circuit = ["dep:halo2_gadgets", "dep:halo2_proofs"]
unstable-frost = []
multicore = ["halo2_proofs?/multicore"]
dev-graph = ["halo2_proofs?/dev-graph", "image", "plotters"]
Expand All @@ -106,3 +106,7 @@ debug = true

[profile.bench]
debug = true

[patch.crates-io]
halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "7e173f8e2e6e8717052e472384bdf28e58eaff19" }
halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "7e173f8e2e6e8717052e472384bdf28e58eaff19" }
4 changes: 2 additions & 2 deletions src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use alloc::vec::Vec;

pub mod commitments;

#[cfg(feature = "circuit")]
#[cfg(all(feature = "circuit", feature = "std"))]
mod batch;
#[cfg(feature = "circuit")]
#[cfg(all(feature = "circuit", feature = "std"))]
pub use batch::BatchValidator;

use core::fmt;
Expand Down
Loading