Skip to content

Commit

Permalink
keep darwin_v2 instead of darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
amoylan2 committed Oct 26, 2024
1 parent 27eaebd commit d25bca8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "
ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" }
snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] }
prover_darwin = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.13.1", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] }
prover_darwin_v2 = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.13.1", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] }
prover_euclid = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "feat/hybrid-snark-agg", package = "prover", default-features = false, features = ["parallel_syn", "scroll"] }
base64 = "0.13.1"
reqwest = { version = "0.12.4", features = ["gzip"] }
Expand Down
6 changes: 3 additions & 3 deletions prover/src/zk_circuits_handler.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod common;
mod darwin;
mod darwin_v2;
mod euclid;

use super::geth_client::GethClient;
Expand All @@ -9,7 +9,7 @@ use crate::{
utils::get_task_types,
};
use anyhow::{bail, Result};
use darwin::DarwinHandler;
use darwin_v2::DarwinV2Handler;
use euclid::EuclidHandler;
use std::{cell::RefCell, collections::HashMap, rc::Rc};

Expand Down Expand Up @@ -61,7 +61,7 @@ impl<'a> CircuitsHandlerProvider<'a> {
&config.low_version_circuit.hard_fork_name
);
AssetsDirEnvConfig::enable_first();
DarwinHandler::new(
DarwinV2Handler::new(
prover_type,
&config.low_version_circuit.params_path,
&config.low_version_circuit.assets_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde::Deserialize;
use crate::types::{CommonHash, Task};
use std::{cell::RefCell, cmp::Ordering, env, rc::Rc};

use prover_darwin::{
use prover_darwin_v2::{
aggregator::Prover as BatchProver,
check_chunk_hashes,
common::Prover as CommonProver,
Expand Down Expand Up @@ -42,14 +42,14 @@ fn get_block_number(block_trace: &BlockTrace) -> Option<u64> {
}

#[derive(Default)]
pub struct DarwinHandler {
pub struct DarwinV2Handler {
chunk_prover: Option<RefCell<ChunkProver<'static>>>,
batch_prover: Option<RefCell<BatchProver<'static>>>,

geth_client: Option<Rc<RefCell<GethClient>>>,
}

impl DarwinHandler {
impl DarwinV2Handler {
pub fn new_multi(
prover_types: Vec<ProverType>,
params_dir: &str,
Expand Down Expand Up @@ -246,7 +246,7 @@ impl DarwinHandler {
}
}

impl CircuitsHandler for DarwinHandler {
impl CircuitsHandler for DarwinV2Handler {
fn get_vk(&self, task_type: TaskType) -> Option<Vec<u8>> {
match task_type {
TaskType::ChunkHalo2 => self
Expand Down Expand Up @@ -320,17 +320,17 @@ mod tests {

#[test]
fn test_circuits() -> Result<()> {
let bi_handler = DarwinHandler::new_multi(
let bi_handler = DarwinV2Handler::new_multi(
vec![ProverType::ChunkHalo2, ProverType::Batch],
&PARAMS_PATH,
&ASSETS_PATH,
None,
)?;

let chunk_handler = bi_handler;
let chunk_vk = chunk_handler.get_vk(TaskType::Chunk).unwrap();
let chunk_vk = chunk_handler.get_vk(TaskType::ChunkHalo2).unwrap();

check_vk(TaskType::Chunk, chunk_vk, "chunk vk must be available");
check_vk(TaskType::ChunkHalo2, chunk_vk, "chunk vk must be available");
let chunk_dir_paths = get_chunk_dir_paths()?;
log::info!("chunk_dir_paths, {:?}", chunk_dir_paths);
let mut chunk_traces = vec![];
Expand Down Expand Up @@ -438,9 +438,10 @@ mod tests {
fn read_vk(proof_type: TaskType) -> Result<String> {
log::info!("read_vk, {:?}", proof_type);
let vk_file = match proof_type {
TaskType::Chunk => CHUNK_VK_PATH.clone(),
TaskType::ChunkHalo2 => CHUNK_VK_PATH.clone(),
TaskType::Batch => BATCH_VK_PATH.clone(),
TaskType::Bundle => todo!(),
TaskType::ChunkSp1 => todo!(),
TaskType::Undefined => unreachable!(),
};

Expand Down
4 changes: 2 additions & 2 deletions prover/src/zk_circuits_handler/euclid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
types::{CommonHash, ProverType, Task, TaskType},
};

use super::{common::*, darwin::ChunkTaskDetail, CircuitsHandler};
use super::{common::*, darwin_v2::ChunkTaskDetail, CircuitsHandler};
// TODO: enable_post_sp1_prover
// use sp1_prover::Sp1Prover;

Expand Down Expand Up @@ -153,7 +153,7 @@ impl EuclidHandler {
}

fn gen_sp1_chunk_proof(&self, task: &crate::types::Task) -> Result<String> {
let chunk_trace = self.gen_chunk_traces(task)?;
let _ = self.gen_chunk_traces(task)?;
todo!()
}

Expand Down

0 comments on commit d25bca8

Please sign in to comment.