Skip to content

Commit 47d908a

Browse files
committed
update: Remove wasm feature
As @arnaucube correctly suggested to me, the `wasm` feature can be omitted as the `wasmer` loader does not require it. Therefore, feature set, CI and code has been updated accordingly. Also, the browser feature has been renamed to `circom-browser`.
1 parent 0cf1aae commit 47d908a

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

.github/scripts/wasm-target-test-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cp "${GIT_ROOT}/rust-toolchain" .
1515
rustup target add wasm32-unknown-unknown wasm32-wasi
1616

1717
# add dependencies
18-
cargo add --path "${GIT_ROOT}/folding-schemes" --features wasm, parallel
18+
cargo add --path "${GIT_ROOT}/folding-schemes" --features circom-browser
1919
cargo add getrandom --features js --target wasm32-unknown-unknown
2020

2121
# test build for wasm32-* targets

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
feature_set: [basic]
4444
include:
4545
- feature_set: basic
46-
features: --features default,light-test
46+
features: --features default, light-test
4747
steps:
4848
- uses: actions/checkout@v2
4949
- uses: actions-rs/toolchain@v1
@@ -99,7 +99,7 @@ jobs:
9999
uses: actions-rs/cargo@v1
100100
with:
101101
command: build
102-
args: -p folding-schemes --no-default-features --target ${{ matrix.target }} --features "wasm, parallel"
102+
args: -p folding-schemes --target ${{ matrix.target }} --features circom-frontend
103103
- name: Run wasm-compat script
104104
run: |
105105
chmod +x .github/scripts/wasm-target-test-build.sh
@@ -156,13 +156,13 @@ jobs:
156156
runs-on: ubuntu-latest
157157
strategy:
158158
matrix:
159-
feature_set: [basic, wasm]
159+
feature_set: [basic, circom-browser]
160160
include:
161161
- feature_set: basic
162162
features: --features default,light-test
163-
# We only want to test `folding-schemes` package with `wasm` feature.
164-
- feature_set: wasm
165-
features: -p folding-schemes --features wasm,parallel --target wasm32-unknown-unknown
163+
# We only want to test `folding-schemes` package with `circom-browser` feature.
164+
- feature_set: circom-browser
165+
features: -p folding-schemes --features circom-browser, parallel --target wasm32-unknown-unknown
166166
steps:
167167
- uses: actions/checkout@v2
168168
- uses: actions-rs/toolchain@v1

folding-schemes/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ getrandom = { version = "0.2", features = ["js"] }
8181
[features]
8282
default = ["ark-circom/default", "parallel"]
8383
parallel = []
84-
wasm = ["ark-circom/wasm"]
85-
browser = ["wasm", "byteorder"]
84+
circom-browser = ["ark-circom/wasm", "byteorder"]
8685
light-test = []
8786

8887

folding-schemes/src/folding/nova/circuits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ where
411411
// get z_{i+1} from the F circuit
412412
let i_usize = self.i_usize.unwrap_or(0);
413413

414-
// If we are in the browser-frontend case. The witness is already loaded within
414+
// If we are in the circom-browser-frontend case. The witness is already loaded within
415415
// self.F.witness. This was done at `self.prove_step()` fn.
416416
let z_i1 = self
417417
.F

folding-schemes/src/folding/nova/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,12 @@ where
642642
fn prove_step(
643643
&mut self,
644644
mut rng: impl RngCore,
645-
// This contains the full witness when we're in the browser-frontend case
645+
// This contains the full witness when we're in the circom-browser-frontend case
646646
external_inputs: Vec<C1::ScalarField>,
647647
// Nova does not support multi-instances folding
648648
_other_instances: Option<Self::MultiCommittedInstanceWithWitness>,
649649
) -> Result<(), Error> {
650-
#[cfg(feature = "browser")]
650+
#[cfg(feature = "circom-browser")]
651651
{
652652
// Slice and separate between external inputs and frontend witness.
653653
let (frontend_witness, external_inputs) =
@@ -664,7 +664,7 @@ where
664664
(None, external_inputs)
665665
};
666666

667-
// If we are in the browser-case (frontend_witness = Some(witness)) then we load the witness into the FCircuit.
667+
// If we are in the circom-browser-case (frontend_witness = Some(witness)) then we load the witness into the FCircuit.
668668
if let Some(witness) = frontend_witness {
669669
self.F.load_witness(witness)
670670
};

folding-schemes/src/frontend/circom/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use num_bigint::BigInt;
1313
use std::rc::Rc;
1414
use std::{fmt, usize};
1515

16-
#[cfg(feature = "browser")]
16+
#[cfg(feature = "circom-browser")]
1717
pub mod browser;
1818
pub mod utils;
1919

20-
#[cfg(feature = "browser")]
20+
#[cfg(feature = "circom-browser")]
2121
pub use browser::{load_witness_from_bin_reader, CircomFCircuitBrowser};
2222
use utils::CircomWrapper;
2323

@@ -38,7 +38,7 @@ impl<F: PrimeField> fmt::Debug for CustomStepNative<F> {
3838
}
3939
}
4040

41-
/// This circuit is the one we will use in order to fold circom circuits
41+
/// This circuit is the one we will use in order to fold Circom circuits
4242
/// from a non-browser environment.
4343
#[derive(Clone, Debug)]
4444
pub struct CircomFCircuit<F: PrimeField> {

folding-schemes/src/frontend/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ pub trait FCircuit<F: PrimeField>: Clone + Debug {
5050
) -> Result<Vec<FpVar<F>>, SynthesisError>;
5151

5252
/// Allows to load pre-generated witness into the FCircuit implementor.
53-
/// This is only needed by the browser use cases where we have already computed our
53+
/// This is only needed by the circom-browser use cases where we have already computed our
5454
/// witness there. And we need a way to load it into the FCircuit since it's already computed.
5555
///
56-
/// By default this method will simply do nothing. Only in the browser FCircuit implementors this will have usage.
56+
/// By default this method will simply do nothing. Only in the circom-browser FCircuit implementors this will have usage.
5757
fn load_witness(&mut self, _witness: Vec<F>) {}
5858
}
5959

0 commit comments

Comments
 (0)