Skip to content

Commit

Permalink
Revert "add to zero bin"
Browse files Browse the repository at this point in the history
This reverts commit d098b24.
  • Loading branch information
sai-deng committed Oct 22, 2024
1 parent d098b24 commit ba64f01
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 49 deletions.
1 change: 1 addition & 0 deletions evm_arithmetization/tests/two_to_one_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion zero/src/bin/leader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
}
}

Expand Down
4 changes: 0 additions & 4 deletions zero/src/bin/leader/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion zero/src/bin/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions zero/src/bin/verifier/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
4 changes: 1 addition & 3 deletions zero/src/bin/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ struct Cli {
paladin: paladin::config::Config,
#[clap(flatten)]
prover_state_config: CliProverStateConfig,
#[arg(long)]
use_test_config: bool,
}

#[tokio::main]
Expand All @@ -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?;
Expand Down
32 changes: 9 additions & 23 deletions zero/src/prover_state/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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,
)
}
}

Expand Down
21 changes: 7 additions & 14 deletions zero/src/prover_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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,
Expand Down Expand Up @@ -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<VerifierState> {
pub fn verifier(&self) -> anyhow::Result<VerifierState> {
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(),
})
Expand All @@ -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();
Expand Down

0 comments on commit ba64f01

Please sign in to comment.