From ba64f01d1b717f463985a7e6b3328bfe78e2460a Mon Sep 17 00:00:00 2001 From: Sai Deng Date: Tue, 22 Oct 2024 09:32:48 -0700 Subject: [PATCH] Revert "add to zero bin" This reverts commit d098b242872414c0db711224e4c92a894fe350fe. --- evm_arithmetization/tests/two_to_one_block.rs | 1 + zero/src/bin/leader.rs | 2 +- zero/src/bin/leader/cli.rs | 4 --- zero/src/bin/verifier.rs | 2 +- zero/src/bin/verifier/cli.rs | 3 -- zero/src/bin/worker.rs | 4 +-- zero/src/prover_state/circuit.rs | 32 ++++++------------- zero/src/prover_state/mod.rs | 21 ++++-------- 8 files changed, 20 insertions(+), 49 deletions(-) diff --git a/evm_arithmetization/tests/two_to_one_block.rs b/evm_arithmetization/tests/two_to_one_block.rs index 573f64876..1ab6a4fe1 100644 --- a/evm_arithmetization/tests/two_to_one_block.rs +++ b/evm_arithmetization/tests/two_to_one_block.rs @@ -162,6 +162,7 @@ fn get_test_block_proof( Ok(wrapped_block_proof) } +#[ignore] #[test] fn test_two_to_one_block_aggregation() -> anyhow::Result<()> { init_logger(); diff --git a/zero/src/bin/leader.rs b/zero/src/bin/leader.rs index 5f7d9853d..6daaf599f 100644 --- a/zero/src/bin/leader.rs +++ b/zero/src/bin/leader.rs @@ -79,7 +79,7 @@ async fn main() -> Result<()> { if let paladin::config::Runtime::InMemory = args.paladin.runtime { args.prover_state_config .into_prover_state_manager() - .initialize(args.use_test_config)?; + .initialize()?; } } diff --git a/zero/src/bin/leader/cli.rs b/zero/src/bin/leader/cli.rs index eced52225..ad9270ee8 100644 --- a/zero/src/bin/leader/cli.rs +++ b/zero/src/bin/leader/cli.rs @@ -29,10 +29,6 @@ pub(crate) struct Cli { // Mode to use for worker for setup (affinity or default) #[arg(long = "worker-run-mode", help_heading = WORKER_HELP_HEADING, value_enum, default_value = "default")] pub(crate) worker_run_mode: WorkerRunMode, - - /// Run in an unsafe but fast configuration for testing purposes - #[arg(long)] - pub(crate) use_test_config: bool, } /// Defines the mode for worker setup in terms of job allocation: diff --git a/zero/src/bin/verifier.rs b/zero/src/bin/verifier.rs index 96d377e45..d306eed10 100644 --- a/zero/src/bin/verifier.rs +++ b/zero/src/bin/verifier.rs @@ -30,7 +30,7 @@ fn main() -> Result<()> { let verifier = args .prover_state_config .into_prover_state_manager() - .verifier(args.use_test_config)?; + .verifier()?; if input_proofs.into_iter().all(|block_proof| { verifier diff --git a/zero/src/bin/verifier/cli.rs b/zero/src/bin/verifier/cli.rs index 40e4f6bed..8c046d85c 100644 --- a/zero/src/bin/verifier/cli.rs +++ b/zero/src/bin/verifier/cli.rs @@ -13,7 +13,4 @@ pub(crate) struct Cli { /// and the verifier state. #[clap(flatten)] pub(crate) prover_state_config: CliProverStateConfig, - /// Run in an unsafe but fast configuration for testing - #[arg(long)] - pub(crate) use_test_config: bool, } diff --git a/zero/src/bin/worker.rs b/zero/src/bin/worker.rs index 67bc1cec3..096863a53 100644 --- a/zero/src/bin/worker.rs +++ b/zero/src/bin/worker.rs @@ -20,8 +20,6 @@ struct Cli { paladin: paladin::config::Config, #[clap(flatten)] prover_state_config: CliProverStateConfig, - #[arg(long)] - use_test_config: bool, } #[tokio::main] @@ -33,7 +31,7 @@ async fn main() -> Result<()> { args.prover_state_config .into_prover_state_manager() - .initialize(args.use_test_config)?; + .initialize()?; let runtime = WorkerRuntime::from_config(&args.paladin, register()).await?; runtime.main_loop().await?; diff --git a/zero/src/prover_state/circuit.rs b/zero/src/prover_state/circuit.rs index e4792a1ef..2d8918057 100644 --- a/zero/src/prover_state/circuit.rs +++ b/zero/src/prover_state/circuit.rs @@ -5,9 +5,6 @@ use std::{ str::FromStr, }; -use evm_arithmetization::testing_utils::{ - TEST_RECURSION_CONFIG, TEST_STARK_CONFIG, TEST_THRESHOLD_DEGREE_BITS, -}; pub use evm_arithmetization::NUM_TABLES; use evm_arithmetization::{AllRecursiveCircuits, AllStark, StarkConfig}; @@ -246,26 +243,15 @@ impl CircuitConfig { } /// Build the circuits from the current config. - pub fn as_all_recursive_circuits(&self, use_test_config: bool) -> AllRecursiveCircuits { - if use_test_config { - AllRecursiveCircuits::new( - &AllStark::default(), - self.as_degree_bits_ranges(), - &TEST_STARK_CONFIG, - Some(&TEST_RECURSION_CONFIG), - Some(&TEST_RECURSION_CONFIG), - Some(TEST_THRESHOLD_DEGREE_BITS), - ) - } else { - AllRecursiveCircuits::new( - &AllStark::default(), - self.as_degree_bits_ranges(), - &StarkConfig::standard_fast_config(), - None, - None, - None, - ) - } + pub fn as_all_recursive_circuits(&self) -> AllRecursiveCircuits { + AllRecursiveCircuits::new( + &AllStark::default(), + self.as_degree_bits_ranges(), + &StarkConfig::standard_fast_config(), + None, + None, + None, + ) } } diff --git a/zero/src/prover_state/mod.rs b/zero/src/prover_state/mod.rs index e56446155..8cdfb45ce 100644 --- a/zero/src/prover_state/mod.rs +++ b/zero/src/prover_state/mod.rs @@ -283,16 +283,14 @@ impl ProverStateManager { } /// Initialize global prover state from the configuration. - pub fn initialize(&self, use_test_config: bool) -> anyhow::Result<()> { + pub fn initialize(&self) -> anyhow::Result<()> { info!("initializing prover state..."); let state = match self.persistence { CircuitPersistence::None => { info!("generating circuits..."); ProverState { - state: self - .circuit_config - .as_all_recursive_circuits(use_test_config), + state: self.circuit_config.as_all_recursive_circuits(), } } CircuitPersistence::Disk(strategy) => { @@ -312,9 +310,8 @@ impl ProverStateManager { } Err(_) => { info!("failed to load preprocessed circuits from disk. generating circuits..."); - let all_recursive_circuits = self - .circuit_config - .as_all_recursive_circuits(use_test_config); + let all_recursive_circuits = + self.circuit_config.as_all_recursive_circuits(); info!("saving preprocessed circuits to disk"); persistence::persist_all_to_disk( &all_recursive_circuits, @@ -346,14 +343,12 @@ impl ProverStateManager { } /// Loads a verifier state from disk or generate it. - pub fn verifier(&self, use_test_config: bool) -> anyhow::Result { + pub fn verifier(&self) -> anyhow::Result { info!("initializing verifier state..."); match self.persistence { CircuitPersistence::None => { info!("generating circuit..."); - let prover_state = self - .circuit_config - .as_all_recursive_circuits(use_test_config); + let prover_state = self.circuit_config.as_all_recursive_circuits(); Ok(VerifierState { state: prover_state.final_verifier_data(), }) @@ -369,9 +364,7 @@ impl ProverStateManager { } Err(_) => { info!("failed to load preprocessed verifier circuit from disk. generating it..."); - let prover_state = self - .circuit_config - .as_all_recursive_circuits(use_test_config); + let prover_state = self.circuit_config.as_all_recursive_circuits(); info!("saving preprocessed verifier circuit to disk"); let state = prover_state.final_verifier_data();