Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit a9761a9

Browse files
committed
Temporarily replace with zkevm-circuits proof-aggregation-circuit branch (and make build work).
1 parent e8dac26 commit a9761a9

15 files changed

+83
-83
lines changed

Cargo.lock

+25-38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "dev
1111
[patch."https://github.com/privacy-scaling-explorations/poseidon.git"]
1212
poseidon = { git = "https://github.com/scroll-tech/poseidon.git", branch = "scroll-dev-0220" }
1313
[patch."https://github.com/privacy-scaling-explorations/halo2wrong.git"]
14-
halo2wrong = { git = "https://github.com/scroll-tech/halo2wrong.git", branch = "halo2-ecc-snark-verifier-0323" }
14+
halo2wrong = { git = "https://github.com/scroll-tech/halo2wrong", branch = "halo2-ecc-snark-verifier-0323" }
1515
maingate = { git = "https://github.com/scroll-tech/halo2wrong", branch = "halo2-ecc-snark-verifier-0323" }
1616
[patch."https://github.com/axiom-crypto/halo2-lib.git"]
17-
halo2-base = { git = "https://github.com/scroll-tech/halo2-lib", branch = "halo2-ecc-snark-verifier-0323" }
18-
halo2-ecc = { git = "https://github.com/scroll-tech/halo2-lib", branch = "halo2-ecc-snark-verifier-0323" }
17+
halo2-base = { git = "https://github.com/scroll-tech/halo2-lib", branch = "develop" }
18+
halo2-ecc = { git = "https://github.com/scroll-tech/halo2-lib", branch = "develop" }
1919
[patch."https://github.com/privacy-scaling-explorations/halo2curves.git"]
2020
halo2curves = { git = "https://github.com/scroll-tech/halo2curves.git", branch = "0.3.1-derive-serde" }
2121

prover/Cargo.toml

+8-9
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

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

11-
bus-mapping = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
12-
eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
13-
zkevm-circuits = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop", default-features = false, features = ["test","scroll","poseidon-codehash-lookup"] }
14-
mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
15-
mock = { git = "https://github.com/scroll-tech/zkevm-circuits", branch = "develop" }
11+
bus-mapping = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "proof-aggregation-circuit" }
12+
eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "proof-aggregation-circuit" }
13+
zkevm-circuits = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "proof-aggregation-circuit", default-features = false, features = ["test","scroll","poseidon-codehash-lookup"] }
14+
mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "proof-aggregation-circuit" }
15+
mock = { git = "https://github.com/scroll-tech/zkevm-circuits", branch = "proof-aggregation-circuit" }
1616

17-
snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", branch = "halo2-ecc-snark-verifier-0323" }
18-
snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "halo2-ecc-snark-verifier-0323" }
17+
snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop" }
18+
snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features=false, features = ["loader_halo2", "loader_evm", "halo2-pse"] }
1919

2020
rand = "0.8"
2121
rand_xorshift = "0.3"
@@ -49,4 +49,3 @@ procfs = "0.13.0"
4949
default = []
5050
# default = ["prove_verify"]
5151
prove_verify = []
52-
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"strategy": "Simple",
3+
"degree": 26,
4+
"num_advice": [
5+
1
6+
],
7+
"num_lookup_advice": [
8+
1
9+
],
10+
"num_fixed": 1,
11+
"lookup_bits": 20,
12+
"limb_bits": 88,
13+
"num_limbs": 3
14+
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"strategy": "Simple",
3+
"degree": 22,
4+
"num_advice": [
5+
8
6+
],
7+
"num_lookup_advice": [
8+
1
9+
],
10+
"num_fixed": 1,
11+
"lookup_bits": 20,
12+
"limb_bits": 88,
13+
"num_limbs": 3
14+
}

prover/src/evm_verifier.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::Proof;
22
use halo2_proofs::halo2curves::bn256::Fr;
3-
use snark_verifier_sdk::evm::evm_verify;
3+
use snark_verifier_sdk::evm_verify;
44

55
pub struct EvmVerifier {
66
bytecode: Vec<u8>,

prover/src/zkevm/circuit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const MAX_BYTECODE: usize = 400_000;
3636
const MAX_MPT_ROWS: usize = 400_000;
3737
const MAX_KECCAK_ROWS: usize = 524_000;
3838
const MAX_RWS: usize = 1_000_000;
39+
const MAX_RLP_ROWS: usize = 500;
3940

4041
pub static CHAIN_ID: Lazy<u64> = Lazy::new(|| read_env_var("CHAIN_ID", 0x82751));
4142
pub static AGG_DEGREE: Lazy<usize> = Lazy::new(|| read_env_var("AGG_DEGREE", 25));

prover/src/zkevm/circuit/builder.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use super::{
22
TargetCircuit, AUTO_TRUNCATE, CHAIN_ID, DEGREE, MAX_BYTECODE, MAX_CALLDATA, MAX_EXP_STEPS,
3-
MAX_INNER_BLOCKS, MAX_KECCAK_ROWS, MAX_MPT_ROWS, MAX_RWS, MAX_TXS,
3+
MAX_INNER_BLOCKS, MAX_KECCAK_ROWS, MAX_MPT_ROWS, MAX_RLP_ROWS, MAX_RWS, MAX_TXS,
44
};
55
use anyhow::bail;
66
use bus_mapping::circuit_input_builder::{self, BlockHead, CircuitInputBuilder, CircuitsParams};
77
use bus_mapping::state_db::{Account, CodeDB, StateDB};
8-
use eth_types::evm_types::OpcodeId;
9-
use eth_types::ToAddress;
8+
use eth_types::{evm_types::opcode_ids::OpcodeId, ToAddress};
109
use ethers_core::types::{Bytes, U256};
1110
use halo2_proofs::halo2curves::bn256::Fr;
1211
use is_even::IsEven;
@@ -186,12 +185,12 @@ pub fn block_traces_to_witness_block_with_updated_state(
186185
let chain_ids = block_traces
187186
.iter()
188187
.map(|block_trace| block_trace.chain_id)
189-
.collect::<Vec<U256>>();
188+
.collect::<Vec<_>>();
190189

191190
let chain_id = if !chain_ids.is_empty() {
192191
chain_ids[0]
193192
} else {
194-
(*CHAIN_ID).into()
193+
*CHAIN_ID
195194
};
196195

197196
let mut state_db: StateDB = zktrie_state.state().clone();
@@ -213,6 +212,7 @@ pub fn block_traces_to_witness_block_with_updated_state(
213212
max_keccak_rows: MAX_KECCAK_ROWS,
214213
max_exp_steps: MAX_EXP_STEPS,
215214
max_mpt_rows: MAX_MPT_ROWS,
215+
max_rlp_rows: MAX_RLP_ROWS,
216216
};
217217
let mut builder_block = circuit_input_builder::Block::from_headers(&[], circuit_params);
218218
builder_block.chain_id = chain_id;

prover/src/zkevm/prover.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ use halo2_proofs::{
2020
poly::kzg::commitment::ParamsKZG,
2121
};
2222
use snark_verifier_sdk::{
23-
evm::gen_evm_proof_shplonk,
24-
gen_pk,
25-
halo2::{aggregation::AggregationCircuit, gen_snark_shplonk},
26-
CircuitExt, Snark,
23+
gen_evm_proof_shplonk, gen_pk, gen_snark_shplonk, AggregationCircuit, CircuitExt, Snark,
2724
};
2825

2926
mod evm;

prover/src/zkevm/prover/evm.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use super::Prover;
22
use halo2_proofs::halo2curves::bn256::G1Affine;
33
use halo2_proofs::plonk::VerifyingKey;
4-
use snark_verifier_sdk::evm::gen_evm_verifier_shplonk;
5-
use snark_verifier_sdk::halo2::aggregation::AggregationCircuit;
6-
use snark_verifier_sdk::CircuitExt;
4+
use snark_verifier_sdk::{gen_evm_verifier_shplonk, AggregationCircuit, CircuitExt};
75
use std::path::Path;
86

97
impl Prover {

prover/src/zkevm/verifier.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ use halo2_proofs::{
1818
transcript::TranscriptReadBuffer,
1919
};
2020
use snark_verifier::system::halo2::transcript::evm::EvmTranscript;
21-
use snark_verifier_sdk::{
22-
halo2::{aggregation::AggregationCircuit, verify_snark_shplonk},
23-
Snark,
24-
};
21+
use snark_verifier_sdk::{verify_snark_shplonk, AggregationCircuit, Snark};
2522

2623
pub struct Verifier {
2724
zkevm_params: ParamsKZG<Bn256>,

prover/tests/aggregation_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use prover::{
1010
};
1111
use rand::SeedableRng;
1212
use rand_xorshift::XorShiftRng;
13-
use snark_verifier_sdk::{halo2::aggregation::AggregationCircuit, CircuitExt};
13+
use snark_verifier_sdk::{AggregationCircuit, CircuitExt};
1414
use std::path::{Path, PathBuf};
1515
use std::str::FromStr;
1616

prover/tests/snark_verifier_api.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ use prover::zkevm::{Prover, Verifier};
77
use prover::EvmVerifier;
88
use rand::SeedableRng;
99
use rand_xorshift::XorShiftRng;
10-
use snark_verifier_sdk::evm::{evm_verify, gen_evm_proof_shplonk, gen_evm_verifier_shplonk};
11-
use snark_verifier_sdk::halo2::aggregation::AggregationCircuit;
1210
use snark_verifier_sdk::CircuitExt;
13-
use snark_verifier_sdk::{gen_pk, halo2::gen_snark_shplonk};
11+
use snark_verifier_sdk::{
12+
evm_verify, gen_evm_proof_shplonk, gen_evm_verifier_shplonk, AggregationCircuit,
13+
};
14+
use snark_verifier_sdk::{gen_pk, gen_snark_shplonk};
1415
use test_util::mock_plonk;
1516

1617
// This is essentially a same test as snark-verifier/evm-verifier

types/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.4.0"
44
edition = "2021"
55

66
[dependencies]
7-
eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop" }
7+
eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "proof-aggregation-circuit" }
88
base64 = "0.13.0"
99
blake2 = "0.10.3"
1010
ethers-core = "0.17.0"

0 commit comments

Comments
 (0)