From c043d862d533a725d8d4595d76e1c18aa2517cfd Mon Sep 17 00:00:00 2001 From: Eduard S Date: Fri, 17 May 2024 11:21:03 +0000 Subject: [PATCH] fix: merge renamings --- p3_frontend/src/lib.rs | 10 ++++----- p3_frontend/tests/common/mod.rs | 36 ++++++++++++++++----------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/p3_frontend/src/lib.rs b/p3_frontend/src/lib.rs index 9c1986ec1b..5ba49e25c7 100644 --- a/p3_frontend/src/lib.rs +++ b/p3_frontend/src/lib.rs @@ -5,8 +5,8 @@ extern crate alloc; use halo2_middleware::circuit::{ - Any, Cell, ColumnMid, CompiledCircuitV2, ConstraintSystemMid, ExpressionMid, GateMid, - PreprocessingV2, QueryMid, VarMid, + Any, Cell, ColumnMid, CompiledCircuit, ConstraintSystemMid, ExpressionMid, GateMid, + Preprocessing, QueryMid, VarMid, }; use halo2_middleware::ff::{Field, PrimeField}; use halo2_middleware::permutation; @@ -89,7 +89,7 @@ pub fn compile_preprocessing( size: usize, pre: &PreprocessingInfo, _air: &A, -) -> PreprocessingV2 +) -> Preprocessing where F: PrimeField + Hash, A: Air>>, @@ -137,7 +137,7 @@ where )); } - PreprocessingV2 { + Preprocessing { permutation: permutation::AssemblyMid { copies }, fixed, } @@ -307,7 +307,7 @@ pub fn trace_to_wit(k: u32, trace: RowMajorMatrix>) -> Vec( - circuit: &CompiledCircuitV2, + circuit: &CompiledCircuit, k: u32, witness: &[Option>], public: &[Vec], diff --git a/p3_frontend/tests/common/mod.rs b/p3_frontend/tests/common/mod.rs index 84051d4a50..771bafe7b9 100644 --- a/p3_frontend/tests/common/mod.rs +++ b/p3_frontend/tests/common/mod.rs @@ -4,15 +4,16 @@ use halo2_backend::poly::kzg::multiopen::{ProverSHPLONK, VerifierSHPLONK}; use halo2_backend::poly::kzg::strategy::SingleStrategy; use halo2_backend::{ plonk::{ - keygen::{keygen_pk_v2, keygen_vk_v2}, - prover::ProverV2Single, + keygen::{keygen_pk, keygen_vk}, + prover::ProverSingle, verifier::verify_proof_single, }, transcript::{ Blake2bRead, Blake2bWrite, Challenge255, TranscriptReadBuffer, TranscriptWriterBuffer, }, }; -use halo2_middleware::circuit::CompiledCircuitV2; +use halo2_middleware::circuit::CompiledCircuit; +use halo2_middleware::zal::impls::H2cEngine; use halo2curves::bn256::{Bn256, Fr, G1Affine}; use p3_air::Air; use p3_frontend::{ @@ -46,7 +47,7 @@ pub(crate) fn compile_witgen( size: usize, num_public_values: usize, trace: RowMajorMatrix>, -) -> (CompiledCircuitV2, Vec>>, Vec>) +) -> (CompiledCircuit, Vec>>, Vec>) where A: Air>>, { @@ -61,7 +62,7 @@ where cs.gates.iter().map(|g| g.poly.degree()).max().unwrap() ); let preprocessing = compile_preprocessing::(k, size, &preprocessing_info, &air); - let compiled_circuit = CompiledCircuitV2 { cs, preprocessing }; + let compiled_circuit = CompiledCircuit { cs, preprocessing }; let witness = trace_to_wit(k, trace); let pis = get_public_inputs(&preprocessing_info, size, &witness); @@ -70,7 +71,7 @@ where } pub(crate) fn setup_prove_verify( - compiled_circuit: &CompiledCircuitV2, + compiled_circuit: &CompiledCircuit, k: u32, pis: &[Vec], witness: Vec>>, @@ -80,9 +81,8 @@ pub(crate) fn setup_prove_verify( let params = ParamsKZG::::setup(k, &mut rng); let verifier_params = params.verifier_params(); let start = Instant::now(); - let vk = keygen_vk_v2(¶ms, compiled_circuit).expect("keygen_vk should not fail"); - let pk = - keygen_pk_v2(¶ms, vk.clone(), compiled_circuit).expect("keygen_pk should not fail"); + let vk = keygen_vk(¶ms, compiled_circuit).expect("keygen_vk should not fail"); + let pk = keygen_pk(¶ms, vk.clone(), compiled_circuit).expect("keygen_pk should not fail"); println!("Keygen: {:?}", start.elapsed()); // Proving @@ -90,15 +90,15 @@ pub(crate) fn setup_prove_verify( let start = Instant::now(); let vec_slices: Vec<&[Fr]> = pis.iter().map(|pi| &pi[..]).collect(); let mut transcript = Blake2bWrite::<_, G1Affine, Challenge255<_>>::init(vec![]); - let mut prover = - ProverV2Single::, ProverSHPLONK<'_, Bn256>, _, _, _>::new( - ¶ms, - &pk, - &vec_slices, - &mut rng, - &mut transcript, - ) - .unwrap(); + let mut prover = ProverSingle::< + KZGCommitmentScheme, + ProverSHPLONK<'_, Bn256>, + _, + _, + _, + H2cEngine, + >::new(¶ms, &pk, &vec_slices, &mut rng, &mut transcript) + .unwrap(); println!("phase 0"); prover.commit_phase(0, witness).unwrap(); prover.create_proof().unwrap();