diff --git a/Cargo.lock b/Cargo.lock index c38d46830..7303a361f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ [[package]] name = "aggregator" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "ark-std", "env_logger 0.10.0", @@ -226,7 +226,7 @@ checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" [[package]] name = "bin" -version = "0.4.0" +version = "0.6.4" dependencies = [ "anyhow", "clap", @@ -419,7 +419,7 @@ checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "bus-mapping" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "eth-types", "ethers-core 0.17.0", @@ -1122,7 +1122,7 @@ dependencies = [ [[package]] name = "eth-types" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "ethers-core 0.17.0", "ethers-signers", @@ -1387,7 +1387,7 @@ dependencies = [ [[package]] name = "external-tracer" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "eth-types", "geth-utils", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "gadgets" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "digest 0.7.6", "eth-types", @@ -1640,7 +1640,7 @@ dependencies = [ [[package]] name = "geth-utils" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "env_logger 0.9.3", "gobuild 0.1.0-alpha.2 (git+https://github.com/scroll-tech/gobuild.git)", @@ -1750,21 +1750,6 @@ dependencies = [ "rustc-hash", ] -[[package]] -name = "halo2-base" -version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#2c225864227e74b207d9f4b9e08c4d5f1afc69a1" -dependencies = [ - "ff", - "halo2_proofs", - "itertools", - "num-bigint", - "num-integer", - "num-traits", - "rand_chacha", - "rustc-hash", -] - [[package]] name = "halo2-ecc" version = "0.2.2" @@ -1772,26 +1757,7 @@ source = "git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0#2c225864227e74 dependencies = [ "ff", "group", - "halo2-base 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0)", - "itertools", - "num-bigint", - "num-integer", - "num-traits", - "rand", - "rand_chacha", - "rand_core", - "serde", - "serde_json", -] - -[[package]] -name = "halo2-ecc" -version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#2c225864227e74b207d9f4b9e08c4d5f1afc69a1" -dependencies = [ - "ff", - "group", - "halo2-base 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?branch=develop)", + "halo2-base", "itertools", "num-bigint", "num-integer", @@ -1822,7 +1788,7 @@ dependencies = [ [[package]] name = "halo2-mpt-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/mpt-circuit.git?branch=v0.5#2163a9c436ed85363c954ecf7e6e1044a1b991dc" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.5.1#2163a9c436ed85363c954ecf7e6e1044a1b991dc" dependencies = [ "ethers-core 0.17.0", "halo2_proofs", @@ -2280,7 +2246,7 @@ dependencies = [ [[package]] name = "keccak256" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "env_logger 0.9.3", "eth-types", @@ -2480,7 +2446,7 @@ dependencies = [ [[package]] name = "mock" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "eth-types", "ethers-core 0.17.0", @@ -2495,7 +2461,7 @@ dependencies = [ [[package]] name = "mpt-zktrie" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "bus-mapping", "eth-types", @@ -2994,7 +2960,7 @@ dependencies = [ [[package]] name = "prover" -version = "0.4.0" +version = "0.6.4" dependencies = [ "aggregator", "anyhow", @@ -3858,8 +3824,8 @@ source = "git+https://github.com/scroll-tech//snark-verifier?tag=v0.1.1#11a09d4a dependencies = [ "bytes", "ethereum-types 0.14.1", - "halo2-base 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0)", - "halo2-ecc 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0)", + "halo2-base", + "halo2-ecc", "hex", "itertools", "lazy_static", @@ -3883,7 +3849,7 @@ dependencies = [ "bincode", "env_logger 0.10.0", "ethereum-types 0.14.1", - "halo2-base 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0)", + "halo2-base", "hex", "itertools", "lazy_static", @@ -4279,7 +4245,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "types" -version = "0.4.0" +version = "0.6.4" dependencies = [ "base64 0.13.1", "blake2", @@ -4746,7 +4712,7 @@ checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] name = "zkevm-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.2#750169c0e7282c267c8216c800ed7c1b7e021b16" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?tag=v0.6.4#5af677cdd3e3b52afc9672ddb8bdedb3e21c7d82" dependencies = [ "array-init", "bus-mapping", @@ -4756,8 +4722,8 @@ dependencies = [ "ethers-core 0.17.0", "ethers-signers", "gadgets", - "halo2-base 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?branch=develop)", - "halo2-ecc 0.2.2 (git+https://github.com/scroll-tech/halo2-lib?branch=develop)", + "halo2-base", + "halo2-ecc", "halo2_proofs", "hex", "itertools", diff --git a/bin/Cargo.toml b/bin/Cargo.toml index 49d0f4d24..a8f2f1826 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bin" -version = "0.4.0" +version = "0.6.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 9b80c801e..5c5ca3391 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prover" -version = "0.4.0" +version = "0.6.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -8,15 +8,15 @@ edition = "2021" [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", tag = "v0.6.2" } -bus-mapping = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.2" } -eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.2" } -zkevm-circuits = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.2", default-features = false, features = ["test","scroll","scroll-trace","shanghai"] } -mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.2" } -mock = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.2" } +aggregator = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4" } +bus-mapping = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4" } +eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4" } +zkevm-circuits = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4", default-features = false, features = ["test","scroll","scroll-trace","shanghai"] } +mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4" } +mock = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4" } -snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.1" } -snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.1" } +snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.2" } +snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.2" } anyhow = "1.0" blake2 = "0.10.3" diff --git a/prover/src/zkevm/capacity_checker.rs b/prover/src/zkevm/capacity_checker.rs index a45fccb3a..0ccdcb777 100644 --- a/prover/src/zkevm/capacity_checker.rs +++ b/prover/src/zkevm/capacity_checker.rs @@ -84,6 +84,11 @@ impl RowUsage { row_number: (1_000_000u64 * (x.row_number as u64) / (*limit as u64)) as usize, }) .collect_vec(); + log::debug!( + "normalize row usage, before {:#?}\nafter {:#?}", + self.row_usage_details, + details + ); Self::from_row_usage_details(details) } pub fn from_row_usage_details(row_usage_details: Vec) -> Self { diff --git a/prover/src/zkevm/circuit/builder.rs b/prover/src/zkevm/circuit/builder.rs index 2dd33cf56..f35c335e7 100644 --- a/prover/src/zkevm/circuit/builder.rs +++ b/prover/src/zkevm/circuit/builder.rs @@ -44,10 +44,15 @@ pub fn calculate_row_usage_of_trace( pub fn calculate_row_usage_of_witness_block( witness_block: &Block, ) -> Result> { - let rows = ::Inner::min_num_rows_block_subcircuits( + let mut rows = ::Inner::min_num_rows_block_subcircuits( witness_block, ); + assert_eq!(SUB_CIRCUIT_NAMES[10], "poseidon"); + assert_eq!(SUB_CIRCUIT_NAMES[13], "mpt"); + // empirical estimation is each row in mpt cost 1.5 hash (aka 12 rows) + rows[10].row_num_real += rows[13].row_num_real * 12; + log::debug!( "row usage of block {:?}, tx num {:?}, tx calldata len sum {}, rows needed {:?}", witness_block diff --git a/types/Cargo.toml b/types/Cargo.toml index 459740795..c84b059c9 100644 --- a/types/Cargo.toml +++ b/types/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "types" -version = "0.4.0" +version = "0.6.4" edition = "2021" [dependencies] -eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.2" } +eth-types = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.6.4" } base64 = "0.13.0" blake2 = "0.10.3" ethers-core = "0.17.0"