From 10c108572fb74d65fd5b4cde6d85ec11bbc3321f Mon Sep 17 00:00:00 2001 From: Zhuo Zhang Date: Mon, 23 Sep 2024 01:45:09 +0000 Subject: [PATCH 1/2] fix v0.13 --- Cargo.lock | 141 ++++++++++++++++++++++++--------------- Cargo.toml | 2 +- integration/src/prove.rs | 10 ++- 3 files changed, 95 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62af41b4..ef68efbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,8 +30,8 @@ dependencies = [ [[package]] name = "aggregator" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "ark-std 0.3.0", "bitstream-io", @@ -51,12 +51,12 @@ dependencies = [ "num-bigint", "once_cell", "rand", - "revm-precompile 9.2.0", - "revm-primitives 7.1.0", + "revm-precompile 7.0.0", + "revm-primitives 4.0.0", "serde", "serde_json", - "snark-verifier", - "snark-verifier-sdk", + "snark-verifier 0.1.0 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", + "snark-verifier-sdk 0.0.1 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", "strum 0.25.0", "strum_macros 0.25.3", "zkevm-circuits", @@ -89,20 +89,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" -[[package]] -name = "alloy-eips" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" -dependencies = [ - "alloy-primitives 0.7.7", - "alloy-rlp", - "c-kzg 1.0.2", - "k256", - "once_cell", - "serde", -] - [[package]] name = "alloy-primitives" version = "0.4.2" @@ -618,8 +604,8 @@ checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "bus-mapping" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "eth-types", "ethers-core", @@ -634,7 +620,7 @@ dependencies = [ "mpt-zktrie", "num", "poseidon-circuit", - "revm-precompile 9.2.0", + "revm-precompile 7.0.0", "serde", "serde_json", "strum 0.25.0", @@ -1314,8 +1300,8 @@ dependencies = [ [[package]] name = "eth-types" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "base64 0.13.1", "ethers-core", @@ -1328,8 +1314,8 @@ dependencies = [ "num-bigint", "poseidon-base", "regex", - "revm-precompile 9.2.0", - "revm-primitives 7.1.0", + "revm-precompile 7.0.0", + "revm-primitives 4.0.0", "serde", "serde_json", "serde_with", @@ -1470,8 +1456,8 @@ dependencies = [ [[package]] name = "external-tracer" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "eth-types", "geth-utils", @@ -1652,8 +1638,8 @@ dependencies = [ [[package]] name = "gadgets" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "eth-types", "halo2_proofs", @@ -1675,8 +1661,8 @@ dependencies = [ [[package]] name = "geth-utils" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "env_logger", "gobuild", @@ -2211,8 +2197,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "snark-verifier", - "snark-verifier-sdk", + "snark-verifier 0.1.0 (git+https://github.com/scroll-tech/snark-verifier?branch=develop)", + "snark-verifier-sdk 0.0.1 (git+https://github.com/scroll-tech/snark-verifier?branch=develop)", "tokio", ] @@ -2517,8 +2503,8 @@ dependencies = [ [[package]] name = "mock" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "eth-types", "ethers-core", @@ -2532,8 +2518,8 @@ dependencies = [ [[package]] name = "mpt-zktrie" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "eth-types", "halo2curves", @@ -3062,8 +3048,8 @@ dependencies = [ [[package]] name = "prover" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "aggregator", "anyhow", @@ -3089,8 +3075,8 @@ dependencies = [ "serde_json", "serde_stacker", "sha2", - "snark-verifier", - "snark-verifier-sdk", + "snark-verifier 0.1.0 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", + "snark-verifier-sdk 0.0.1 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", "zkevm-circuits", ] @@ -3321,15 +3307,14 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "9.2.0" -source = "git+https://github.com/scroll-tech/revm?branch=scroll-evm-executor/v40#5e215742c4d9d771f73d74fcba39628b1a2e3452" +version = "7.0.0" +source = "git+https://github.com/scroll-tech/revm?branch=scroll-evm-executor/v36#36c304d9e9ba4e4b2d5468d91a6bd27210133b6a" dependencies = [ "aurora-engine-modexp", "c-kzg 1.0.2", - "cfg-if 1.0.0", "k256", "once_cell", - "revm-primitives 7.1.0", + "revm-primitives 4.0.0", "ripemd", "secp256k1 0.29.0", "sha2", @@ -3354,10 +3339,9 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "7.1.0" -source = "git+https://github.com/scroll-tech/revm?branch=scroll-evm-executor/v40#5e215742c4d9d771f73d74fcba39628b1a2e3452" +version = "4.0.0" +source = "git+https://github.com/scroll-tech/revm?branch=scroll-evm-executor/v36#36c304d9e9ba4e4b2d5468d91a6bd27210133b6a" dependencies = [ - "alloy-eips", "alloy-primitives 0.7.7", "auto_impl", "bitflags 2.6.0", @@ -3367,9 +3351,11 @@ dependencies = [ "derive_more", "dyn-clone", "enumn", + "halo2curves", "hashbrown 0.14.3", "hex", "once_cell", + "poseidon-base", "serde", ] @@ -3978,6 +3964,29 @@ dependencies = [ "sha3 0.10.6", ] +[[package]] +name = "snark-verifier" +version = "0.1.0" +source = "git+https://github.com/scroll-tech/snark-verifier?branch=v0.1#58c46b74c73156b9e09dc27617369d2acfb4461b" +dependencies = [ + "bytes", + "ethereum-types", + "halo2-base", + "halo2-ecc", + "hex", + "itertools 0.12.1", + "num-bigint", + "num-integer", + "num-traits", + "poseidon", + "rand", + "revm 2.3.1", + "rlp", + "rustc-hash", + "serde", + "sha3 0.10.6", +] + [[package]] name = "snark-verifier-sdk" version = "0.0.1" @@ -3997,7 +4006,29 @@ dependencies = [ "rand_chacha", "serde", "serde_json", - "snark-verifier", + "snark-verifier 0.1.0 (git+https://github.com/scroll-tech/snark-verifier?branch=develop)", +] + +[[package]] +name = "snark-verifier-sdk" +version = "0.0.1" +source = "git+https://github.com/scroll-tech/snark-verifier?branch=v0.1#58c46b74c73156b9e09dc27617369d2acfb4461b" +dependencies = [ + "bincode", + "ethereum-types", + "ff", + "halo2-base", + "hex", + "itertools 0.12.1", + "log", + "num-bigint", + "num-integer", + "num-traits", + "rand", + "rand_chacha", + "serde", + "serde_json", + "snark-verifier 0.1.0 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", ] [[package]] @@ -5000,8 +5031,8 @@ dependencies = [ [[package]] name = "zkevm-circuits" -version = "0.12.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=develop#bf73bdea1809d6e07e53025c1b940d0e8d21dea2" +version = "0.13.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?branch=v0.13#6ac8a73c799f0006263ce438b3c582f98d98fc25" dependencies = [ "array-init", "bus-mapping", @@ -5033,8 +5064,8 @@ dependencies = [ "serde", "serde_json", "sha3 0.10.6", - "snark-verifier", - "snark-verifier-sdk", + "snark-verifier 0.1.0 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", + "snark-verifier-sdk 0.0.1 (git+https://github.com/scroll-tech/snark-verifier?branch=v0.1)", "strum 0.25.0", "strum_macros 0.25.3", "subtle", diff --git a/Cargo.toml b/Cargo.toml index f614b5ff..aca52f9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1.0" tokio = { version = "1.32", features = ["full"] } halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" } -prover = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "develop", default-features = false, features = ["parallel_syn", "scroll"] } +prover = { git = "https://github.com/scroll-tech/zkevm-circuits.git", branch = "v0.13", default-features = false, features = ["parallel_syn", "scroll"] } integration = { path = "integration" } [patch.crates-io] diff --git a/integration/src/prove.rs b/integration/src/prove.rs index 4d93229e..53ae2c0c 100644 --- a/integration/src/prove.rs +++ b/integration/src/prove.rs @@ -29,9 +29,12 @@ pub fn prove_and_verify_chunk( let mut prover = ChunkProver::from_params_and_assets(params_map, assets_path); log::info!("Constructed chunk prover"); + let chunk_identifier = + chunk_identifier.map_or_else(|| chunk.identifier(), |name| name.to_string()); + let now = Instant::now(); let chunk_proof = prover - .gen_chunk_proof(chunk, chunk_identifier, None, Some(output_dir)) + .gen_chunk_proof(chunk, Some(&chunk_identifier), None, Some(output_dir)) .expect("cannot generate chunk snark"); log::info!( "finish generating chunk snark, elapsed: {:?}", @@ -39,7 +42,10 @@ pub fn prove_and_verify_chunk( ); // output_dir is used to load chunk vk - env::set_var("CHUNK_VK_FILENAME", "vk_chunk_0.vkey"); + env::set_var( + "CHUNK_VK_FILENAME", + &format!("vk_chunk_{chunk_identifier}.vkey"), + ); let verifier = new_chunk_verifier(params_map, output_dir); assert!(verifier.verify_snark(chunk_proof.to_snark())); log::info!("Verified chunk proof"); From caaaf521d6fb0e20330442e868b86ff481b1900d Mon Sep 17 00:00:00 2001 From: Zhuo Zhang Date: Mon, 23 Sep 2024 03:51:16 +0000 Subject: [PATCH 2/2] fix --- Cargo.lock | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef68efbb..597bb987 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2258,15 +2258,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.6" @@ -2924,7 +2915,7 @@ dependencies = [ [[package]] name = "poseidon-base" version = "0.1.0" -source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=main#becce8bdd31315108c8f1e0a39ca4e5d20c67dcc" +source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=main#d52fa404e8f03b5c3f85c090ccb8b08c112e2f4d" dependencies = [ "bitvec", "halo2curves", @@ -2935,11 +2926,10 @@ dependencies = [ [[package]] name = "poseidon-circuit" version = "0.1.0" -source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=main#becce8bdd31315108c8f1e0a39ca4e5d20c67dcc" +source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=main#d52fa404e8f03b5c3f85c090ccb8b08c112e2f4d" dependencies = [ "ff", "halo2_proofs", - "itertools 0.13.0", "log", "poseidon-base", "rand",