From 73fd6cbe8b91b04f8e4c8b78ce671ffac424b8af Mon Sep 17 00:00:00 2001 From: Sai <135601871+sai-deng@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:33:19 +0000 Subject: [PATCH] Add faster STARK configuration for testing purposes (#739) Enables fast STARK configurations in integration tests. Achieved up to 82% test time savings. Detailed results are provided below. With the big test time savings for the two_to_one_block_aggregation test, I have removed [ignore] from it. --- .../src/fixed_recursive_verifier.rs | 71 +++++++++++++------ evm_arithmetization/src/testing_utils.rs | 42 +++++++++++ evm_arithmetization/tests/add11_yml.rs | 8 +-- evm_arithmetization/tests/empty_tables.rs | 11 ++- evm_arithmetization/tests/erc20.rs | 5 +- evm_arithmetization/tests/erc721.rs | 6 +- evm_arithmetization/tests/global_exit_root.rs | 5 +- evm_arithmetization/tests/log_opcode.rs | 6 +- evm_arithmetization/tests/selfdestruct.rs | 6 +- evm_arithmetization/tests/simple_transfer.rs | 6 +- evm_arithmetization/tests/two_to_one_block.rs | 7 +- evm_arithmetization/tests/withdrawals.rs | 6 +- zero/src/prover_state/circuit.rs | 3 + 13 files changed, 132 insertions(+), 50 deletions(-) diff --git a/evm_arithmetization/src/fixed_recursive_verifier.rs b/evm_arithmetization/src/fixed_recursive_verifier.rs index adde60d1b..2f6a639c6 100644 --- a/evm_arithmetization/src/fixed_recursive_verifier.rs +++ b/evm_arithmetization/src/fixed_recursive_verifier.rs @@ -1,5 +1,6 @@ use core::mem::{self, MaybeUninit}; use core::ops::Range; +use std::cmp::max; use std::collections::BTreeMap; use std::sync::atomic::AtomicBool; use std::sync::Arc; @@ -9,7 +10,6 @@ use hashbrown::HashMap; use itertools::{zip_eq, Itertools}; use mpt_trie::partial_trie::{HashedPartialTrie, Node, PartialTrie}; use plonky2::field::extension::Extendable; -use plonky2::fri::FriParams; use plonky2::gates::constant::ConstantGate; use plonky2::gates::noop::NoopGate; use plonky2::hash::hash_types::{MerkleCapTarget, RichField, NUM_HASH_OUT_ELTS}; @@ -57,6 +57,7 @@ use crate::recursive_verifier::{ recursive_stark_circuit, set_final_public_value_targets, set_public_value_targets, PlonkWrapperCircuit, PublicInputs, StarkWrapperCircuit, }; +use crate::testing_utils::TWO_TO_ONE_BLOCK_CIRCUIT_TEST_THRESHOLD_DEGREE_BITS; use crate::util::h256_limbs; use crate::verifier::initial_memory_merkle_cap; @@ -786,10 +787,19 @@ where all_stark: &AllStark, degree_bits_ranges: &[Range; NUM_TABLES], stark_config: &StarkConfig, + shrinking_circuit_config: Option<&CircuitConfig>, + recursion_circuit_config: Option<&CircuitConfig>, + threshold_degree_bits: Option, ) -> Self { // Sanity check on the provided config assert_eq!(DEFAULT_CAP_LEN, 1 << stark_config.fri_config.cap_height); + let shrinking_config = shrinking_config(); + let shrinking_circuit_config = shrinking_circuit_config.unwrap_or(&shrinking_config); + let circuit_config = CircuitConfig::standard_recursion_config(); + let recursion_circuit_config = recursion_circuit_config.unwrap_or(&circuit_config); + let threshold_degree_bits = threshold_degree_bits.unwrap_or(THRESHOLD_DEGREE_BITS); + macro_rules! create_recursive_circuit { ($table_enum:expr, $stark_field:ident) => { RecursiveCircuitsForTable::new( @@ -798,6 +808,8 @@ where degree_bits_ranges[*$table_enum].clone(), &all_stark.cross_table_lookups, stark_config, + shrinking_circuit_config, + threshold_degree_bits, ) }; } @@ -829,7 +841,7 @@ where poseidon, ]; - let root = Self::create_segment_circuit(&by_table, stark_config); + let root = Self::create_segment_circuit(&by_table, stark_config, recursion_circuit_config); let segment_aggregation = Self::create_segment_aggregation_circuit(&root); let batch_aggregation = Self::create_batch_aggregation_circuit(&segment_aggregation, stark_config); @@ -897,11 +909,12 @@ where fn create_segment_circuit( by_table: &[RecursiveCircuitsForTable; NUM_TABLES], stark_config: &StarkConfig, + circuit_config: &CircuitConfig, ) -> RootCircuitData { let inner_common_data: [_; NUM_TABLES] = core::array::from_fn(|i| &by_table[i].final_circuits()[0].common); - let mut builder = CircuitBuilder::new(CircuitConfig::standard_recursion_config()); + let mut builder = CircuitBuilder::new(circuit_config.clone()); let table_in_use: [BoolTarget; NUM_TABLES] = core::array::from_fn(|_| builder.add_virtual_bool_target_safe()); @@ -1481,18 +1494,9 @@ where fn create_block_circuit( agg: &BatchAggregationCircuitData, ) -> BlockCircuitData { - // Here, we have two block proofs and we aggregate them together. - // The block circuit is similar to the agg circuit; both verify two inner - // proofs. - let expected_common_data = CommonCircuitData { - fri_params: FriParams { - degree_bits: 14, - ..agg.circuit.common.fri_params.clone() - }, - ..agg.circuit.common.clone() - }; + let expected_common_data = agg.circuit.common.clone(); - let mut builder = CircuitBuilder::::new(CircuitConfig::standard_recursion_config()); + let mut builder = CircuitBuilder::::new(agg.circuit.common.config.clone()); let public_values = add_virtual_public_values_public_input(&mut builder); let has_parent_block = builder.add_virtual_bool_target_safe(); let parent_block_proof = builder.add_virtual_proof_with_pis(&expected_common_data); @@ -1567,6 +1571,10 @@ where let agg_verifier_data = builder.constant_verifier_data(&agg.circuit.verifier_only); builder.verify_proof::(&agg_root_proof, &agg_verifier_data, &agg.circuit.common); + while log2_ceil(builder.num_gates()) < agg.circuit.common.degree_bits() { + builder.add_gate(NoopGate, vec![]); + } + let circuit = builder.build::(); BlockCircuitData { circuit, @@ -1739,7 +1747,17 @@ where // Pad to match the (non-existing yet!) 2-to-1 circuit's degree. // We use the block circuit's degree as target reference here, as they end up // having same degree. - while log2_ceil(builder.num_gates()) < block.circuit.common.degree_bits() { + let degree_bits_to_be_padded = block.circuit.common.degree_bits(); + + // When using test configurations, the block circuit's degree is less than the + // 2-to-1 circuit's degree. Therefore, we also need to ensure its size meets + // the 2-to-1 circuit's recursion threshold degree bits. + let degree_bits_to_be_padded = max( + degree_bits_to_be_padded, + TWO_TO_ONE_BLOCK_CIRCUIT_TEST_THRESHOLD_DEGREE_BITS, + ); + + while log2_ceil(builder.num_gates()) < degree_bits_to_be_padded { builder.add_gate(NoopGate, vec![]); } @@ -1826,6 +1844,11 @@ where builder.connect_hashes(mix_hash, mix_hash_virtual); + // Pad to match the block circuit's degree. + while log2_ceil(builder.num_gates()) < block_wrapper_circuit.circuit.common.degree_bits() { + builder.add_gate(NoopGate, vec![]); + } + let circuit = builder.build::(); TwoToOneBlockCircuitData { circuit, @@ -2900,6 +2923,8 @@ where degree_bits_range: Range, all_ctls: &[CrossTableLookup], stark_config: &StarkConfig, + shrinking_circuit_config: &CircuitConfig, + threshold_degree_bits: usize, ) -> Self { let by_stark_size = degree_bits_range .map(|degree_bits| { @@ -2911,6 +2936,8 @@ where degree_bits, all_ctls, stark_config, + shrinking_circuit_config, + threshold_degree_bits, ), ) }) @@ -3023,6 +3050,8 @@ where degree_bits: usize, all_ctls: &[CrossTableLookup], stark_config: &StarkConfig, + shrinking_config: &CircuitConfig, + threshold_degree_bits: usize, ) -> Self { let initial_wrapper = recursive_stark_circuit( table, @@ -3030,8 +3059,8 @@ where degree_bits, all_ctls, stark_config, - &shrinking_config(), - THRESHOLD_DEGREE_BITS, + shrinking_config, + threshold_degree_bits, ); let mut shrinking_wrappers = vec![]; @@ -3042,12 +3071,12 @@ where .map(|wrapper: &PlonkWrapperCircuit| &wrapper.circuit) .unwrap_or(&initial_wrapper.circuit); let last_degree_bits = last.common.degree_bits(); - assert!(last_degree_bits >= THRESHOLD_DEGREE_BITS); - if last_degree_bits == THRESHOLD_DEGREE_BITS { + assert!(last_degree_bits >= threshold_degree_bits); + if last_degree_bits == threshold_degree_bits { break; } - let mut builder = CircuitBuilder::new(shrinking_config()); + let mut builder = CircuitBuilder::new(shrinking_config.clone()); let proof_with_pis_target = builder.add_virtual_proof_with_pis(&last.common); let last_vk = builder.constant_verifier_data(&last.verifier_only); builder.verify_proof::(&proof_with_pis_target, &last_vk, &last.common); @@ -3058,7 +3087,7 @@ where assert!( circuit.common.degree_bits() < last_degree_bits, "Couldn't shrink to expected recursion threshold of 2^{}; stalled at 2^{}", - THRESHOLD_DEGREE_BITS, + threshold_degree_bits, circuit.common.degree_bits() ); shrinking_wrappers.push(PlonkWrapperCircuit { diff --git a/evm_arithmetization/src/testing_utils.rs b/evm_arithmetization/src/testing_utils.rs index 321e7fe07..ac3cdcf0f 100644 --- a/evm_arithmetization/src/testing_utils.rs +++ b/evm_arithmetization/src/testing_utils.rs @@ -11,6 +11,10 @@ use mpt_trie::{ partial_trie::{HashedPartialTrie, Node, PartialTrie}, }; use plonky2::field::goldilocks_field::GoldilocksField; +use plonky2::fri::reduction_strategies::FriReductionStrategy; +use plonky2::fri::FriConfig; +use plonky2::plonk::circuit_data::CircuitConfig; +use starky::config::StarkConfig; pub use crate::cpu::kernel::cancun_constants::*; pub use crate::cpu::kernel::constants::global_exit_root::*; @@ -27,6 +31,44 @@ pub const EMPTY_NODE_HASH: H256 = H256(hex!( "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" )); +/// The recursion threshold when using test configurations +pub const TEST_THRESHOLD_DEGREE_BITS: usize = 10; + +/// The recursion threshold for 2-to-1 block circuit. +pub const TWO_TO_ONE_BLOCK_CIRCUIT_TEST_THRESHOLD_DEGREE_BITS: usize = 13; + +/// A fast STARK config for testing purposes only. +pub const TEST_STARK_CONFIG: StarkConfig = StarkConfig { + security_bits: 1, + num_challenges: 1, + fri_config: FriConfig { + rate_bits: 1, + cap_height: 4, + proof_of_work_bits: 1, + reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5), + num_query_rounds: 1, + }, +}; + +/// A fast Circuit config for testing purposes only. +pub const TEST_RECURSION_CONFIG: CircuitConfig = CircuitConfig { + num_wires: 135, + num_routed_wires: 80, + num_constants: 2, + use_base_arithmetic_gate: true, + security_bits: 1, + num_challenges: 1, + zero_knowledge: false, + max_quotient_degree_factor: 8, + fri_config: FriConfig { + rate_bits: 3, + cap_height: 4, + proof_of_work_bits: 1, + reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5), + num_query_rounds: 1, + }, +}; + pub fn init_logger() { let _ = try_init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info")); } diff --git a/evm_arithmetization/tests/add11_yml.rs b/evm_arithmetization/tests/add11_yml.rs index dd9bfb1ce..5406ebe6a 100644 --- a/evm_arithmetization/tests/add11_yml.rs +++ b/evm_arithmetization/tests/add11_yml.rs @@ -11,12 +11,10 @@ use evm_arithmetization::proof::{BlockHashes, BlockMetadata, TrieRoots}; use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, init_logger, - preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, + preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{ - AllStark, GenerationInputs, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH, -}; +use evm_arithmetization::{AllStark, GenerationInputs, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; @@ -208,7 +206,7 @@ fn add11_yml() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let inputs = get_generation_inputs(); let max_cpu_len_log = 20; diff --git a/evm_arithmetization/tests/empty_tables.rs b/evm_arithmetization/tests/empty_tables.rs index e99c48731..235bbb715 100644 --- a/evm_arithmetization/tests/empty_tables.rs +++ b/evm_arithmetization/tests/empty_tables.rs @@ -4,7 +4,10 @@ use std::time::Duration; use evm_arithmetization::fixed_recursive_verifier::AllRecursiveCircuits; use evm_arithmetization::prover::prove; -use evm_arithmetization::testing_utils::{init_logger, segment_with_empty_tables}; +use evm_arithmetization::testing_utils::{ + init_logger, segment_with_empty_tables, TEST_RECURSION_CONFIG, TEST_STARK_CONFIG, + TEST_THRESHOLD_DEGREE_BITS, +}; use evm_arithmetization::verifier::testing::verify_all_proofs; use evm_arithmetization::AllStark; use plonky2::field::goldilocks_field::GoldilocksField; @@ -12,7 +15,6 @@ use plonky2::plonk::config::PoseidonGoldilocksConfig; use plonky2::timed; use plonky2::util::serialization::{DefaultGateSerializer, DefaultGeneratorSerializer}; use plonky2::util::timing::TimingTree; -use starky::config::StarkConfig; /// This test focuses on testing zkVM proofs with some empty tables. #[test] @@ -24,7 +26,7 @@ fn empty_tables() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let timing = &mut TimingTree::new("Empty Table Test", log::Level::Info); // Generate segment data @@ -59,6 +61,9 @@ fn empty_tables() -> anyhow::Result<()> { &all_stark, &[16..17, 8..9, 7..8, 4..6, 8..9, 4..5, 16..17, 16..17, 16..17], &config, + Some(&TEST_RECURSION_CONFIG), + Some(&TEST_RECURSION_CONFIG), + Some(TEST_THRESHOLD_DEGREE_BITS), ) ); diff --git a/evm_arithmetization/tests/erc20.rs b/evm_arithmetization/tests/erc20.rs index 2baf716e7..f594c7bd3 100644 --- a/evm_arithmetization/tests/erc20.rs +++ b/evm_arithmetization/tests/erc20.rs @@ -11,9 +11,10 @@ use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, create_account_storage, init_logger, preinitialized_state_and_storage_tries, sd2u, update_beacon_roots_account_storage, + TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; @@ -52,7 +53,7 @@ fn test_erc20() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let beneficiary = hex!("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); let sender = hex!("70997970C51812dc3A010C7d01b50e0d17dc79C8"); diff --git a/evm_arithmetization/tests/erc721.rs b/evm_arithmetization/tests/erc721.rs index e416dc87a..8602a9900 100644 --- a/evm_arithmetization/tests/erc721.rs +++ b/evm_arithmetization/tests/erc721.rs @@ -11,10 +11,10 @@ use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, create_account_storage, init_logger, preinitialized_state_and_storage_tries, sd2u, sh2u, - update_beacon_roots_account_storage, + update_beacon_roots_account_storage, TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; @@ -56,7 +56,7 @@ fn test_erc721() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let beneficiary = hex!("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); let owner = hex!("5B38Da6a701c568545dCfcB03FcB875f56beddC4"); diff --git a/evm_arithmetization/tests/global_exit_root.rs b/evm_arithmetization/tests/global_exit_root.rs index b7e82c7a0..5495d4100 100644 --- a/evm_arithmetization/tests/global_exit_root.rs +++ b/evm_arithmetization/tests/global_exit_root.rs @@ -11,9 +11,10 @@ use evm_arithmetization::testing_utils::{ ger_account_nibbles, ger_contract_from_storage, init_logger, scalable_account_nibbles, scalable_contract_from_storage, update_ger_account_storage, update_scalable_account_storage, ADDRESS_SCALABLE_L2_ADDRESS_HASHED, GLOBAL_EXIT_ROOT_ACCOUNT, GLOBAL_EXIT_ROOT_ADDRESS_HASHED, + TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use keccak_hash::keccak; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; @@ -31,7 +32,7 @@ fn test_global_exit_root() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let block_metadata = BlockMetadata { block_timestamp: 1.into(), diff --git a/evm_arithmetization/tests/log_opcode.rs b/evm_arithmetization/tests/log_opcode.rs index 81daf588c..4f274b0b9 100644 --- a/evm_arithmetization/tests/log_opcode.rs +++ b/evm_arithmetization/tests/log_opcode.rs @@ -15,10 +15,10 @@ use evm_arithmetization::proof::{BlockHashes, BlockMetadata, TrieRoots}; use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, init_logger, - preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, + preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; @@ -38,7 +38,7 @@ fn test_log_opcodes() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let beneficiary = hex!("2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"); let sender = hex!("af1276cbb260bb13deddb4209ae99ae6e497f446"); diff --git a/evm_arithmetization/tests/selfdestruct.rs b/evm_arithmetization/tests/selfdestruct.rs index f97dd41cd..e528ae804 100644 --- a/evm_arithmetization/tests/selfdestruct.rs +++ b/evm_arithmetization/tests/selfdestruct.rs @@ -10,10 +10,10 @@ use evm_arithmetization::proof::{BlockHashes, BlockMetadata, TrieRoots}; use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, init_logger, - preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, + preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; @@ -34,7 +34,7 @@ fn test_selfdestruct() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let beneficiary = hex!("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); let sender = hex!("5eb96AA102a29fAB267E12A40a5bc6E9aC088759"); diff --git a/evm_arithmetization/tests/simple_transfer.rs b/evm_arithmetization/tests/simple_transfer.rs index a1e7fb655..6d2cbb6d0 100644 --- a/evm_arithmetization/tests/simple_transfer.rs +++ b/evm_arithmetization/tests/simple_transfer.rs @@ -11,10 +11,10 @@ use evm_arithmetization::proof::{BlockHashes, BlockMetadata, TrieRoots}; use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, init_logger, - preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, + preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; @@ -35,7 +35,7 @@ fn test_simple_transfer() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let beneficiary = hex!("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); let sender = hex!("2c7536e3605d9c16a7a3d7b1898e529396a65c23"); diff --git a/evm_arithmetization/tests/two_to_one_block.rs b/evm_arithmetization/tests/two_to_one_block.rs index e808a33e4..93e26f211 100644 --- a/evm_arithmetization/tests/two_to_one_block.rs +++ b/evm_arithmetization/tests/two_to_one_block.rs @@ -11,6 +11,7 @@ use evm_arithmetization::proof::{ use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, init_logger, preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, + TEST_RECURSION_CONFIG, TEST_STARK_CONFIG, TEST_THRESHOLD_DEGREE_BITS, }; use evm_arithmetization::{AllRecursiveCircuits, AllStark, Node, StarkConfig}; use hex_literal::hex; @@ -161,19 +162,21 @@ fn get_test_block_proof( Ok(wrapped_block_proof) } -#[ignore] #[test] fn test_two_to_one_block_aggregation() -> anyhow::Result<()> { init_logger(); let some_timestamps = [127, 42, 65, 43]; let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let all_circuits = AllRecursiveCircuits::new( &all_stark, &[16..17, 8..9, 12..13, 8..9, 8..9, 6..7, 17..18, 16..17, 7..8], &config, + Some(&TEST_RECURSION_CONFIG), + Some(&TEST_RECURSION_CONFIG), + Some(TEST_THRESHOLD_DEGREE_BITS), ); let bp = some_timestamps diff --git a/evm_arithmetization/tests/withdrawals.rs b/evm_arithmetization/tests/withdrawals.rs index 01b48c0c6..f179d7b7e 100644 --- a/evm_arithmetization/tests/withdrawals.rs +++ b/evm_arithmetization/tests/withdrawals.rs @@ -10,10 +10,10 @@ use evm_arithmetization::proof::{BlockHashes, BlockMetadata, TrieRoots}; use evm_arithmetization::prover::testing::prove_all_segments; use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, init_logger, - preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, + preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, TEST_STARK_CONFIG, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; +use evm_arithmetization::{AllStark, Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; @@ -33,7 +33,7 @@ fn test_withdrawals() -> anyhow::Result<()> { init_logger(); let all_stark = AllStark::::default(); - let config = StarkConfig::standard_fast_config(); + let config = TEST_STARK_CONFIG; let block_metadata = BlockMetadata { block_timestamp: 1.into(), diff --git a/zero/src/prover_state/circuit.rs b/zero/src/prover_state/circuit.rs index da9fb367d..2d8918057 100644 --- a/zero/src/prover_state/circuit.rs +++ b/zero/src/prover_state/circuit.rs @@ -248,6 +248,9 @@ impl CircuitConfig { &AllStark::default(), self.as_degree_bits_ranges(), &StarkConfig::standard_fast_config(), + None, + None, + None, ) } }