From b45e327a68effbd576405c28c89bd5da8c3f5118 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Wed, 31 Jan 2024 23:27:21 +0800 Subject: [PATCH 1/7] wip: upgrade dependency --- Cargo.toml | 7 +++ rust-toolchain | 2 +- snark-verifier-sdk/Cargo.toml | 6 +-- snark-verifier-sdk/src/evm.rs | 7 ++- snark-verifier/Cargo.toml | 8 ++-- snark-verifier/src/pcs/kzg/accumulation.rs | 8 ++-- snark-verifier/src/pcs/kzg/decider.rs | 45 ++++++++++++++----- .../src/pcs/kzg/multiopen/bdfg21.rs | 15 ++++--- snark-verifier/src/pcs/kzg/multiopen/gwc19.rs | 15 ++++--- snark-verifier/src/system/halo2/test/kzg.rs | 17 ++++--- .../src/system/halo2/test/kzg/evm.rs | 7 ++- .../src/system/halo2/test/kzg/native.rs | 7 ++- 12 files changed, 98 insertions(+), 46 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 31bbef5c..24af7417 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,3 +3,10 @@ members = [ "snark-verifier", "snark-verifier-sdk" ] + +[patch.crates-io] +halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v0.3.0" } +halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0" } + +[patch."https://github.com/privacy-scaling-explorations/halo2wrong"] +halo2_wrong_ecc = { git = "https://www.github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true} diff --git a/rust-toolchain b/rust-toolchain index cb908525..7c7053aa 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.69.0 \ No newline at end of file +1.75.0 diff --git a/snark-verifier-sdk/Cargo.toml b/snark-verifier-sdk/Cargo.toml index 2f1ba1a3..a51fb46e 100644 --- a/snark-verifier-sdk/Cargo.toml +++ b/snark-verifier-sdk/Cargo.toml @@ -20,11 +20,11 @@ ark-std = { version = "0.3.0", features = ["print-trace"], optional = true } snark-verifier = { path = "../snark-verifier", default-features = false } # system_halo2 -halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v2023_04_20" } # not optional for now -halo2curves = { git = 'https://github.com/privacy-scaling-explorations/halo2curves', tag = "0.3.2" } # must be same version as in halo2_proofs +halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v0.3.0" } # not optional for now +halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0" } # loader_halo2 -halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2023_04_20", package = "ecc", optional = true } +halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true } poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2023_04_20", optional = true } # loader_evm diff --git a/snark-verifier-sdk/src/evm.rs b/snark-verifier-sdk/src/evm.rs index 8cb703ce..3ec21ff0 100644 --- a/snark-verifier-sdk/src/evm.rs +++ b/snark-verifier-sdk/src/evm.rs @@ -18,6 +18,7 @@ use halo2_proofs::{ }, transcript::{TranscriptReadBuffer, TranscriptWriterBuffer}, }; +use halo2curves::pairing::Engine; use itertools::Itertools; use rand::{rngs::StdRng, SeedableRng}; pub use snark_verifier::loader::evm::encode_calldata; @@ -127,7 +128,11 @@ where Rc, VerifyingKey = KzgAsVerifyingKey, Accumulator = KzgAccumulator>, - > + AccumulationDecider, DecidingKey = KzgDecidingKey>, + > + AccumulationDecider< + G1Affine, + Rc, + DecidingKey = KzgDecidingKey::G1Affine>, + >, { let protocol = compile( params, diff --git a/snark-verifier/Cargo.toml b/snark-verifier/Cargo.toml index 962a57e0..26cc9734 100644 --- a/snark-verifier/Cargo.toml +++ b/snark-verifier/Cargo.toml @@ -11,20 +11,20 @@ num-integer = "0.1.45" num-traits = "0.2.15" rand = "0.8" hex = "0.4" -halo2_curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.3.2", package = "halo2curves" } +halo2_curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0", package = "halo2curves" } # parallel rayon = { version = "1.5.3", optional = true } # system_halo2 -halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v2023_04_20", optional = true } +halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v0.3.0", optional = true } # loader_evm sha3 = { version = "0.10", optional = true } revm = { version = "3.5.0", optional = true, default-features = false } # loader_halo2 -halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2023_04_20", package = "ecc", optional = true } +halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true } poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2023_04_20", optional = true } # derive_serde @@ -35,7 +35,7 @@ rand_chacha = "0.3.1" paste = "1.0.7" # system_halo2 -halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2023_04_20", package = "ecc" } +halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc" } [features] default = ["loader_evm", "loader_halo2", "system_halo2"] diff --git a/snark-verifier/src/pcs/kzg/accumulation.rs b/snark-verifier/src/pcs/kzg/accumulation.rs index 5139d49e..1f9bbb9f 100644 --- a/snark-verifier/src/pcs/kzg/accumulation.rs +++ b/snark-verifier/src/pcs/kzg/accumulation.rs @@ -19,7 +19,8 @@ pub struct KzgAs(PhantomData<(M, MOS)>); impl AccumulationScheme for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::G1Affine: CurveAffine, + M::Fr: PrimeField, L: Loader, MOS: Clone + Debug, { @@ -140,7 +141,8 @@ where impl AccumulationSchemeProver for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::G1Affine: CurveAffine, + M::Fr: PrimeField, MOS: Clone + Debug, { type ProvingKey = KzgAsProvingKey; @@ -165,7 +167,7 @@ where let blind = pk .zk() .then(|| { - let s = M::Scalar::random(rng); + let s = M::Fr::random(rng); let (g, s_g) = pk.0.unwrap(); let lhs = (s_g * s).to_affine(); let rhs = (g * s).to_affine(); diff --git a/snark-verifier/src/pcs/kzg/decider.rs b/snark-verifier/src/pcs/kzg/decider.rs index eb7e84a7..dbdb4172 100644 --- a/snark-verifier/src/pcs/kzg/decider.rs +++ b/snark-verifier/src/pcs/kzg/decider.rs @@ -1,11 +1,13 @@ +use halo2_curves::CurveAffine; + use crate::{pcs::kzg::KzgSuccinctVerifyingKey, util::arithmetic::MultiMillerLoop}; use std::marker::PhantomData; /// KZG deciding key. #[derive(Debug, Clone, Copy)] -pub struct KzgDecidingKey { +pub struct KzgDecidingKey { /// KZG succinct verifying key. - pub svk: KzgSuccinctVerifyingKey, + pub svk: KzgSuccinctVerifyingKey, /// Generator on G2. pub g2: M::G2Affine, /// Generator to the trusted-setup secret on G2. @@ -13,7 +15,11 @@ pub struct KzgDecidingKey { _marker: PhantomData, } -impl KzgDecidingKey { +impl> KzgDecidingKey +where + M::G1Affine: CurveAffine, + M::G2Affine: CurveAffine, +{ /// Initialize a [`KzgDecidingKey`] pub fn new( svk: impl Into>, @@ -29,19 +35,29 @@ impl KzgDecidingKey { } } -impl From<(M::G1Affine, M::G2Affine, M::G2Affine)> for KzgDecidingKey { - fn from((g1, g2, s_g2): (M::G1Affine, M::G2Affine, M::G2Affine)) -> KzgDecidingKey { +impl> From<(M::G1Affine, M::G2Affine, M::G2Affine)> + for KzgDecidingKey +where + M::G1Affine: CurveAffine, + M::G2Affine: CurveAffine, +{ + fn from((g1, g2, s_g2): (M::G1Affine, M::G2Affine, M::G2Affine)) -> KzgDecidingKey { KzgDecidingKey::new(g1, g2, s_g2) } } -impl AsRef> for KzgDecidingKey { +impl> AsRef> + for KzgDecidingKey +{ fn as_ref(&self) -> &KzgSuccinctVerifyingKey { &self.svk } } mod native { + + use halo2_curves::CurveAffine; + use crate::{ loader::native::NativeLoader, pcs::{ @@ -59,10 +75,11 @@ mod native { impl AccumulationDecider for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::G1Affine: CurveAffine, + M::Fr: PrimeField, MOS: Clone + Debug, { - type DecidingKey = KzgDecidingKey; + type DecidingKey = KzgDecidingKey; fn decide( dk: &Self::DecidingKey, @@ -113,10 +130,12 @@ mod evm { impl AccumulationDecider> for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::G1Affine: CurveAffine, + M::G2Affine: CurveAffine, + ::ScalarExt: PrimeField, MOS: Clone + Debug, { - type DecidingKey = KzgDecidingKey; + type DecidingKey = KzgDecidingKey; fn decide( dk: &Self::DecidingKey, @@ -162,7 +181,11 @@ mod evm { loader.code_mut().runtime_append(code); let challenge = loader.scalar(Value::Memory(challenge_ptr)); - let powers_of_challenge = LoadedScalar::::powers(&challenge, lhs.len()); + let powers_of_challenge = + LoadedScalar::<::ScalarExt>::powers( + &challenge, + lhs.len(), + ); let [lhs, rhs] = [lhs, rhs].map(|msms| { msms.iter() .zip(powers_of_challenge.iter()) diff --git a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs index cbfa0000..f3ab7547 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs @@ -1,3 +1,5 @@ +use halo2_curves::group::prime::PrimeCurveAffine; + use crate::{ cost::{Cost, CostEstimation}, loader::{LoadedScalar, Loader, ScalarLoader}, @@ -27,7 +29,8 @@ pub struct Bdfg21; impl PolynomialCommitmentScheme for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField + Ord, + M::G1Affine: CurveAffine, + M::Fr: PrimeField + Ord, L: Loader, { type VerifyingKey = KzgSuccinctVerifyingKey; @@ -36,7 +39,7 @@ where fn read_proof( _: &KzgSuccinctVerifyingKey, - _: &[Query], + _: &[Query<::Scalar>], transcript: &mut T, ) -> Result, Error> where @@ -49,7 +52,7 @@ where svk: &KzgSuccinctVerifyingKey, commitments: &[Msm], z: &L::LoadedScalar, - queries: &[Query], + queries: &[Query<::Scalar, L::LoadedScalar>], proof: &Bdfg21Proof, ) -> Result { let sets = query_sets(queries); @@ -370,11 +373,11 @@ where impl CostEstimation for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::Fr: PrimeField, { - type Input = Vec>; + type Input = Vec>; - fn estimate_cost(_: &Vec>) -> Cost { + fn estimate_cost(_: &Vec>) -> Cost { Cost { num_commitment: 2, num_msm: 2, diff --git a/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs b/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs index b664d536..288f1aba 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs @@ -1,3 +1,5 @@ +use halo2_curves::group::prime::PrimeCurveAffine; + use crate::{ cost::{Cost, CostEstimation}, loader::{LoadedScalar, Loader}, @@ -23,7 +25,8 @@ pub struct Gwc19; impl PolynomialCommitmentScheme for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::G1Affine: CurveAffine, + M::Fr: PrimeField, L: Loader, { type VerifyingKey = KzgSuccinctVerifyingKey; @@ -32,7 +35,7 @@ where fn read_proof( _: &Self::VerifyingKey, - queries: &[Query], + queries: &[Query<::Scalar>], transcript: &mut T, ) -> Result where @@ -45,7 +48,7 @@ where svk: &Self::VerifyingKey, commitments: &[Msm], z: &L::LoadedScalar, - queries: &[Query], + queries: &[Query<::Scalar, L::LoadedScalar>], proof: &Self::Proof, ) -> Result { let sets = query_sets(queries); @@ -161,11 +164,11 @@ where impl CostEstimation for KzgAs where M: MultiMillerLoop, - M::Scalar: PrimeField, + M::Fr: PrimeField, { - type Input = Vec>; + type Input = Vec>; - fn estimate_cost(queries: &Vec>) -> Cost { + fn estimate_cost(queries: &Vec>) -> Cost { let num_w = query_sets(queries).len(); Cost { num_commitment: num_w, diff --git a/snark-verifier/src/system/halo2/test/kzg.rs b/snark-verifier/src/system/halo2/test/kzg.rs index 107af76e..2340e624 100644 --- a/snark-verifier/src/system/halo2/test/kzg.rs +++ b/snark-verifier/src/system/halo2/test/kzg.rs @@ -2,7 +2,7 @@ use crate::{ system::halo2::test::{read_or_create_srs, MainGateWithRange}, util::arithmetic::{fe_to_limbs, CurveAffine, MultiMillerLoop, PrimeField}, }; -use halo2_curves::serde::SerdeObject; +use halo2_curves::{serde::SerdeObject, CurveExt}; use halo2_proofs::poly::{commitment::ParamsProver, kzg::commitment::ParamsKZG}; use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; @@ -21,17 +21,20 @@ pub const BITS: usize = 68; pub fn setup(k: u32) -> ParamsKZG where - M::Scalar: PrimeField, + M::Fr: PrimeField, + M::G1Affine: SerdeObject + CurveAffine, + M::G1: CurveExt, { ParamsKZG::::setup(k, ChaCha20Rng::from_seed(Default::default())) } -pub fn main_gate_with_range_with_mock_kzg_accumulator( -) -> MainGateWithRange +pub fn main_gate_with_range_with_mock_kzg_accumulator< + C: CurveAffine, + M: MultiMillerLoop, +>() -> MainGateWithRange<::ScalarExt> where - M::Scalar: PrimeField, - M::G1Affine: SerdeObject, - M::G2Affine: SerdeObject, + M::G2Affine: CurveAffine + SerdeObject, + M::G1Affine: CurveAffine + SerdeObject, { let srs = read_or_create_srs(TESTDATA_DIR, 1, setup::); let [g1, s_g1] = [srs.get_g()[0], srs.get_g()[1]].map(|point| point.coordinates().unwrap()); diff --git a/snark-verifier/src/system/halo2/test/kzg/evm.rs b/snark-verifier/src/system/halo2/test/kzg/evm.rs index 3ec00032..55215f43 100644 --- a/snark-verifier/src/system/halo2/test/kzg/evm.rs +++ b/snark-verifier/src/system/halo2/test/kzg/evm.rs @@ -13,7 +13,10 @@ use crate::{ }, verifier::plonk::PlonkVerifier, }; -use halo2_curves::bn256::{Bn256, G1Affine}; +use halo2_curves::{ + bn256::{Bn256, G1Affine}, + pairing::Engine, +}; use halo2_proofs::poly::kzg::multiopen::{ProverGWC, ProverSHPLONK, VerifierGWC, VerifierSHPLONK}; use paste::paste; use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; @@ -120,7 +123,7 @@ test!( zk_main_gate_with_range_with_mock_kzg_accumulator, 9, halo2_kzg_config!(true, 1, (0..4 * LIMBS).map(|idx| (0, idx)).collect()), - main_gate_with_range_with_mock_kzg_accumulator::() + main_gate_with_range_with_mock_kzg_accumulator::<::G1Affine, Bn256>() ); test!( #[cfg(feature = "loader_halo2")], diff --git a/snark-verifier/src/system/halo2/test/kzg/native.rs b/snark-verifier/src/system/halo2/test/kzg/native.rs index b1d38e06..ebdd9fcb 100644 --- a/snark-verifier/src/system/halo2/test/kzg/native.rs +++ b/snark-verifier/src/system/halo2/test/kzg/native.rs @@ -9,7 +9,10 @@ use crate::{ }, verifier::plonk::PlonkVerifier, }; -use halo2_curves::bn256::{Bn256, G1Affine}; +use halo2_curves::{ + bn256::{Bn256, G1Affine}, + pairing::Engine, +}; use halo2_proofs::{ poly::kzg::multiopen::{ProverGWC, ProverSHPLONK, VerifierGWC, VerifierSHPLONK}, transcript::{Blake2bRead, Blake2bWrite, Challenge255, TranscriptReadBuffer}, @@ -64,5 +67,5 @@ test!( zk_main_gate_with_range_with_mock_kzg_accumulator, 9, halo2_kzg_config!(true, 2, (0..4 * LIMBS).map(|idx| (0, idx)).collect()), - main_gate_with_range_with_mock_kzg_accumulator::() + main_gate_with_range_with_mock_kzg_accumulator::<::G1Affine, Bn256>() ); From efb09f9e4cc66628bcf1e20e6ea1e34df4ad14ab Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Wed, 31 Jan 2024 23:32:42 +0800 Subject: [PATCH 2/7] chores: clippy --- snark-verifier/src/loader/evm/loader.rs | 2 +- snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs | 2 +- snark-verifier/src/util/msm.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/snark-verifier/src/loader/evm/loader.rs b/snark-verifier/src/loader/evm/loader.rs index e3d82cf2..2abb27e3 100644 --- a/snark-verifier/src/loader/evm/loader.rs +++ b/snark-verifier/src/loader/evm/loader.rs @@ -837,7 +837,7 @@ impl> ScalarLoader for Rc { let initial_value = loader.push(products.first().unwrap()); let mut code = format!("let prod := {initial_value}\n"); - for (_, (value, product)) in values.iter().zip(products.iter()).skip(1).enumerate() { + for (value, product) in values.iter().zip(products.iter()).skip(1) { let v = loader.push(value); let ptr = product.ptr(); code.push_str( diff --git a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs index f3ab7547..02452221 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs @@ -67,7 +67,7 @@ where .zip(coeffs.iter()) .map(|(set, coeff)| set.msm(coeff, commitments, &powers_of_mu)); - msms.zip(proof.gamma.powers(sets.len()).into_iter()) + msms.zip(proof.gamma.powers(sets.len())) .map(|(msm, power_of_gamma)| msm * &power_of_gamma) .sum::>() - Msm::base(&proof.w) * &coeffs[0].z_s diff --git a/snark-verifier/src/util/msm.rs b/snark-verifier/src/util/msm.rs index f68ce6f4..777f8c65 100644 --- a/snark-verifier/src/util/msm.rs +++ b/snark-verifier/src/util/msm.rs @@ -92,7 +92,7 @@ where .as_ref() .map(|constant| (constant, gen.as_ref().unwrap())), ) - .chain(self.scalars.iter().zip(self.bases.into_iter())) + .chain(self.scalars.iter().zip(self.bases)) .collect_vec(); L::multi_scalar_multiplication(&pairs) } From b2a11174f2f684de8735fd818fe24d05976b5151 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 1 Feb 2024 10:09:55 +0800 Subject: [PATCH 3/7] chores: trait bound using where clause --- Cargo.toml | 4 ---- snark-verifier-sdk/Cargo.toml | 2 +- snark-verifier-sdk/src/evm.rs | 7 +------ snark-verifier/Cargo.toml | 2 +- snark-verifier/src/pcs/kzg/decider.rs | 19 +++++++++++-------- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 24af7417..425d57f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,4 @@ members = [ ] [patch.crates-io] -halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v0.3.0" } halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0" } - -[patch."https://github.com/privacy-scaling-explorations/halo2wrong"] -halo2_wrong_ecc = { git = "https://www.github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true} diff --git a/snark-verifier-sdk/Cargo.toml b/snark-verifier-sdk/Cargo.toml index a51fb46e..05db64a8 100644 --- a/snark-verifier-sdk/Cargo.toml +++ b/snark-verifier-sdk/Cargo.toml @@ -25,7 +25,7 @@ halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curv # loader_halo2 halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true } -poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2023_04_20", optional = true } +poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2024_01_31", optional = true } # loader_evm ethereum-types = { version = "0.14", default-features = false, features = [ diff --git a/snark-verifier-sdk/src/evm.rs b/snark-verifier-sdk/src/evm.rs index 3ec21ff0..8cb703ce 100644 --- a/snark-verifier-sdk/src/evm.rs +++ b/snark-verifier-sdk/src/evm.rs @@ -18,7 +18,6 @@ use halo2_proofs::{ }, transcript::{TranscriptReadBuffer, TranscriptWriterBuffer}, }; -use halo2curves::pairing::Engine; use itertools::Itertools; use rand::{rngs::StdRng, SeedableRng}; pub use snark_verifier::loader::evm::encode_calldata; @@ -128,11 +127,7 @@ where Rc, VerifyingKey = KzgAsVerifyingKey, Accumulator = KzgAccumulator>, - > + AccumulationDecider< - G1Affine, - Rc, - DecidingKey = KzgDecidingKey::G1Affine>, - >, + > + AccumulationDecider, DecidingKey = KzgDecidingKey>, { let protocol = compile( params, diff --git a/snark-verifier/Cargo.toml b/snark-verifier/Cargo.toml index 26cc9734..6ba54d8a 100644 --- a/snark-verifier/Cargo.toml +++ b/snark-verifier/Cargo.toml @@ -25,7 +25,7 @@ revm = { version = "3.5.0", optional = true, default-features = false } # loader_halo2 halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true } -poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2023_04_20", optional = true } +poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2024_01_31", optional = true } # derive_serde serde = { version = "1.0", features = ["derive"], optional = true } diff --git a/snark-verifier/src/pcs/kzg/decider.rs b/snark-verifier/src/pcs/kzg/decider.rs index dbdb4172..cfc64005 100644 --- a/snark-verifier/src/pcs/kzg/decider.rs +++ b/snark-verifier/src/pcs/kzg/decider.rs @@ -5,9 +5,12 @@ use std::marker::PhantomData; /// KZG deciding key. #[derive(Debug, Clone, Copy)] -pub struct KzgDecidingKey { +pub struct KzgDecidingKey +where + M::G1Affine: CurveAffine, +{ /// KZG succinct verifying key. - pub svk: KzgSuccinctVerifyingKey, + pub svk: KzgSuccinctVerifyingKey, /// Generator on G2. pub g2: M::G2Affine, /// Generator to the trusted-setup secret on G2. @@ -15,7 +18,7 @@ pub struct KzgDecidingKey { _marker: PhantomData, } -impl> KzgDecidingKey +impl> KzgDecidingKey where M::G1Affine: CurveAffine, M::G2Affine: CurveAffine, @@ -36,18 +39,18 @@ where } impl> From<(M::G1Affine, M::G2Affine, M::G2Affine)> - for KzgDecidingKey + for KzgDecidingKey where M::G1Affine: CurveAffine, M::G2Affine: CurveAffine, { - fn from((g1, g2, s_g2): (M::G1Affine, M::G2Affine, M::G2Affine)) -> KzgDecidingKey { + fn from((g1, g2, s_g2): (M::G1Affine, M::G2Affine, M::G2Affine)) -> KzgDecidingKey { KzgDecidingKey::new(g1, g2, s_g2) } } impl> AsRef> - for KzgDecidingKey + for KzgDecidingKey { fn as_ref(&self) -> &KzgSuccinctVerifyingKey { &self.svk @@ -79,7 +82,7 @@ mod native { M::Fr: PrimeField, MOS: Clone + Debug, { - type DecidingKey = KzgDecidingKey; + type DecidingKey = KzgDecidingKey; fn decide( dk: &Self::DecidingKey, @@ -135,7 +138,7 @@ mod evm { ::ScalarExt: PrimeField, MOS: Clone + Debug, { - type DecidingKey = KzgDecidingKey; + type DecidingKey = KzgDecidingKey; fn decide( dk: &Self::DecidingKey, From 7d70172aebbeeca7504762a9fc449e61bba1b0da Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 1 Feb 2024 14:45:23 +0800 Subject: [PATCH 4/7] chores: clippy --- snark-verifier/src/loader/halo2/shim.rs | 22 ++++++++++------------ snark-verifier/src/pcs/kzg/accumulation.rs | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/snark-verifier/src/loader/halo2/shim.rs b/snark-verifier/src/loader/halo2/shim.rs index 7a41f30a..91eb521e 100644 --- a/snark-verifier/src/loader/halo2/shim.rs +++ b/snark-verifier/src/loader/halo2/shim.rs @@ -272,10 +272,11 @@ mod halo2_wrong { )?; let acc = Value::known(*scalar) * lhs.value() * rhs.value() + Value::known(constant); - let output = values.iter().skip(1).fold( - Ok::<_, Error>(acc), - |acc, (scalar, lhs, rhs)| { - acc.and_then(|acc| { + let output = + values + .iter() + .skip(1) + .try_fold(acc, |acc, (scalar, lhs, rhs)| { self.apply( ctx, [ @@ -292,10 +293,10 @@ mod halo2_wrong { ) .into(), )?; - Ok(acc + Value::known(*scalar) * lhs.value() * rhs.value()) - }) - }, - )?; + Ok::<_, Error>( + acc + Value::known(*scalar) * lhs.value() * rhs.value(), + ) + })?; self.apply( ctx, [ @@ -419,10 +420,7 @@ mod halo2_wrong { Ok::<_, Error>((scalar.deref().clone(), self.assign_constant(ctx, *base)?)) }) .collect::, _>>()?; - let pairs = pairs - .iter() - .map(|(scalar, base)| (scalar, base)) - .collect_vec(); + let pairs = pairs.iter().map(|tup| (&tup.0, &tup.1)).collect_vec(); self.variable_base_msm(ctx, &pairs) } diff --git a/snark-verifier/src/pcs/kzg/accumulation.rs b/snark-verifier/src/pcs/kzg/accumulation.rs index 1f9bbb9f..122ddad7 100644 --- a/snark-verifier/src/pcs/kzg/accumulation.rs +++ b/snark-verifier/src/pcs/kzg/accumulation.rs @@ -47,7 +47,7 @@ where let (lhs, rhs) = instances .iter() .map(|accumulator| (&accumulator.lhs, &accumulator.rhs)) - .chain(proof.blind.as_ref().map(|(lhs, rhs)| (lhs, rhs))) + .chain(proof.blind.as_ref().map(|tup| (&tup.0, &tup.1))) .unzip::<_, _, Vec<_>, Vec<_>>(); let powers_of_r = proof.r.powers(lhs.len()); From 6015a72565d68c811691e9f1eaf73ce9f586069c Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 1 Feb 2024 14:53:13 +0800 Subject: [PATCH 5/7] cleanup trait bound --- snark-verifier/src/pcs/kzg/accumulation.rs | 4 +--- snark-verifier/src/pcs/kzg/decider.rs | 3 +-- snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs | 6 ++---- snark-verifier/src/pcs/kzg/multiopen/gwc19.rs | 2 -- snark-verifier/src/system/halo2/test/kzg.rs | 3 +-- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/snark-verifier/src/pcs/kzg/accumulation.rs b/snark-verifier/src/pcs/kzg/accumulation.rs index 122ddad7..54a4176d 100644 --- a/snark-verifier/src/pcs/kzg/accumulation.rs +++ b/snark-verifier/src/pcs/kzg/accumulation.rs @@ -2,7 +2,7 @@ use crate::{ loader::{native::NativeLoader, LoadedScalar, Loader}, pcs::{kzg::KzgAccumulator, AccumulationScheme, AccumulationSchemeProver}, util::{ - arithmetic::{Curve, CurveAffine, Field, MultiMillerLoop, PrimeField}, + arithmetic::{Curve, CurveAffine, Field, MultiMillerLoop}, msm::Msm, transcript::{TranscriptRead, TranscriptWrite}, }, @@ -20,7 +20,6 @@ impl AccumulationScheme for KzgAs where M: MultiMillerLoop, M::G1Affine: CurveAffine, - M::Fr: PrimeField, L: Loader, MOS: Clone + Debug, { @@ -142,7 +141,6 @@ impl AccumulationSchemeProver for KzgAs where M: MultiMillerLoop, M::G1Affine: CurveAffine, - M::Fr: PrimeField, MOS: Clone + Debug, { type ProvingKey = KzgAsProvingKey; diff --git a/snark-verifier/src/pcs/kzg/decider.rs b/snark-verifier/src/pcs/kzg/decider.rs index cfc64005..bd2d8f5e 100644 --- a/snark-verifier/src/pcs/kzg/decider.rs +++ b/snark-verifier/src/pcs/kzg/decider.rs @@ -68,7 +68,7 @@ mod native { AccumulationDecider, }, util::{ - arithmetic::{Group, MillerLoopResult, MultiMillerLoop, PrimeField}, + arithmetic::{Group, MillerLoopResult, MultiMillerLoop}, Itertools, }, Error, @@ -79,7 +79,6 @@ mod native { where M: MultiMillerLoop, M::G1Affine: CurveAffine, - M::Fr: PrimeField, MOS: Clone + Debug, { type DecidingKey = KzgDecidingKey; diff --git a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs index 02452221..7c2313b5 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs @@ -1,4 +1,4 @@ -use halo2_curves::group::prime::PrimeCurveAffine; +use halo2_curves::{ff::PrimeField, group::prime::PrimeCurveAffine}; use crate::{ cost::{Cost, CostEstimation}, @@ -8,7 +8,7 @@ use crate::{ PolynomialCommitmentScheme, Query, }, util::{ - arithmetic::{CurveAffine, Fraction, MultiMillerLoop, PrimeField}, + arithmetic::{CurveAffine, Fraction, MultiMillerLoop}, msm::Msm, transcript::TranscriptRead, Itertools, @@ -30,7 +30,6 @@ impl PolynomialCommitmentScheme for KzgAs where M: MultiMillerLoop, M::G1Affine: CurveAffine, - M::Fr: PrimeField + Ord, L: Loader, { type VerifyingKey = KzgSuccinctVerifyingKey; @@ -373,7 +372,6 @@ where impl CostEstimation for KzgAs where M: MultiMillerLoop, - M::Fr: PrimeField, { type Input = Vec>; diff --git a/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs b/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs index 288f1aba..aa5b800b 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs @@ -26,7 +26,6 @@ impl PolynomialCommitmentScheme for KzgAs where M: MultiMillerLoop, M::G1Affine: CurveAffine, - M::Fr: PrimeField, L: Loader, { type VerifyingKey = KzgSuccinctVerifyingKey; @@ -164,7 +163,6 @@ where impl CostEstimation for KzgAs where M: MultiMillerLoop, - M::Fr: PrimeField, { type Input = Vec>; diff --git a/snark-verifier/src/system/halo2/test/kzg.rs b/snark-verifier/src/system/halo2/test/kzg.rs index 2340e624..6528a822 100644 --- a/snark-verifier/src/system/halo2/test/kzg.rs +++ b/snark-verifier/src/system/halo2/test/kzg.rs @@ -1,6 +1,6 @@ use crate::{ system::halo2::test::{read_or_create_srs, MainGateWithRange}, - util::arithmetic::{fe_to_limbs, CurveAffine, MultiMillerLoop, PrimeField}, + util::arithmetic::{fe_to_limbs, CurveAffine, MultiMillerLoop}, }; use halo2_curves::{serde::SerdeObject, CurveExt}; use halo2_proofs::poly::{commitment::ParamsProver, kzg::commitment::ParamsKZG}; @@ -21,7 +21,6 @@ pub const BITS: usize = 68; pub fn setup(k: u32) -> ParamsKZG where - M::Fr: PrimeField, M::G1Affine: SerdeObject + CurveAffine, M::G1: CurveExt, { From bba681c1e5b3bc2e60b36b955ac397fabfe71c54 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 1 Feb 2024 15:10:53 +0800 Subject: [PATCH 6/7] remove halo2curve patch --- Cargo.toml | 3 --- snark-verifier-sdk/Cargo.toml | 2 +- snark-verifier/Cargo.toml | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 425d57f6..31bbef5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,3 @@ members = [ "snark-verifier", "snark-verifier-sdk" ] - -[patch.crates-io] -halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0" } diff --git a/snark-verifier-sdk/Cargo.toml b/snark-verifier-sdk/Cargo.toml index 05db64a8..c64d3031 100644 --- a/snark-verifier-sdk/Cargo.toml +++ b/snark-verifier-sdk/Cargo.toml @@ -21,7 +21,7 @@ snark-verifier = { path = "../snark-verifier", default-features = false } # system_halo2 halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v0.3.0" } # not optional for now -halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0" } +halo2curves = "0.6.0" # loader_halo2 halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2024_01_31", package = "ecc", optional = true } diff --git a/snark-verifier/Cargo.toml b/snark-verifier/Cargo.toml index 6ba54d8a..b0e47c1c 100644 --- a/snark-verifier/Cargo.toml +++ b/snark-verifier/Cargo.toml @@ -11,7 +11,7 @@ num-integer = "0.1.45" num-traits = "0.2.15" rand = "0.8" hex = "0.4" -halo2_curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.6.0", package = "halo2curves" } +halo2_curves = { version = "0.6.0", package = "halo2curves" } # parallel rayon = { version = "1.5.3", optional = true } From 2748862d56d69545b0a55582ebadce88add45b66 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 1 Feb 2024 15:20:09 +0800 Subject: [PATCH 7/7] simplify trait bound --- snark-verifier/src/pcs/kzg.rs | 8 ++--- snark-verifier/src/pcs/kzg/decider.rs | 34 ++++--------------- .../src/pcs/kzg/multiopen/bdfg21.rs | 9 ++--- snark-verifier/src/pcs/kzg/multiopen/gwc19.rs | 9 +++-- snark-verifier/src/system/halo2/test/kzg.rs | 9 +++-- .../src/system/halo2/test/kzg/evm.rs | 7 ++-- .../src/system/halo2/test/kzg/native.rs | 7 ++-- 7 files changed, 27 insertions(+), 56 deletions(-) diff --git a/snark-verifier/src/pcs/kzg.rs b/snark-verifier/src/pcs/kzg.rs index 8f416ee3..cc8f5c98 100644 --- a/snark-verifier/src/pcs/kzg.rs +++ b/snark-verifier/src/pcs/kzg.rs @@ -1,8 +1,6 @@ //! [KZG]() //! polynomial commitment scheme and accumulation scheme. -use crate::util::arithmetic::CurveAffine; - mod accumulation; mod accumulator; mod decider; @@ -18,19 +16,19 @@ pub use accumulator::LimbsEncodingInstructions; /// KZG succinct verifying key. #[derive(Clone, Copy, Debug)] -pub struct KzgSuccinctVerifyingKey { +pub struct KzgSuccinctVerifyingKey { /// Generator. pub g: C, } -impl KzgSuccinctVerifyingKey { +impl KzgSuccinctVerifyingKey { /// Initialize a [`KzgSuccinctVerifyingKey`]. pub fn new(g: C) -> Self { Self { g } } } -impl From for KzgSuccinctVerifyingKey { +impl From for KzgSuccinctVerifyingKey { fn from(g: C) -> KzgSuccinctVerifyingKey { KzgSuccinctVerifyingKey::new(g) } diff --git a/snark-verifier/src/pcs/kzg/decider.rs b/snark-verifier/src/pcs/kzg/decider.rs index bd2d8f5e..73578f05 100644 --- a/snark-verifier/src/pcs/kzg/decider.rs +++ b/snark-verifier/src/pcs/kzg/decider.rs @@ -1,14 +1,9 @@ -use halo2_curves::CurveAffine; - use crate::{pcs::kzg::KzgSuccinctVerifyingKey, util::arithmetic::MultiMillerLoop}; use std::marker::PhantomData; /// KZG deciding key. #[derive(Debug, Clone, Copy)] -pub struct KzgDecidingKey -where - M::G1Affine: CurveAffine, -{ +pub struct KzgDecidingKey { /// KZG succinct verifying key. pub svk: KzgSuccinctVerifyingKey, /// Generator on G2. @@ -18,11 +13,7 @@ where _marker: PhantomData, } -impl> KzgDecidingKey -where - M::G1Affine: CurveAffine, - M::G2Affine: CurveAffine, -{ +impl KzgDecidingKey { /// Initialize a [`KzgDecidingKey`] pub fn new( svk: impl Into>, @@ -38,20 +29,13 @@ where } } -impl> From<(M::G1Affine, M::G2Affine, M::G2Affine)> - for KzgDecidingKey -where - M::G1Affine: CurveAffine, - M::G2Affine: CurveAffine, -{ +impl From<(M::G1Affine, M::G2Affine, M::G2Affine)> for KzgDecidingKey { fn from((g1, g2, s_g2): (M::G1Affine, M::G2Affine, M::G2Affine)) -> KzgDecidingKey { KzgDecidingKey::new(g1, g2, s_g2) } } -impl> AsRef> - for KzgDecidingKey -{ +impl AsRef> for KzgDecidingKey { fn as_ref(&self) -> &KzgSuccinctVerifyingKey { &self.svk } @@ -132,9 +116,9 @@ mod evm { impl AccumulationDecider> for KzgAs where M: MultiMillerLoop, - M::G1Affine: CurveAffine, + M::Fr: PrimeField, + M::G1Affine: CurveAffine, M::G2Affine: CurveAffine, - ::ScalarExt: PrimeField, MOS: Clone + Debug, { type DecidingKey = KzgDecidingKey; @@ -183,11 +167,7 @@ mod evm { loader.code_mut().runtime_append(code); let challenge = loader.scalar(Value::Memory(challenge_ptr)); - let powers_of_challenge = - LoadedScalar::<::ScalarExt>::powers( - &challenge, - lhs.len(), - ); + let powers_of_challenge = LoadedScalar::::powers(&challenge, lhs.len()); let [lhs, rhs] = [lhs, rhs].map(|msms| { msms.iter() .zip(powers_of_challenge.iter()) diff --git a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs index 7c2313b5..0321d4ad 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/bdfg21.rs @@ -1,4 +1,4 @@ -use halo2_curves::{ff::PrimeField, group::prime::PrimeCurveAffine}; +use halo2_curves::ff::PrimeField; use crate::{ cost::{Cost, CostEstimation}, @@ -29,7 +29,8 @@ pub struct Bdfg21; impl PolynomialCommitmentScheme for KzgAs where M: MultiMillerLoop, - M::G1Affine: CurveAffine, + M::Fr: Ord, + M::G1Affine: CurveAffine, L: Loader, { type VerifyingKey = KzgSuccinctVerifyingKey; @@ -38,7 +39,7 @@ where fn read_proof( _: &KzgSuccinctVerifyingKey, - _: &[Query<::Scalar>], + _: &[Query], transcript: &mut T, ) -> Result, Error> where @@ -51,7 +52,7 @@ where svk: &KzgSuccinctVerifyingKey, commitments: &[Msm], z: &L::LoadedScalar, - queries: &[Query<::Scalar, L::LoadedScalar>], + queries: &[Query], proof: &Bdfg21Proof, ) -> Result { let sets = query_sets(queries); diff --git a/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs b/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs index aa5b800b..54cf8b3a 100644 --- a/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs +++ b/snark-verifier/src/pcs/kzg/multiopen/gwc19.rs @@ -1,5 +1,3 @@ -use halo2_curves::group::prime::PrimeCurveAffine; - use crate::{ cost::{Cost, CostEstimation}, loader::{LoadedScalar, Loader}, @@ -25,7 +23,8 @@ pub struct Gwc19; impl PolynomialCommitmentScheme for KzgAs where M: MultiMillerLoop, - M::G1Affine: CurveAffine, + M::Fr: Ord, + M::G1Affine: CurveAffine, L: Loader, { type VerifyingKey = KzgSuccinctVerifyingKey; @@ -34,7 +33,7 @@ where fn read_proof( _: &Self::VerifyingKey, - queries: &[Query<::Scalar>], + queries: &[Query], transcript: &mut T, ) -> Result where @@ -47,7 +46,7 @@ where svk: &Self::VerifyingKey, commitments: &[Msm], z: &L::LoadedScalar, - queries: &[Query<::Scalar, L::LoadedScalar>], + queries: &[Query], proof: &Self::Proof, ) -> Result { let sets = query_sets(queries); diff --git a/snark-verifier/src/system/halo2/test/kzg.rs b/snark-verifier/src/system/halo2/test/kzg.rs index 6528a822..2446a749 100644 --- a/snark-verifier/src/system/halo2/test/kzg.rs +++ b/snark-verifier/src/system/halo2/test/kzg.rs @@ -27,13 +27,12 @@ where ParamsKZG::::setup(k, ChaCha20Rng::from_seed(Default::default())) } -pub fn main_gate_with_range_with_mock_kzg_accumulator< - C: CurveAffine, - M: MultiMillerLoop, ->() -> MainGateWithRange<::ScalarExt> +pub fn main_gate_with_range_with_mock_kzg_accumulator( +) -> MainGateWithRange where M::G2Affine: CurveAffine + SerdeObject, - M::G1Affine: CurveAffine + SerdeObject, + M::G1Affine: CurveAffine + SerdeObject, + M::G1: CurveExt, { let srs = read_or_create_srs(TESTDATA_DIR, 1, setup::); let [g1, s_g1] = [srs.get_g()[0], srs.get_g()[1]].map(|point| point.coordinates().unwrap()); diff --git a/snark-verifier/src/system/halo2/test/kzg/evm.rs b/snark-verifier/src/system/halo2/test/kzg/evm.rs index 55215f43..3ec00032 100644 --- a/snark-verifier/src/system/halo2/test/kzg/evm.rs +++ b/snark-verifier/src/system/halo2/test/kzg/evm.rs @@ -13,10 +13,7 @@ use crate::{ }, verifier::plonk::PlonkVerifier, }; -use halo2_curves::{ - bn256::{Bn256, G1Affine}, - pairing::Engine, -}; +use halo2_curves::bn256::{Bn256, G1Affine}; use halo2_proofs::poly::kzg::multiopen::{ProverGWC, ProverSHPLONK, VerifierGWC, VerifierSHPLONK}; use paste::paste; use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; @@ -123,7 +120,7 @@ test!( zk_main_gate_with_range_with_mock_kzg_accumulator, 9, halo2_kzg_config!(true, 1, (0..4 * LIMBS).map(|idx| (0, idx)).collect()), - main_gate_with_range_with_mock_kzg_accumulator::<::G1Affine, Bn256>() + main_gate_with_range_with_mock_kzg_accumulator::() ); test!( #[cfg(feature = "loader_halo2")], diff --git a/snark-verifier/src/system/halo2/test/kzg/native.rs b/snark-verifier/src/system/halo2/test/kzg/native.rs index ebdd9fcb..b1d38e06 100644 --- a/snark-verifier/src/system/halo2/test/kzg/native.rs +++ b/snark-verifier/src/system/halo2/test/kzg/native.rs @@ -9,10 +9,7 @@ use crate::{ }, verifier::plonk::PlonkVerifier, }; -use halo2_curves::{ - bn256::{Bn256, G1Affine}, - pairing::Engine, -}; +use halo2_curves::bn256::{Bn256, G1Affine}; use halo2_proofs::{ poly::kzg::multiopen::{ProverGWC, ProverSHPLONK, VerifierGWC, VerifierSHPLONK}, transcript::{Blake2bRead, Blake2bWrite, Challenge255, TranscriptReadBuffer}, @@ -67,5 +64,5 @@ test!( zk_main_gate_with_range_with_mock_kzg_accumulator, 9, halo2_kzg_config!(true, 2, (0..4 * LIMBS).map(|idx| (0, idx)).collect()), - main_gate_with_range_with_mock_kzg_accumulator::<::G1Affine, Bn256>() + main_gate_with_range_with_mock_kzg_accumulator::() );