Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prover): fix degrees logic in prover new #1512

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions prover/src/zk_circuits_handler/darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ impl DarwinHandler {
chunk_prover: None,
geth_client,
};
let degrees: Vec<u32> = Self::get_degrees(&prover_types_set);
for prover_type in prover_types_set {
match prover_type {
ProverType::Chunk => {
let degrees = prover_darwin::config::ZKEVM_DEGREES.clone();
let params_map = super::common::get_params_map(|| {
log::info!(
"calling get_params_map from {}, prover_type: {:?}, degrees: {:?}",
Expand All @@ -80,7 +80,6 @@ impl DarwinHandler {
}

ProverType::Batch => {
let degrees = prover_darwin::config::AGG_DEGREES.clone();
let params_map = super::common::get_params_map(|| {
log::info!(
"calling get_params_map from {}, prover_type: {:?}, degrees: {:?}",
Expand All @@ -99,6 +98,21 @@ impl DarwinHandler {
Ok(handler)
}

fn get_degrees(prover_types: &std::collections::HashSet<ProverType>) -> Vec<u32> {
fn get_degrees_inner(prover_type: &ProverType) -> Vec<u32> {
match prover_type {
ProverType::Chunk => prover_darwin::config::ZKEVM_DEGREES.clone(),
ProverType::Batch => prover_darwin::config::AGG_DEGREES.clone(),
}
}
prover_types
.iter()
.flat_map(get_degrees_inner)
.collect::<std::collections::HashSet<u32>>()
.into_iter()
.collect()
}

pub fn new(
prover_type: ProverType,
params_dir: &str,
Expand Down
18 changes: 16 additions & 2 deletions prover/src/zk_circuits_handler/darwin_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ impl DarwinV2Handler {
chunk_prover: None,
geth_client,
};
let degrees: Vec<u32> = Self::get_degrees(&prover_types_set);
for prover_type in prover_types_set {
match prover_type {
ProverType::Chunk => {
let degrees = prover_darwin::config::ZKEVM_DEGREES.clone();
let params_map = super::common::get_params_map(|| {
log::info!(
"calling get_params_map from {}, prover_type: {:?}, degrees: {:?}",
Expand All @@ -80,7 +80,6 @@ impl DarwinV2Handler {
}

ProverType::Batch => {
let degrees = prover_darwin::config::AGG_DEGREES.clone();
let params_map = super::common::get_params_map(|| {
log::info!(
"calling get_params_map from {}, prover_type: {:?}, degrees: {:?}",
Expand All @@ -99,6 +98,21 @@ impl DarwinV2Handler {
Ok(handler)
}

fn get_degrees(prover_types: &std::collections::HashSet<ProverType>) -> Vec<u32> {
fn get_degrees_inner(prover_type: &ProverType) -> Vec<u32> {
match prover_type {
ProverType::Chunk => prover_darwin::config::ZKEVM_DEGREES.clone(),
roynalnaruto marked this conversation as resolved.
Show resolved Hide resolved
ProverType::Batch => prover_darwin::config::AGG_DEGREES.clone(),
}
}
prover_types
.iter()
.flat_map(get_degrees_inner)
.collect::<std::collections::HashSet<u32>>()
.into_iter()
.collect()
}

pub fn new(
prover_type: ProverType,
params_dir: &str,
Expand Down
Loading