From f849fa8f5557518a7bda154ec39530feec55ef54 Mon Sep 17 00:00:00 2001 From: Lech <88630083+Artemka374@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:40:00 +0200 Subject: [PATCH] fix build, use correct VKs --- .../src/compute_setups/full.rs | 24 ++----------- .../src/compute_setups/light.rs | 10 ++++-- .../src/compute_setups/mod.rs | 36 ++++++------------- 3 files changed, 22 insertions(+), 48 deletions(-) diff --git a/crates/zkevm_test_harness/src/compute_setups/full.rs b/crates/zkevm_test_harness/src/compute_setups/full.rs index 32e7df4..4805cc9 100644 --- a/crates/zkevm_test_harness/src/compute_setups/full.rs +++ b/crates/zkevm_test_harness/src/compute_setups/full.rs @@ -134,34 +134,16 @@ pub fn generate_circuit_setup_data( .clone(); create_compression_layer_setup_data( - circuit, + circuit.clone(), &worker, - circuit.proof_config_for_compression_step().fri_lde_factor, + circuit.clone().proof_config_for_compression_step().fri_lde_factor, circuit .proof_config_for_compression_step() .merkle_tree_cap_size, ) } // compression for wrapper circuits - 6 => { - let circuit = get_compression_for_wrapper_circuits(source) - .iter() - .find(|circuit| circuit.numeric_circuit_type() == circuit_type) - .expect(&format!( - "Could not find circuit matching {:?}", - circuit_type - )) - .clone(); - - create_compression_for_wrapper_setup_data( - circuit, - &worker, - circuit.proof_config_for_compression_step().fri_lde_factor, - circuit - .proof_config_for_compression_step() - .merkle_tree_cap_size, - ) - } + 6 => panic!("Full generation of setup for wrapper circuits should be generated with light setup"), _ => unreachable!("Invalid proving stage"), }; diff --git a/crates/zkevm_test_harness/src/compute_setups/light.rs b/crates/zkevm_test_harness/src/compute_setups/light.rs index 07e1338..05f1435 100644 --- a/crates/zkevm_test_harness/src/compute_setups/light.rs +++ b/crates/zkevm_test_harness/src/compute_setups/light.rs @@ -135,7 +135,10 @@ pub fn generate_light_circuit_setup_data( create_light_compression_layer_setup_data( circuit.clone(), &worker, - circuit.clone().proof_config_for_compression_step().fri_lde_factor, + circuit + .clone() + .proof_config_for_compression_step() + .fri_lde_factor, circuit .proof_config_for_compression_step() .merkle_tree_cap_size, @@ -154,7 +157,10 @@ pub fn generate_light_circuit_setup_data( create_light_compression_for_wrapper_setup_data( circuit.clone(), &worker, - circuit.clone().proof_config_for_compression_step().fri_lde_factor, + circuit + .clone() + .proof_config_for_compression_step() + .fri_lde_factor, circuit .proof_config_for_compression_step() .merkle_tree_cap_size, diff --git a/crates/zkevm_test_harness/src/compute_setups/mod.rs b/crates/zkevm_test_harness/src/compute_setups/mod.rs index d00c717..1143e7a 100644 --- a/crates/zkevm_test_harness/src/compute_setups/mod.rs +++ b/crates/zkevm_test_harness/src/compute_setups/mod.rs @@ -47,7 +47,8 @@ fn get_compression_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode1::proof_config_for_compression_step(), - verification_key: source.get_compression_vk(1).unwrap().into_inner(), + // recursion circuit 1 is scheduler + verification_key: source.get_recursion_layer_vk(1).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -57,7 +58,7 @@ fn get_compression_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode2::proof_config_for_compression_step(), - verification_key: source.get_compression_vk(2).unwrap().into_inner(), + verification_key: source.get_compression_vk(1).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -67,7 +68,7 @@ fn get_compression_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode3::proof_config_for_compression_step(), - verification_key: source.get_compression_vk(3).unwrap().into_inner(), + verification_key: source.get_compression_vk(2).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -77,7 +78,7 @@ fn get_compression_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode4::proof_config_for_compression_step(), - verification_key: source.get_compression_vk(4).unwrap().into_inner(), + verification_key: source.get_compression_vk(3).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -87,7 +88,7 @@ fn get_compression_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode5::proof_config_for_compression_step(), - verification_key: source.get_compression_vk(5).unwrap().into_inner(), + verification_key: source.get_compression_vk(4).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -105,10 +106,7 @@ fn get_compression_for_wrapper_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode1::proof_config_for_compression_step(), - verification_key: source - .get_compression_for_wrapper_vk(1) - .unwrap() - .into_inner(), + verification_key: source.get_compression_vk(1).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -120,10 +118,7 @@ fn get_compression_for_wrapper_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode2::proof_config_for_compression_step(), - verification_key: source - .get_compression_for_wrapper_vk(2) - .unwrap() - .into_inner(), + verification_key: source.get_compression_vk(2).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -135,10 +130,7 @@ fn get_compression_for_wrapper_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode3::proof_config_for_compression_step(), - verification_key: source - .get_compression_for_wrapper_vk(3) - .unwrap() - .into_inner(), + verification_key: source.get_compression_vk(3).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -150,10 +142,7 @@ fn get_compression_for_wrapper_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode4::proof_config_for_compression_step(), - verification_key: source - .get_compression_for_wrapper_vk(4) - .unwrap() - .into_inner(), + verification_key: source.get_compression_vk(4).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (), @@ -165,10 +154,7 @@ fn get_compression_for_wrapper_circuits( witness: None, config: CompressionRecursionConfig { proof_config: CompressionMode5::proof_config_for_compression_step(), - verification_key: source - .get_compression_for_wrapper_vk(5) - .unwrap() - .into_inner(), + verification_key: source.get_compression_vk(5).unwrap().into_inner(), _marker: Default::default(), }, transcript_params: (),