From 68edf1d242d2981ac1224c1fcc25845394d9dd61 Mon Sep 17 00:00:00 2001 From: arnaucube Date: Tue, 9 Apr 2024 15:52:48 +0200 Subject: [PATCH] add light-test feature to decider_eth_circuit to use it in solidity-verifier tests without the big circuit --- folding-schemes/Cargo.toml | 1 + folding-schemes/src/folding/nova/decider_eth_circuit.rs | 7 +++---- folding-schemes/src/utils/espresso/sum_check/verifier.rs | 2 +- solidity-verifiers/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/folding-schemes/Cargo.toml b/folding-schemes/Cargo.toml index 4d0c5215..eaa8647c 100644 --- a/folding-schemes/Cargo.toml +++ b/folding-schemes/Cargo.toml @@ -35,6 +35,7 @@ tracing-subscriber = { version = "0.2" } [features] default = ["parallel"] +light-test = [] parallel = [ "ark-std/parallel", diff --git a/folding-schemes/src/folding/nova/decider_eth_circuit.rs b/folding-schemes/src/folding/nova/decider_eth_circuit.rs index 58daebbe..c24f1b42 100644 --- a/folding-schemes/src/folding/nova/decider_eth_circuit.rs +++ b/folding-schemes/src/folding/nova/decider_eth_circuit.rs @@ -426,9 +426,9 @@ where // The following two checks (and their respective allocations) are disabled for normal // tests since they take several millions of constraints and would take several minutes - // (and RAM) to run the test. - /* // TODO TMP, next code block is commented to avoid executing it in the solidity-verifiers test temporarily - #[cfg(not(test))] + // (and RAM) to run the test. It is active by default, and not active only when + // 'light-test' feature is used. + #[cfg(not(feature = "light-test"))] { // imports here instead of at the top of the file, so we avoid having multiple // `#[cfg(not(test))]` @@ -486,7 +486,6 @@ where NonNativeFieldVar>, >::check(cf_r1cs, cf_W_i.E, cf_U_i.u.clone(), cf_z_U)?; } - */ // 6. check KZG challenges let (incircuit_c_W, incircuit_c_E) = KZGChallengesGadget::::get_challenges_gadget( diff --git a/folding-schemes/src/utils/espresso/sum_check/verifier.rs b/folding-schemes/src/utils/espresso/sum_check/verifier.rs index 33989aca..9f6c35fc 100644 --- a/folding-schemes/src/utils/espresso/sum_check/verifier.rs +++ b/folding-schemes/src/utils/espresso/sum_check/verifier.rs @@ -119,7 +119,7 @@ impl SumCheckVerifier for IOPVerifierState { .clone() .into_iter() .zip(self.challenges.clone().into_iter()) - .map(|(evaluations, challenge)| { + .map(|(coeffs, challenge)| { // Removed check on number of evaluations here since verifier receives polynomial in coeffs form let prover_poly = DensePolynomial::from_coefficients_slice(&coeffs); Ok(prover_poly.evaluate(&challenge)) diff --git a/solidity-verifiers/Cargo.toml b/solidity-verifiers/Cargo.toml index 3c2f55c0..3539df81 100644 --- a/solidity-verifiers/Cargo.toml +++ b/solidity-verifiers/Cargo.toml @@ -12,7 +12,6 @@ ark-groth16 = "0.4" askama = { version = "0.12.0", features = ["config"], default-features = false } ark-bn254 = "0.4.0" ark-poly-commit = "0.4.0" -folding-schemes = { path = "../folding-schemes/" } itertools = "0.12.1" ark-serialize = "0.4.1" revm = "3.5.0" @@ -28,6 +27,7 @@ tracing = { version = "0.1", default-features = false, features = [ "attributes" tracing-subscriber = { version = "0.2" } ark-grumpkin = {version="0.4.0", features=["r1cs"]} rand = "0.8.5" +folding-schemes = { path = "../folding-schemes/", features=["light-test"]} [features] default = ["parallel"]