Skip to content

Commit

Permalink
upgrade zkevm-circuits to v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lispc committed Sep 6, 2023
1 parent 816dae5 commit 2679718
Show file tree
Hide file tree
Showing 22 changed files with 188 additions and 175 deletions.
62 changes: 18 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
members = [
"bin",
"prover",
"types",
]

[patch.crates-io]
Expand Down
3 changes: 1 addition & 2 deletions bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bin"
version = "0.7.1"
version = "0.8.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -20,7 +20,6 @@ serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0.66"
tokio = { version = "1", features = ["full"] }
types = { path = "../types" }
prover = { path = "../prover" }

[[bin]]
Expand Down
17 changes: 9 additions & 8 deletions bin/src/mock_testnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use anyhow::Result;
use ethers_providers::{Http, Provider};
use prover::{
inner::Prover,
types::eth::BlockTrace,
utils::init_env_and_log,
zkevm::circuit::{
block_traces_to_witness_block, calculate_row_usage_of_witness_block, SuperCircuit,
Expand All @@ -12,7 +13,6 @@ use prover::{
use reqwest::Url;
use serde::Deserialize;
use std::env;
use types::eth::BlockTrace;

const DEFAULT_BEGIN_BATCH: i64 = 1;
const DEFAULT_END_BATCH: i64 = i64::MAX;
Expand Down Expand Up @@ -70,6 +70,7 @@ async fn main() {
continue;
}
};

let result = Prover::<SuperCircuit>::mock_prove_witness_block(&witness_block);

match result {
Expand All @@ -94,7 +95,7 @@ async fn main() {

fn build_block(
block_traces: &[BlockTrace],
batch_id: i64,
_batch_id: i64,
chunk_id: i64,
) -> anyhow::Result<WitnessBlock> {
let gas_total: u64 = block_traces
Expand All @@ -104,19 +105,19 @@ fn build_block(
let witness_block = block_traces_to_witness_block(block_traces)?;
let rows = calculate_row_usage_of_witness_block(&witness_block)?;
log::info!(
"rows of batch {batch_id}(block range {:?} to {:?}):",
"rows of chunk {chunk_id}(block range {:?} to {:?}):",
block_traces.first().and_then(|b| b.header.number),
block_traces.last().and_then(|b| b.header.number),
);
for r in &rows {
log::info!("rows of {}: {}", r.name, r.row_num_real);
}
let row_num = rows.iter().map(|x| x.row_num_real).max().unwrap();
let row_num = rows.iter().max_by_key(|x| x.row_num_real).unwrap();
log::info!(
"final rows of chunk {chunk_id}: row {}, gas {}, gas/row {:.2}",
row_num,
gas_total,
gas_total as f64 / row_num as f64
"final rows of chunk {chunk_id}: row {}({}), gas {gas_total}, gas/row {:.2}",
row_num.row_num_real,
row_num.name,
gas_total as f64 / row_num.row_num_real as f64
);
Ok(witness_block)
}
Expand Down
19 changes: 9 additions & 10 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "prover"
version = "0.7.5"
version = "0.8.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_02_02" }

aggregator = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
bus-mapping = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
mock = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
zkevm-circuits = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop", default-features = false, features = ["shanghai", "scroll"] }
aggregator = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.8.0" }
bus-mapping = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.8.0" }
eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.8.0" }
mock = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.8.0" }
mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.8.0" }
zkevm-circuits = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.8.0", default-features = false, features = ["shanghai", "scroll"] }

snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.3" }
snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.3", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] }
snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.4" }
snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.4", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] }

anyhow = "1.0"
base64 = "0.13.0"
Expand All @@ -42,7 +42,6 @@ serde_stacker = "0.1"
sha2 ="0.10.2"
strum = "0.24"
strum_macros = "0.24"
types = { path = "../types", features = ["test"] }

[target.'cfg(target_os = "linux")'.dependencies]
procfs = "0.13.0"
Expand Down
2 changes: 1 addition & 1 deletion prover/src/inner/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use crate::{
common,
config::INNER_DEGREE,
io::serialize_vk,
types::eth::BlockTrace,
utils::{chunk_trace_to_witness_block, gen_rng},
zkevm::circuit::TargetCircuit,
Proof,
};
use anyhow::Result;
use std::marker::PhantomData;
use types::eth::BlockTrace;

mod mock;

Expand Down
2 changes: 1 addition & 1 deletion prover/src/inner/prover/mock.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use super::Prover;
use crate::{
config::INNER_DEGREE,
types::eth::BlockTrace,
utils::metric_of_witness_block,
zkevm::circuit::{block_traces_to_witness_block, TargetCircuit},
};
use anyhow::bail;
use halo2_proofs::{dev::MockProver, halo2curves::bn256::Fr};
use types::eth::BlockTrace;
use zkevm_circuits::witness::Block;

impl<C: TargetCircuit> Prover<C> {
Expand Down
1 change: 1 addition & 0 deletions prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub mod inner;
pub mod io;
pub mod proof;
pub mod test_util;
pub mod types;
pub mod utils;
pub mod zkevm;

Expand Down
2 changes: 1 addition & 1 deletion prover/src/proof.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{
io::{deserialize_fr, deserialize_vk, serialize_fr, serialize_vk, write_file},
types::base64,
utils::short_git_version,
};
use anyhow::{bail, Result};
Expand All @@ -20,7 +21,6 @@ use std::{
fs::File,
path::{Path, PathBuf},
};
use types::base64;

mod batch;
mod chunk;
Expand Down
Loading

0 comments on commit 2679718

Please sign in to comment.