From 2f4ee62d509670813aa1135db2b0bb532edf1e90 Mon Sep 17 00:00:00 2001 From: Timofey Luin Date: Thu, 21 Sep 2023 18:12:47 +0200 Subject: [PATCH] merge --- lightclient-circuits/config/aggregation.json | 230 ------------------ lightclient-circuits/src/aggregation.rs | 6 +- .../src/committee_update_circuit.rs | 7 +- 3 files changed, 9 insertions(+), 234 deletions(-) delete mode 100644 lightclient-circuits/config/aggregation.json diff --git a/lightclient-circuits/config/aggregation.json b/lightclient-circuits/config/aggregation.json deleted file mode 100644 index 02da1a3e..00000000 --- a/lightclient-circuits/config/aggregation.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "params": { - "strategy": "Vertical", - "k": 17, - "num_advice_per_phase": [ - 208, - 0, - 0 - ], - "num_lookup_advice_per_phase": [ - 25, - 0, - 0 - ], - "num_fixed": 4 - }, - "break_points": [ - [ - 131060, - 131062, - 131062, - 131062, - 131060, - 131062, - 131062, - 131062, - 131060, - 131062, - 131062, - 131062, - 131060, - 131061, - 131062, - 131062, - 131060, - 131061, - 131061, - 131060, - 131062, - 131060, - 131062, - 131062, - 131062, - 131062, - 131062, - 131061, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131061, - 131060, - 131062, - 131062, - 131062, - 131060, - 131061, - 131062, - 131062, - 131062, - 131062, - 131061, - 131060, - 131061, - 131062, - 131062, - 131062, - 131060, - 131061, - 131061, - 131062, - 131060, - 131060, - 131060, - 131060, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131061, - 131060, - 131060, - 131061, - 131062, - 131061, - 131061, - 131061, - 131062, - 131062, - 131060, - 131061, - 131062, - 131061, - 131060, - 131062, - 131060, - 131062, - 131061, - 131062, - 131060, - 131060, - 131062, - 131061, - 131060, - 131062, - 131061, - 131061, - 131061, - 131062, - 131060, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131060, - 131062, - 131062, - 131062, - 131062, - 131061, - 131062, - 131060, - 131062, - 131062, - 131060, - 131060, - 131062, - 131060, - 131060, - 131060, - 131060, - 131062, - 131062, - 131060, - 131060, - 131062, - 131061, - 131061, - 131062, - 131060, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131062, - 131060, - 131061, - 131060, - 131060, - 131061, - 131061, - 131061, - 131061, - 131062, - 131061, - 131060, - 131062, - 131060, - 131061, - 131060, - 131061, - 131061, - 131060, - 131060, - 131062, - 131060, - 131062, - 131061, - 131062, - 131060, - 131061, - 131062, - 131062, - 131060, - 131061, - 131060, - 131060, - 131061, - 131061, - 131061, - 131061, - 131062, - 131061, - 131060, - 131062, - 131060, - 131061, - 131060, - 131061, - 131061, - 131060, - 131060, - 131062, - 131060, - 131062, - 131061, - 131062, - 131060, - 131061, - 131062, - 131062, - 131060, - 131061, - 131060, - 131060, - 131061, - 131061, - 131061, - 131061, - 131062, - 131062, - 131062, - 131060, - 131061, - 131061 - ], - [], - [] - ] -} \ No newline at end of file diff --git a/lightclient-circuits/src/aggregation.rs b/lightclient-circuits/src/aggregation.rs index 0e2ffc11..c6e39ff3 100644 --- a/lightclient-circuits/src/aggregation.rs +++ b/lightclient-circuits/src/aggregation.rs @@ -40,7 +40,7 @@ impl AppCircuit for AggregationCircuit { snark: &Self::Witness, ) -> Result, halo2_proofs::plonk::Error> { let lookup_bits = params.k() as usize - 1; - let circuit = AggregationCircuit::new::( + let mut circuit = AggregationCircuit::new::( stage, pinning.map(|p| p.break_points), lookup_bits, @@ -49,7 +49,9 @@ impl AppCircuit for AggregationCircuit { ); match stage { - CircuitBuilderStage::Prover => {} + CircuitBuilderStage::Prover => { + circuit.expose_previous_instances(false); + } _ => { circuit.config(params.k(), Some(10)); set_var("LOOKUP_BITS", lookup_bits.to_string()); diff --git a/lightclient-circuits/src/committee_update_circuit.rs b/lightclient-circuits/src/committee_update_circuit.rs index 8f7745f3..1a84bbea 100644 --- a/lightclient-circuits/src/committee_update_circuit.rs +++ b/lightclient-circuits/src/committee_update_circuit.rs @@ -394,9 +394,12 @@ mod tests { .unwrap(); // TODO: Figure out what the first 12 elements of the instances are. - let instances = agg_circuit.instance(); + let instances = agg_circuit.instances(); let num_instances = agg_circuit.num_instance(); + println!("num_instances: {:?}", num_instances); + println!("instances: {:?}", instances); + let proof = gen_evm_proof_shplonk(¶ms, &pk, agg_circuit, instances.clone()); println!("proof size: {}", proof.len()); let deployment_code = AggregationCircuit::gen_evm_verifier_shplonk( @@ -407,6 +410,6 @@ mod tests { ) .unwrap(); println!("deployment_code size: {}", deployment_code.len()); - evm_verify(deployment_code, vec![instances], proof); + evm_verify(deployment_code, instances, proof); } }