Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-deng committed Oct 22, 2024
1 parent 3e3f527 commit b60a028
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions zero/src/prover_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::borrow::Borrow;
use std::{fmt::Display, sync::OnceLock};

use clap::ValueEnum;
use evm_arithmetization::testing_utils::TEST_STARK_CONFIG;
use evm_arithmetization::{
fixed_recursive_verifier::ProverOutputData, prover::prove, AllProof, AllRecursiveCircuits,
AllStark, GenerationSegmentData, RecursiveCircuitsForTableSize, StarkConfig,
Expand Down Expand Up @@ -207,20 +208,20 @@ impl ProverStateManager {
&self,
input: TrimmedGenerationInputs,
segment_data: &mut GenerationSegmentData,
config: &StarkConfig,
) -> anyhow::Result<ProofWithPublicValues> {
let config = StarkConfig::standard_fast_config();
let all_stark = AllStark::default();

let all_proof = prove(
&all_stark,
&config,
config,
input,
segment_data,
&mut TimingTree::default(),
None,
)?;

let table_circuits = self.load_table_circuits(&config, &all_proof)?;
let table_circuits = self.load_table_circuits(config, &all_proof)?;

let proof_with_pvs =
p_state()
Expand All @@ -236,10 +237,11 @@ impl ProverStateManager {
&self,
input: TrimmedGenerationInputs,
segment_data: &mut GenerationSegmentData,
config: &StarkConfig,
) -> anyhow::Result<ProofWithPublicValues> {
let p_out = p_state().state.prove_segment(
&AllStark::default(),
&StarkConfig::standard_fast_config(),
config,
input,
segment_data,
&mut TimingTree::default(),
Expand Down Expand Up @@ -269,15 +271,20 @@ impl ProverStateManager {
input: (TrimmedGenerationInputs, GenerationSegmentData),
) -> anyhow::Result<ProofWithPublicValues> {
let (generation_inputs, mut segment_data) = input;
let config = if self.circuit_config.use_test_config {
TEST_STARK_CONFIG
} else {
StarkConfig::standard_fast_config()
};

match self.persistence {
CircuitPersistence::None | CircuitPersistence::Disk(TableLoadStrategy::Monolithic) => {
info!("using monolithic circuit {:?}", self);
self.segment_proof_monolithic(generation_inputs, &mut segment_data)
self.segment_proof_monolithic(generation_inputs, &mut segment_data, &config)
}
CircuitPersistence::Disk(TableLoadStrategy::OnDemand) => {
info!("using on demand circuit {:?}", self);
self.segment_proof_on_demand(generation_inputs, &mut segment_data)
self.segment_proof_on_demand(generation_inputs, &mut segment_data, &config)
}
}
}
Expand Down

0 comments on commit b60a028

Please sign in to comment.