diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 110028f6eb..8b211783be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: echo "HOME=/home/CI" >> $GITHUB_ENV - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 - name: Setup golang uses: actions/setup-go@v3 with: @@ -95,7 +95,7 @@ jobs: echo "HOME=/home/CI" >> $GITHUB_ENV - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 - name: Setup golang uses: actions/setup-go@v3 with: @@ -119,7 +119,7 @@ jobs: - name: Run light tests # light tests are run in parallel run: cargo test --verbose --release --all --features scroll --exclude integration-tests --exclude circuit-benchmarks --exclude testool - name: Run heavy tests - run: cargo test --verbose --release --features scroll --all --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored + run: cargo test --verbose --release --features scroll --all --exclude integration-tests --exclude circuit-benchmarks serial_ -- --ignored --skip max_tx - name: Run parallel assignment tests(bytecode) run: cargo test --release --package zkevm-circuits --lib bytecode_circuit::test --features scroll,parallel_syn -- --nocapture - name: Run parallel assignment tests(state) @@ -144,7 +144,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 - name: Add target run: rustup target add ${{ matrix.target }} # Go cache for building geth-utils @@ -181,7 +181,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 # Go cache for building geth-utils - name: Go cache uses: actions/cache@v3 @@ -214,7 +214,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 # Go cache for building geth-utils - name: Go cache uses: actions/cache@v3 @@ -251,7 +251,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 components: rustfmt # Go cache for building geth-utils - name: Go cache diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a7aaf1a641..7c72b04973 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 - name: Setup golang uses: actions/setup-go@v3 with: diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 56577a09ad..58285e8834 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 components: clippy # Go cache for building geth-utils - name: Go cache diff --git a/.github/workflows/test-features.yml b/.github/workflows/test-features.yml index 9a76fb4f86..83884133d0 100644 --- a/.github/workflows/test-features.yml +++ b/.github/workflows/test-features.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2022-12-10 + toolchain: nightly-2023-10-27 # Go cache for building geth-utils - name: Go cache diff --git a/Cargo.lock b/Cargo.lock index e131d307eb..8e6d7588ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,29 +60,30 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "alloy-rlp" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f938f00332d63a5b0ac687bd6f46d03884638948921d9f8b50c59563d421ae25" +checksum = "cc0fac0fc16baf1f63f78b47c3d24718f3619b0714076f6a02957d808d52cbef" dependencies = [ "arrayvec", "bytes", @@ -270,13 +271,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -354,9 +355,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -402,9 +403,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitvec" @@ -475,9 +476,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bus-mapping" @@ -525,9 +526,9 @@ checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -570,9 +571,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] @@ -585,7 +586,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.20", "serde", "serde_json", "thiserror", @@ -599,11 +600,10 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" dependencies = [ - "jobserver", "libc", ] @@ -621,9 +621,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -786,7 +786,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.4", + "base64 0.21.5", "bech32", "bs58", "digest 0.10.7", @@ -901,9 +901,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -1040,9 +1040,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "28f85c3514d2a6e64160359b45a3918c3b4178bcbf4ae5d03ab2d02e521c479a" dependencies = [ "generic-array", "rand_core", @@ -1062,9 +1062,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ "csv-core", "itoa", @@ -1074,9 +1074,9 @@ dependencies = [ [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" dependencies = [ "memchr", ] @@ -1197,9 +1197,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] name = "derivative" @@ -1351,7 +1354,7 @@ checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der 0.7.8", "digest 0.10.7", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "rfc6979 0.4.0", "signature 2.1.0", "spki", @@ -1384,12 +1387,12 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.3", + "crypto-bigint 0.5.4", "digest 0.10.7", "ff 0.13.0", "generic-array", @@ -1451,14 +1454,14 @@ checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -1475,25 +1478,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "eth-keystore" version = "0.5.0" @@ -1522,6 +1514,7 @@ version = "0.1.0" dependencies = [ "ethers-core", "ethers-signers", + "halo2-base", "halo2_proofs", "hex", "itertools 0.11.0", @@ -1592,8 +1585,7 @@ dependencies = [ [[package]] name = "ethers" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a58ce802c65cf3d0756dee5a61094a92cde53c1583b246e9ee5b37226c7fc15" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1602,14 +1594,13 @@ dependencies = [ "ethers-middleware", "ethers-providers", "ethers-signers", - "ethers-solc 2.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-solc", ] [[package]] name = "ethers-addressbook" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b856b7b8ff5c961093cb8efe151fbcce724b451941ce20781de11a531ccd578" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "ethers-core", "once_cell", @@ -1620,8 +1611,7 @@ dependencies = [ [[package]] name = "ethers-contract" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e066a0d9cfc70c454672bf16bb433b0243427420076dc5b2f49c448fb5a10628" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "ethers-contract-abigen", "ethers-contract-derive", @@ -1639,8 +1629,7 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c113e3e86b6bc16d98484b2c3bb2d01d6fed9f489fe2e592e5cc87c3024d616b" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "Inflector", "dunce", @@ -1655,7 +1644,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.32", + "syn 2.0.39", "toml 0.7.8", "walkdir", ] @@ -1663,8 +1652,7 @@ dependencies = [ [[package]] name = "ethers-contract-derive" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3fb5adee25701c79ec58fcf2c63594cd8829bc9ad6037ff862d5a111101ed2" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "Inflector", "ethers-contract-abigen", @@ -1673,7 +1661,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -1685,7 +1673,7 @@ dependencies = [ "bytes", "cargo_metadata", "chrono", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "ethabi", "generic-array", "hex", @@ -1698,7 +1686,7 @@ dependencies = [ "serde", "serde_json", "strum 0.24.1", - "syn 2.0.32", + "syn 2.0.39", "tempfile", "thiserror", "tiny-keccak", @@ -1711,9 +1699,9 @@ version = "2.0.7" source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "ethers-core", - "ethers-solc 2.0.7 (git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7)", + "ethers-solc", "reqwest", - "semver 1.0.18", + "semver 1.0.20", "serde", "serde_json", "thiserror", @@ -1723,8 +1711,7 @@ dependencies = [ [[package]] name = "ethers-middleware" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740f4a773c19dd6d6a68c8c2e0996c096488d38997d524e21dc612c55da3bd24" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "async-trait", "auto_impl", @@ -1750,12 +1737,11 @@ dependencies = [ [[package]] name = "ethers-providers" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b498fd2a6c019d023e43e83488cd1fb0721f299055975aa6bac8dbf1e95f2c" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "async-trait", "auto_impl", - "base64 0.21.4", + "base64 0.21.5", "bytes", "enr", "ethers-core", @@ -1787,13 +1773,12 @@ dependencies = [ [[package]] name = "ethers-signers" version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c4b7e15f212fa7cc2e1251868320221d4ff77a3d48068e69f47ce1c491df2d" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "eth-keystore", "ethers-core", "hex", @@ -1803,37 +1788,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "ethers-solc" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81c89f121595cf8959e746045bb8b25a6a38d72588561e1a3b7992fc213f674" -dependencies = [ - "cfg-if 1.0.0", - "dunce", - "ethers-core", - "glob", - "hex", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver 1.0.18", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - [[package]] name = "ethers-solc" version = "2.0.7" @@ -1851,10 +1805,11 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.18", + "semver 1.0.20", "serde", "serde_json", "solang-parser", + "svm-rs", "thiserror", "tiny-keccak", "tokio", @@ -1886,9 +1841,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fastrlp" @@ -1903,9 +1858,9 @@ dependencies = [ [[package]] name = "fdeflate" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" dependencies = [ "simd-adler32", ] @@ -1916,7 +1871,6 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "bitvec", "rand_core", "subtle", ] @@ -1927,6 +1881,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ + "bitvec", "rand_core", "subtle", ] @@ -1951,9 +1906,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -2059,9 +2014,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -2074,9 +2029,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -2084,15 +2039,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -2101,9 +2056,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-locks" @@ -2117,26 +2072,26 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-timer" @@ -2150,9 +2105,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -2209,9 +2164,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2332,9 +2287,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "halo2-base" version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.5#70588177930400361c731659b15b2ab3f29f7784" +source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#b7c53bb7456063936f4ca6df8fa8e751d9c17d85" dependencies = [ - "ff 0.12.1", + "ff 0.13.0", "halo2_proofs", "itertools 0.10.5", "num-bigint", @@ -2347,10 +2302,10 @@ dependencies = [ [[package]] name = "halo2-ecc" version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.5#70588177930400361c731659b15b2ab3f29f7784" +source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#b7c53bb7456063936f4ca6df8fa8e751d9c17d85" dependencies = [ - "ff 0.12.1", - "group 0.12.1", + "ff 0.13.0", + "group 0.13.0", "halo2-base", "itertools 0.10.5", "num-bigint", @@ -2366,7 +2321,7 @@ dependencies = [ [[package]] name = "halo2-gate-generator" version = "0.1.0" -source = "git+https://github.com/scroll-tech/halo2gategen.git#35b137de2f71c37dfbd236842b868013c46739d1" +source = "git+https://github.com/scroll-tech/halo2gategen#8ccf462e1eff4ed0e602d7ba19771b2c53dee0e3" dependencies = [ "halo2_proofs", "lazy_static", @@ -2382,8 +2337,9 @@ dependencies = [ [[package]] name = "halo2-mpt-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.7.0#578c210ceb88d3c143ee2a013ad836d19285d9c1" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?branch=v0.7#32ab964ff065ee6a0ccc63590b9db73238c70b81" dependencies = [ + "env_logger", "ethers-core", "halo2_proofs", "hex", @@ -2394,6 +2350,7 @@ dependencies = [ "num-traits", "poseidon-circuit", "rand", + "rand_chacha", "serde", "serde_json", "strum 0.24.1", @@ -2404,14 +2361,14 @@ dependencies = [ [[package]] name = "halo2_gadgets" version = "0.2.0" -source = "git+https://github.com/scroll-tech/halo2.git?branch=develop#5b9a3d71a325a9ecbad164aba90a7f6a8550a015" +source = "git+https://github.com/scroll-tech/halo2.git?branch=v1.0#04d8dc09bd4df542feccac85e34dff4b38a467d3" dependencies = [ "arrayvec", "bitvec", - "ff 0.12.1", - "group 0.12.1", + "ff 0.13.0", + "group 0.13.0", "halo2_proofs", - "halo2curves", + "halo2curves 0.3.2", "lazy_static", "rand", "subtle", @@ -2421,15 +2378,15 @@ dependencies = [ [[package]] name = "halo2_proofs" version = "0.2.0" -source = "git+https://github.com/scroll-tech/halo2.git?branch=develop#5b9a3d71a325a9ecbad164aba90a7f6a8550a015" +source = "git+https://github.com/scroll-tech/halo2.git?branch=v1.0#04d8dc09bd4df542feccac85e34dff4b38a467d3" dependencies = [ "ark-std 0.3.0", "blake2b_simd", "cfg-if 0.1.10", "crossbeam", - "ff 0.12.1", - "group 0.12.1", - "halo2curves", + "ff 0.13.0", + "group 0.13.0", + "halo2curves 0.1.0", "log", "num-bigint", "num-integer", @@ -2445,11 +2402,13 @@ dependencies = [ [[package]] name = "halo2curves" -version = "0.3.1" -source = "git+https://github.com/scroll-tech/halo2curves.git?branch=0.3.1-derive-serde#969f1e44d9713ee4cd552563bd0c762c5d53b56e" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b1142bd1059aacde1b477e0c80c142910f1ceae67fc619311d6a17428007ab" dependencies = [ - "ff 0.12.1", - "group 0.12.1", + "blake2b_simd", + "ff 0.13.0", + "group 0.13.0", "lazy_static", "num-bigint", "num-traits", @@ -2458,15 +2417,34 @@ dependencies = [ "rand", "rand_core", "serde", + "serde_arrays", + "static_assertions", + "subtle", +] + +[[package]] +name = "halo2curves" +version = "0.3.2" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.2#9f5c50810bbefe779ee5cf1d852b2fe85dc35d5e" +dependencies = [ + "ff 0.13.0", + "group 0.13.0", + "lazy_static", + "num-bigint", + "num-traits", + "pasta_curves", + "paste", + "rand", + "rand_core", "static_assertions", "subtle", ] [[package]] name = "handlebars" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -2493,9 +2471,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "hashers" @@ -2523,9 +2501,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2559,9 +2537,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -2614,7 +2592,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2623,9 +2601,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -2637,16 +2615,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -2745,12 +2723,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] @@ -2799,9 +2777,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -2809,7 +2787,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "rustix", "windows-sys", ] @@ -2838,15 +2816,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -2855,9 +2824,9 @@ checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -2883,7 +2852,7 @@ checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", "ecdsa 0.16.8", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "once_cell", "sha2", "signature 2.1.0", @@ -2949,20 +2918,20 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if 1.0.0", "windows-sys", @@ -2970,9 +2939,20 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall", +] [[package]] name = "linked-hash-map" @@ -2982,15 +2962,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -3030,18 +3010,19 @@ dependencies = [ [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if 1.0.0", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -3070,9 +3051,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", @@ -3082,17 +3063,16 @@ dependencies = [ [[package]] name = "misc-precompiled-circuit" version = "0.1.0" -source = "git+https://github.com/scroll-tech/misc-precompiled-circuit.git?tag=v0.1.0#f647341f9951f5c2399035728d4f6765564e2e02" +source = "git+https://github.com/scroll-tech/misc-precompiled-circuit.git?branch=main#f46cf8fd0072e5531315739b20b5248f4bd2caac" dependencies = [ "halo2-gate-generator", "halo2_proofs", - "lazy_static", "num-bigint", "rand", "serde", "serde_json", - "strum 0.24.1", - "strum_macros 0.24.3", + "strum 0.25.0", + "strum_macros 0.25.3", "subtle", ] @@ -3205,9 +3185,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -3219,7 +3199,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] @@ -3262,7 +3242,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -3319,9 +3299,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.5.1" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "parity-scale-codec" @@ -3361,13 +3341,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", "windows-targets", ] @@ -3385,13 +3365,13 @@ dependencies = [ [[package]] name = "pasta_curves" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" dependencies = [ "blake2b_simd", - "ff 0.12.1", - "group 0.12.1", + "ff 0.13.0", + "group 0.13.0", "lazy_static", "rand", "static_assertions", @@ -3422,11 +3402,11 @@ dependencies = [ [[package]] name = "pathfinder_simd" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff" +checksum = "0444332826c70dc47be74a7c6a5fc44e23a7905ad6858d4162b658320455ef93" dependencies = [ - "rustc_version 0.3.3", + "rustc_version 0.4.0", ] [[package]] @@ -3459,9 +3439,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" dependencies = [ "memchr", "thiserror", @@ -3470,9 +3450,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" dependencies = [ "pest", "pest_generator", @@ -3480,22 +3460,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" dependencies = [ "once_cell", "pest", @@ -3509,7 +3489,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.1.0", ] [[package]] @@ -3552,7 +3532,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -3590,7 +3570,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -3683,19 +3663,19 @@ dependencies = [ [[package]] name = "poseidon" version = "0.2.0" -source = "git+https://github.com/scroll-tech/poseidon.git?branch=scroll-dev-0220#2fb4a2385bada39b50dce12fe50cb80d2fd33476" +source = "git+https://github.com/scroll-tech/poseidon.git?branch=main#5787dd3d2ce7a9e9601a035c396ac0c03449b54d" dependencies = [ - "group 0.12.1", - "halo2curves", + "halo2curves 0.1.0", "subtle", ] [[package]] name = "poseidon-circuit" version = "0.1.0" -source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0901#69524f42bdc55c581088c2fe64c2ab9a2921146b" +source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-1201#c6f058bcf3bb0c7933d1979563c414f5cc480f25" dependencies = [ "bitvec", + "ff 0.13.0", "halo2_proofs", "lazy_static", "log", @@ -3704,6 +3684,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3733,7 +3719,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -3752,9 +3738,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -3806,27 +3792,26 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ - "bitflags 1.3.2", - "byteorder", + "bitflags 2.4.1", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.6.29", + "regex-syntax 0.8.2", "unarray", ] @@ -3929,9 +3914,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -3939,66 +3924,55 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -4009,17 +3983,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.4", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -4041,6 +4015,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-rustls", "tower-service", @@ -4151,12 +4126,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -4190,9 +4179,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95294d6e3a6192f3aabf91c38f56505a625aa495533442744185a36d75a790c4" +checksum = "724fd11728a3804e9944b14cab63825024c40bf42f8af87c8b5d97c4bbacf426" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -4200,6 +4189,7 @@ dependencies = [ "bytes", "fastrlp", "num-bigint", + "num-traits", "parity-scale-codec", "primitive-types", "proptest", @@ -4250,16 +4240,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.20", ] [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -4268,43 +4258,43 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", - "ring", - "rustls-webpki 0.101.5", + "ring 0.17.5", + "rustls-webpki 0.101.7", "sct", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.4", + "base64 0.21.5", ] [[package]] name = "rustls-webpki" -version = "0.100.2" +version = "0.100.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -4339,9 +4329,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "cfg-if 1.0.0", "derive_more", @@ -4351,9 +4341,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4381,12 +4371,12 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -4463,9 +4453,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] @@ -4493,13 +4483,22 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] +[[package]] +name = "serde_arrays" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38636132857f68ec3d5f3eb121166d2af33cb55174c4d5ff645db6165cbef0fd" +dependencies = [ + "serde", +] + [[package]] name = "serde_cbor" version = "0.11.2" @@ -4512,20 +4511,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -4534,9 +4533,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -4587,9 +4586,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4598,9 +4597,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4672,9 +4671,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smol_str" @@ -4688,7 +4687,7 @@ dependencies = [ [[package]] name = "snark-verifier" version = "0.1.0" -source = "git+https://github.com/scroll-tech/snark-verifier?tag=v0.1.5#bc1d39ae31f3fe520c51dd150f0fefaf9653c465" +source = "git+https://github.com/scroll-tech/snark-verifier?branch=develop#12c1121a855564936a267b37bc9c27306de3eb3b" dependencies = [ "bytes", "ethereum-types", @@ -4712,11 +4711,11 @@ dependencies = [ [[package]] name = "snark-verifier-sdk" version = "0.0.1" -source = "git+https://github.com/scroll-tech/snark-verifier?tag=v0.1.5#bc1d39ae31f3fe520c51dd150f0fefaf9653c465" +source = "git+https://github.com/scroll-tech/snark-verifier?branch=develop#12c1121a855564936a267b37bc9c27306de3eb3b" dependencies = [ "bincode", - "env_logger", "ethereum-types", + "ff 0.13.0", "halo2-base", "hex", "itertools 0.10.5", @@ -4734,9 +4733,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -4744,9 +4743,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -4772,6 +4771,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.7.2" @@ -4864,7 +4869,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -4897,7 +4902,7 @@ dependencies = [ "home", "once_cell", "reqwest", - "semver 1.0.18", + "semver 1.0.20", "serde", "serde_json", "sha2", @@ -4919,15 +4924,36 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tabbycat" version = "0.1.2" @@ -4947,13 +4973,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", "windows-sys", ] @@ -4971,9 +4997,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -5034,51 +5060,51 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] name = "thread-id" -version = "4.2.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79474f573561cdc4871a0de34a51c92f7f5a56039113fbb5b9c9f96bdb756669" +checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b" dependencies = [ "libc", - "redox_syscall 0.2.16", "winapi", ] [[package]] name = "time" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", + "powerfmt", "serde", "time-core", ] [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "tiny-keccak" @@ -5116,9 +5142,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -5126,20 +5152,20 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -5169,9 +5195,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -5204,9 +5230,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -5217,7 +5243,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -5232,11 +5258,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -5244,20 +5269,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -5307,9 +5332,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -5343,9 +5368,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -5358,9 +5383,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -5374,6 +5399,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.4.1" @@ -5446,9 +5477,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -5456,24 +5487,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -5483,9 +5514,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5493,28 +5524,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -5522,12 +5553,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -5536,7 +5567,7 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" dependencies = [ - "rustls-webpki 0.100.2", + "rustls-webpki 0.100.3", ] [[package]] @@ -5569,9 +5600,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -5583,10 +5614,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets", ] @@ -5659,9 +5690,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -5740,6 +5771,26 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "zerocopy" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -5757,7 +5808,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -5794,6 +5845,7 @@ dependencies = [ "eth-types", "ethers-core", "ethers-signers", + "ff 0.13.0", "gadgets", "halo2-base", "halo2-ecc", @@ -5830,7 +5882,7 @@ dependencies = [ [[package]] name = "zktrie" version = "0.2.0" -source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.7#e5071cbd7097c7b65916654d581a510fff9d285c" +source = "git+https://github.com/scroll-tech/zktrie.git?tag=v0.7.1#a12f2f262ad3e82301e39ecdf9bfe235befc7074" dependencies = [ "gobuild", ] @@ -5856,11 +5908,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 5ef076c845..65558c8d08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,12 +27,15 @@ anyhow = "1.0" ark-std = "0.3" ctor = "0.1" env_logger = "0.10" -ethers = { version = "2.0.7", features = ["ethers-solc"] } +ethers = { version = "=2.0.7", features = ["ethers-solc"] } ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7", features = ["scroll"] } -ethers-providers = "2.0.7" -ethers-signers = "2.0.7" -halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop" } -hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0901"} +ethers-providers = "=2.0.7" +ethers-signers = "=2.0.7" +ff = "0.13" +halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.0" } +hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-1201" } +halo2-base = { git = "https://github.com/scroll-tech/halo2-lib", branch = "develop", default-features=false, features=["halo2-pse","display"] } +halo2-ecc = { git = "https://github.com/scroll-tech/halo2-lib", branch = "develop", default-features=false, features=["halo2-pse","display"] } hex = "0.4" itertools = "0.11" lazy_static = "1.4" @@ -51,8 +54,8 @@ regex = "1.5" serde = {version = "1.0", features = ["derive"] } serde_json = "1.0" sha3 = "0.10" -snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.5" } -snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.5", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } +snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop" } +snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features = false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } strum = "0.25" strum_macros = "0.25" subtle = "2.4" @@ -61,14 +64,16 @@ url = "2.2" [patch.crates-io] ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } +ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } +ethers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } ethers-etherscan = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } +ethers-signers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } gobuild = { git = "https://github.com/scroll-tech/gobuild.git" } [patch."https://github.com/privacy-scaling-explorations/halo2.git"] -halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop" } +halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.0" } [patch."https://github.com/privacy-scaling-explorations/poseidon.git"] -poseidon = { git = "https://github.com/scroll-tech/poseidon.git", branch = "scroll-dev-0220" } -[patch."https://github.com/privacy-scaling-explorations/halo2curves.git"] -halo2curves = { git = "https://github.com/scroll-tech/halo2curves.git", branch = "0.3.1-derive-serde" } +poseidon = { git = "https://github.com/scroll-tech/poseidon.git", branch = "main" } + # Definition of benchmarks profile to use. [profile.bench] diff --git a/aggregator/src/tests/rlc/gates.rs b/aggregator/src/tests/rlc/gates.rs index c3533b9aaa..32d7da61b1 100644 --- a/aggregator/src/tests/rlc/gates.rs +++ b/aggregator/src/tests/rlc/gates.rs @@ -44,6 +44,7 @@ impl Circuit for ArithTestCircuit { let mut rng = test_rng(); let mut first_pass = true; + layouter.assign_region( || "test field circuit", |mut region| -> Result<(), Error> { diff --git a/bus-mapping/src/circuit_input_builder.rs b/bus-mapping/src/circuit_input_builder.rs index 8c45839a7b..c370c3cbf7 100644 --- a/bus-mapping/src/circuit_input_builder.rs +++ b/bus-mapping/src/circuit_input_builder.rs @@ -678,7 +678,7 @@ impl<'a> CircuitInputBuilder { ) } else { let stack_input_num = 1024 - geth_step.op.valid_stack_ptr_range().1 as usize; - (0..stack_input_num).into_iter().map(|i| + (0..stack_input_num).map(|i| format!("{:?}", geth_step.stack.nth_last(i)) ).collect_vec().join(" ") } diff --git a/bus-mapping/src/circuit_input_builder/execution.rs b/bus-mapping/src/circuit_input_builder/execution.rs index 4f2c5ed649..12c377f0ed 100644 --- a/bus-mapping/src/circuit_input_builder/execution.rs +++ b/bus-mapping/src/circuit_input_builder/execution.rs @@ -15,12 +15,12 @@ use crate::{ use eth_types::{ evm_types::{memory::MemoryWordRange, Gas, GasCost, MemoryAddress, OpcodeId, ProgramCounter}, sign_types::SignData, - GethExecStep, ToLittleEndian, Word, H256, U256, + Field, GethExecStep, ToLittleEndian, Word, H256, U256, }; use ethers_core::k256::elliptic_curve::subtle::CtOption; use gadgets::impl_expr; use halo2_proofs::{ - arithmetic::{CurveAffine, Field}, + arithmetic::{CurveAffine, Field as Halo2Field}, halo2curves::{ bn256::{Fq, Fq2, Fr, G1Affine, G2Affine}, group::prime::PrimeCurveAffine, diff --git a/bus-mapping/src/circuit_input_builder/input_state_ref.rs b/bus-mapping/src/circuit_input_builder/input_state_ref.rs index ab8479a68a..a5615573da 100644 --- a/bus-mapping/src/circuit_input_builder/input_state_ref.rs +++ b/bus-mapping/src/circuit_input_builder/input_state_ref.rs @@ -1346,7 +1346,7 @@ impl<'a> CircuitInputStateRef<'a> { ) -> Result<(), Error> { let call = self.call()?.clone(); let geth_step = steps - .get(0) + .first() .ok_or(Error::InternalError("invalid index 0"))?; let is_err = exec_step.error.is_some(); let is_return_revert_succ = (geth_step.op == OpcodeId::REVERT @@ -1516,7 +1516,7 @@ impl<'a> CircuitInputStateRef<'a> { let call = self.call()?; - if matches!(next_step, None) { + if next_step.is_none() { // enumerating call scope successful cases // case 1: call with normal halt opcode termination if matches!( diff --git a/bus-mapping/src/precompile.rs b/bus-mapping/src/precompile.rs index aae4af3477..5818095e3d 100644 --- a/bus-mapping/src/precompile.rs +++ b/bus-mapping/src/precompile.rs @@ -18,8 +18,9 @@ pub(crate) fn execute_precompiled( input: &[u8], gas: u64, ) -> (Vec, u64, bool) { - let Some(Precompile::Standard(precompile_fn)) = Precompiles::berlin() - .get(address.as_fixed_bytes()) else { + let Some(Precompile::Standard(precompile_fn)) = + Precompiles::berlin().get(address.as_fixed_bytes()) + else { panic!("calling non-exist precompiled contract address") }; log::trace!( diff --git a/eth-types/Cargo.toml b/eth-types/Cargo.toml index c8ad12b1f8..57d8adf980 100644 --- a/eth-types/Cargo.toml +++ b/eth-types/Cargo.toml @@ -11,6 +11,7 @@ hex.workspace = true lazy_static.workspace = true once_cell.workspace = true halo2_proofs.workspace = true +halo2-base.workspace = true regex.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/eth-types/src/evm_types.rs b/eth-types/src/evm_types.rs index ce174448f7..197d4251a8 100644 --- a/eth-types/src/evm_types.rs +++ b/eth-types/src/evm_types.rs @@ -1,7 +1,7 @@ //! Evm types needed for parsing instruction sets as well use serde::{Deserialize, Serialize}; -use std::fmt; +use std::{fmt, marker::ConstParamTy}; pub mod block_utils; pub mod gas_utils; @@ -78,8 +78,7 @@ mod gas_create { // [gasCreate2Eip3860](https://github.com/ethereum/go-ethereum/blob/eb83e7c54021573eaceb14236af3a7a8c64f6027/core/vm/gas_table.go#L321) // (similar for CREATE). // 1. size <= 49152 (MaxInitCodeSize) - // 2. gasCost = memoryGasCost + (2 + 6) * ((size + 31) / 32) should not - // overflow for Uint64. + // 2. gasCost = memoryGasCost + (2 + 6) * ((size + 31) / 32) should not overflow for Uint64. // No need to constrain the second condition, since the maximum gas cost // cannot overflow for Uint64 (36028809887100925 calculated by // `memorySize = 0x1FFFFFFFE0` and `size = 49152`) if the first condition is @@ -106,7 +105,7 @@ mod gas_create { pub use gas_create::*; /// Defines the gas consumption. -#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] +#[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize, ConstParamTy)] pub struct GasCost(pub u64); impl fmt::Debug for GasCost { diff --git a/eth-types/src/lib.rs b/eth-types/src/lib.rs index 1e8cd1b9a5..f45c259c8d 100644 --- a/eth-types/src/lib.rs +++ b/eth-types/src/lib.rs @@ -3,6 +3,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] // Temporary until we have more of the crate implemented. #![allow(dead_code)] +#![allow(incomplete_features)] // We want to have UPPERCASE idents sometimes. #![allow(non_snake_case)] // Catch documentation errors caused by code changes. @@ -11,6 +12,7 @@ //#![deny(unsafe_code)] Allowed now until we find a // better way to handle downcasting from Operation into it's variants. #![allow(clippy::upper_case_acronyms)] // Too pedantic +#![feature(adt_const_params)] #[macro_use] pub mod macros; @@ -25,10 +27,8 @@ pub mod sign_types; pub use bytecode::Bytecode; pub use error::Error; -use halo2_proofs::{ - arithmetic::{Field as Halo2Field, FieldExt}, - halo2curves::{bn256::Fr, group::ff::PrimeField}, -}; +use halo2_base::utils::ScalarField; +use halo2_proofs::halo2curves::{bn256::Fr, group::ff::PrimeField}; use crate::evm_types::{Gas, GasCost, OpcodeId, ProgramCounter}; use ethers_core::types; @@ -55,22 +55,32 @@ use crate::evm_types::Stack; #[cfg(feature = "enable-storage")] use crate::evm_types::Storage; -/// Trait used to reduce verbosity with the declaration of the [`FieldExt`] +/// Trait used to reduce verbosity with the declaration of the [`Field`] /// trait and its repr. pub trait Field: - FieldExt - + Halo2Field - + PrimeField - + hash_circuit::hash::Hashable - + std::convert::From + PrimeField + hash_circuit::hash::Hashable + std::convert::From + ScalarField { + /// Re-expose zero element as a function + fn zero() -> Self { + Self::ZERO + } + + /// Re-expose one element as a function + fn one() -> Self { + Self::ONE + } + + /// Expose the lower 128 bits + fn get_lower_128(&self) -> u128 { + u128::from_le_bytes(self.to_repr().as_ref()[..16].try_into().unwrap()) + } } // Impl custom `Field` trait for BN256 Fr to be used and consistent with the // rest of the workspace. impl Field for Fr {} -// Impl custom `Field` trait for BN256 Frq to be used and consistent with the +// Impl custom `Field` trait for BN256 Fq to be used and consistent with the // rest of the workspace. // impl Field for Fq {} diff --git a/eth-types/src/sign_types.rs b/eth-types/src/sign_types.rs index 9c9f3aba74..e19fd3abf8 100644 --- a/eth-types/src/sign_types.rs +++ b/eth-types/src/sign_types.rs @@ -15,8 +15,9 @@ use ethers_core::{ utils::keccak256, }; use halo2_proofs::{ - arithmetic::{CurveAffine, FieldExt}, + arithmetic::CurveAffine, halo2curves::{ + ff::FromUniformBytes, group::{ ff::{Field as GroupField, PrimeField}, prime::PrimeCurveAffine, @@ -45,7 +46,7 @@ pub fn sign(randomness: Fq, sk: Fq, msg_hash: Fq) -> (Fq, Fq, u8) { let mut x_bytes = [0u8; 64]; x_bytes[..32].copy_from_slice(&x.to_bytes()); - let sig_r = Fq::from_bytes_wide(&x_bytes); // get x cordinate (E::Base) on E::Scalar + let sig_r = Fq::from_uniform_bytes(&x_bytes); // get x cordinate (E::Base) on E::Scalar let sig_s = randomness_inv * (msg_hash + sig_r * sk); (sig_r, sig_s, u8::from(sig_v)) diff --git a/gadgets/src/batched_is_zero.rs b/gadgets/src/batched_is_zero.rs index 02869d68ee..f3a0dd58c7 100644 --- a/gadgets/src/batched_is_zero.rs +++ b/gadgets/src/batched_is_zero.rs @@ -7,7 +7,6 @@ use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Region, Value}, plonk::{Advice, Column, ConstraintSystem, Error, Expression, Phase, VirtualCells}, poly::Rotation, @@ -48,7 +47,7 @@ pub struct BatchedIsZeroChip { _marker: PhantomData, } -impl BatchedIsZeroChip { +impl BatchedIsZeroChip { /// Configure the BatchedIsZeroChip pub fn configure( meta: &mut ConstraintSystem, @@ -100,9 +99,9 @@ impl BatchedIsZeroChip { .iter() .find_map(|value| Option::::from(value.invert())) { - (F::zero(), inverse) + (F::ZERO, inverse) } else { - (F::one(), F::zero()) + (F::ONE, F::ZERO) } }); @@ -134,7 +133,6 @@ impl BatchedIsZeroChip { mod test { use super::*; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Layouter, SimpleFloorPlanner, Value}, dev::MockProver, halo2curves::bn256::Fr, @@ -151,15 +149,17 @@ mod test { } #[derive(Default)] - struct TestCircuit { + struct TestCircuit { values: Option<[u64; N]>, expect_is_zero: Option, _marker: PhantomData, } - impl Circuit for TestCircuit { + impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() @@ -218,7 +218,7 @@ mod test { || "expect_is_zero", config.expect_is_zero, 0, - || Value::known(F::from(*expect_is_zero)), + || Value::known(F::from(*expect_is_zero as u64)), )?; for (value_column, value) in config.values.iter().zip(values.iter()) { region.assign_advice( diff --git a/gadgets/src/binary_number.rs b/gadgets/src/binary_number.rs index cd3e0578c1..62fbec2043 100644 --- a/gadgets/src/binary_number.rs +++ b/gadgets/src/binary_number.rs @@ -61,10 +61,9 @@ where /// Return the constant that represents a given value. To be compared with the value expression. pub fn constant_expr(&self, value: T) -> Expression { - let f = value - .as_bits() - .iter() - .fold(F::zero(), |result, bit| F::from(*bit) + result * F::from(2)); + let f = value.as_bits().iter().fold(F::ZERO, |result, bit| { + F::from(*bit as u64) + result * F::from(2) + }); Expression::Constant(f) } @@ -199,7 +198,7 @@ where || format!("binary number {column:?}"), column, offset, - || Value::known(F::from(bit)), + || Value::known(F::from(bit as u64)), )?; } Ok(()) diff --git a/gadgets/src/comparator.rs b/gadgets/src/comparator.rs index f337e165c5..ce9f395604 100644 --- a/gadgets/src/comparator.rs +++ b/gadgets/src/comparator.rs @@ -3,7 +3,6 @@ use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Chip, Region, Value}, plonk::{ConstraintSystem, Error, Expression, TableColumn, VirtualCells}, poly::Rotation, @@ -15,7 +14,7 @@ use crate::{ }; /// Instruction that the Comparator chip needs to implement. -pub trait ComparatorInstruction { +pub trait ComparatorInstruction { /// Assign the lhs and rhs witnesses to the Comparator chip's region. fn assign( &self, diff --git a/gadgets/src/evm_word.rs b/gadgets/src/evm_word.rs index 0447647c18..d88c15e10c 100644 --- a/gadgets/src/evm_word.rs +++ b/gadgets/src/evm_word.rs @@ -27,12 +27,12 @@ pub fn r() -> F { } let mut r = [0; 64]; r[..32].copy_from_slice(hasher.finalize().as_slice()); - F::from_bytes_wide(&r) + F::from_uniform_bytes(&r) } /// Returns encoding of big-endian representation of a 256-bit word. pub fn encode(vals: impl Iterator, r: F) -> F { - vals.fold(F::zero(), |acc, val| { + vals.fold(F::ZERO, |acc, val| { let byte = F::from(val as u64); acc * r + byte }) @@ -72,7 +72,7 @@ impl WordConfig { byte_lookup: Column, ) -> Self { // Expression representing `encode(word)`. - let mut encode_word_expr = Expression::Constant(F::zero()); + let mut encode_word_expr = Expression::Constant(F::ZERO); // Lookup each byte in the witnessed word representation to // range-constrain it to 8 bits. @@ -177,6 +177,8 @@ mod tests { // commitment which will be provided as public inputs. type Config = (WordConfig, Column); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/gadgets/src/is_equal.rs b/gadgets/src/is_equal.rs index 35b3ff5ff6..78a927104c 100644 --- a/gadgets/src/is_equal.rs +++ b/gadgets/src/is_equal.rs @@ -2,7 +2,6 @@ use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Chip, Region, Value}, plonk::{ConstraintSystem, Error, Expression, VirtualCells}, poly::Rotation, @@ -13,7 +12,7 @@ use crate::util::Expr; use super::is_zero::{IsZeroChip, IsZeroConfig, IsZeroInstruction}; /// Instruction that the IsEqual chip needs to implement. -pub trait IsEqualInstruction { +pub trait IsEqualInstruction { /// Assign lhs and rhs witnesses to the IsEqual chip's region. fn assign( &self, @@ -121,7 +120,6 @@ mod tests { use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Layouter, SimpleFloorPlanner, Value}, dev::MockProver, halo2curves::bn256::Fr as Fp, @@ -142,7 +140,7 @@ mod tests { } #[derive(Default)] - struct TestCircuit { + struct TestCircuit { values: Vec, checks: Vec, _marker: PhantomData, @@ -151,6 +149,8 @@ mod tests { impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/gadgets/src/is_zero.rs b/gadgets/src/is_zero.rs index c245081e49..b69bb23f13 100644 --- a/gadgets/src/is_zero.rs +++ b/gadgets/src/is_zero.rs @@ -222,6 +222,8 @@ mod test { impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() @@ -349,6 +351,8 @@ mod test { impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/gadgets/src/less_than.rs b/gadgets/src/less_than.rs index c2613a1fc6..ebde33a37b 100644 --- a/gadgets/src/less_than.rs +++ b/gadgets/src/less_than.rs @@ -2,7 +2,6 @@ use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Chip, Region, Value}, plonk::{Advice, Column, ConstraintSystem, Error, Expression, TableColumn, VirtualCells}, poly::Rotation, @@ -14,7 +13,7 @@ use crate::{ }; /// Instruction that the Lt chip needs to implement. -pub trait LtInstruction { +pub trait LtInstruction { /// Assign the lhs and rhs witnesses to the Lt chip's region. fn assign( &self, @@ -136,7 +135,7 @@ impl LtInstruction for LtChip { || Value::known(F::from(lt as u64)), )?; - let diff = (lhs - rhs) + (if lt { config.range } else { F::zero() }); + let diff = (lhs - rhs) + (if lt { config.range } else { F::ZERO }); let diff_bytes = diff.to_repr(); for (idx, diff_column) in config.diff.iter().enumerate() { region.assign_advice( @@ -192,7 +191,6 @@ mod test { use super::{LtChip, LtConfig, LtInstruction}; use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Layouter, SimpleFloorPlanner, Value}, dev::MockProver, halo2curves::bn256::Fr as Fp, @@ -246,7 +244,7 @@ mod test { } #[derive(Default)] - struct TestCircuit { + struct TestCircuit { values: Option>, // checks[i] = lt(values[i + 1], values[i]) checks: Option>, @@ -256,6 +254,8 @@ mod test { impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() @@ -368,7 +368,7 @@ mod test { } #[derive(Default)] - struct TestCircuit { + struct TestCircuit { values: Option>, // checks[i] = lt(values[i].0 - values[i].1) checks: Option>, @@ -378,6 +378,8 @@ mod test { impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/gadgets/src/monotone.rs b/gadgets/src/monotone.rs index 798beeb995..bd84cf0b3a 100644 --- a/gadgets/src/monotone.rs +++ b/gadgets/src/monotone.rs @@ -2,8 +2,8 @@ //! Monotone gadget helps to check if an advice column is monotonically //! increasing within a range. With strict enabled, it disallows equality of two //! cell. +use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Chip, Layouter, Value}, plonk::{Advice, Column, ConstraintSystem, Error, Expression, Fixed, VirtualCells}, poly::Rotation, @@ -25,7 +25,7 @@ pub(crate) struct MonotoneChip +impl MonotoneChip { /// configure which column should be check. q_enable here as a fn is @@ -90,7 +90,7 @@ impl } } -impl Chip +impl Chip for MonotoneChip { type Config = MonotoneConfig; @@ -108,8 +108,8 @@ impl Chip #[cfg(test)] mod test { use super::{MonotoneChip, MonotoneConfig, Value}; + use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Layouter, SimpleFloorPlanner}, dev::{ FailureLocation, MockProver, @@ -128,16 +128,18 @@ mod test { } #[derive(Default)] - struct TestCircuit { + struct TestCircuit { values: Option>, _marker: PhantomData, } - impl Circuit + impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/gadgets/src/mul_add.rs b/gadgets/src/mul_add.rs index 401969d9d6..e10fb58183 100644 --- a/gadgets/src/mul_add.rs +++ b/gadgets/src/mul_add.rs @@ -416,7 +416,7 @@ impl MulAddChip { || "unused padding row", col, offset + 7, - || Value::known(F::zero()), + || Value::known(F::ZERO), )?; } @@ -501,6 +501,8 @@ mod test { impl Circuit for TestCircuit { type Config = TestCircuitConfig; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn configure(meta: &mut halo2_proofs::plonk::ConstraintSystem) -> Self::Config { let q_enable = meta.complex_selector(); diff --git a/gadgets/src/range.rs b/gadgets/src/range.rs index 0e673e736c..81cdebaba4 100644 --- a/gadgets/src/range.rs +++ b/gadgets/src/range.rs @@ -9,14 +9,13 @@ use crate::util::Expr; use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Chip, Region, Value}, plonk::{Advice, Column, ConstraintSystem, Error, Expression, TableColumn, VirtualCells}, poly::Rotation, }; /// Instruction that the Range chip needs to implement. -pub trait UIntRangeCheckInstruction { +pub trait UIntRangeCheckInstruction { /// Assign the expr and u16 le repr witnesses to the Comparator chip's region. fn assign( &self, diff --git a/gadgets/src/util.rs b/gadgets/src/util.rs index e7e2b069ca..9799928c39 100644 --- a/gadgets/src/util.rs +++ b/gadgets/src/util.rs @@ -1,27 +1,28 @@ //! Utility traits, functions used in the crate. use eth_types::{ evm_types::{GasCost, OpcodeId}, - U256, + Field, U256, }; -use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; +use halo2_proofs::plonk::Expression; /// Returns the sum of the passed in cells pub mod sum { use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; /// Returns an expression for the sum of the list of expressions. - pub fn expr, I: IntoIterator>(inputs: I) -> Expression { + pub fn expr, I: IntoIterator>(inputs: I) -> Expression { inputs .into_iter() .fold(0.expr(), |acc, input| acc + input.expr()) } /// Returns the sum of the given list of values within the field. - pub fn value(values: &[u8]) -> F { + pub fn value(values: &[u8]) -> F { values .iter() - .fold(F::zero(), |acc, value| acc + F::from(*value as u64)) + .fold(F::ZERO, |acc, value| acc + F::from(*value as u64)) } } @@ -29,19 +30,20 @@ pub mod sum { /// otherwise. Inputs need to be boolean pub mod and { use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; /// Returns an expression that evaluates to 1 only if all the expressions in /// the given list are 1, else returns 0. - pub fn expr, I: IntoIterator>(inputs: I) -> Expression { + pub fn expr, I: IntoIterator>(inputs: I) -> Expression { inputs .into_iter() .fold(1.expr(), |acc, input| acc * input.expr()) } /// Returns the product of all given values. - pub fn value(inputs: Vec) -> F { - inputs.iter().fold(F::one(), |acc, input| acc * input) + pub fn value(inputs: Vec) -> F { + inputs.iter().fold(F::ONE, |acc, input| acc * input) } } @@ -50,16 +52,17 @@ pub mod and { pub mod or { use super::{and, not}; use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; /// Returns an expression that evaluates to 1 if any expression in the given /// list is 1. Returns 0 if all the expressions were 0. - pub fn expr, I: IntoIterator>(inputs: I) -> Expression { + pub fn expr, I: IntoIterator>(inputs: I) -> Expression { not::expr(and::expr(inputs.into_iter().map(not::expr))) } /// Returns the value after passing all given values through the OR gate. - pub fn value(inputs: Vec) -> F { + pub fn value(inputs: Vec) -> F { not::value(and::value(inputs.into_iter().map(not::value).collect())) } } @@ -68,16 +71,17 @@ pub mod or { /// `b` needs to be boolean pub mod not { use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; /// Returns an expression that represents the NOT of the given expression. - pub fn expr>(b: E) -> Expression { + pub fn expr>(b: E) -> Expression { 1.expr() - b.expr() } /// Returns a value that represents the NOT of the given value. - pub fn value(b: F) -> F { - F::one() - b + pub fn value(b: F) -> F { + F::ONE - b } } @@ -85,15 +89,16 @@ pub mod not { /// `a` and `b` needs to be boolean pub mod xor { use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; /// Returns an expression that represents the XOR of the given expression. - pub fn expr>(a: E, b: E) -> Expression { + pub fn expr>(a: E, b: E) -> Expression { a.expr() + b.expr() - 2.expr() * a.expr() * b.expr() } /// Returns a value that represents the XOR of the given value. - pub fn value(a: F, b: F) -> F { + pub fn value(a: F, b: F) -> F { a + b - F::from(2u64) * a * b } } @@ -102,11 +107,12 @@ pub mod xor { /// `selector == 0`. `selector` needs to be boolean. pub mod select { use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; /// Returns the `when_true` expression when the selector is true, else /// returns the `when_false` expression. - pub fn expr( + pub fn expr( selector: Expression, when_true: Expression, when_false: Expression, @@ -116,18 +122,18 @@ pub mod select { /// Returns the `when_true` value when the selector is true, else returns /// the `when_false` value. - pub fn value(selector: F, when_true: F, when_false: F) -> F { - selector * when_true + (F::one() - selector) * when_false + pub fn value(selector: F, when_true: F, when_false: F) -> F { + selector * when_true + (F::ONE - selector) * when_false } /// Returns the `when_true` word when selector is true, else returns the /// `when_false` word. - pub fn value_word( + pub fn value_word( selector: F, when_true: [u8; 32], when_false: [u8; 32], ) -> [u8; 32] { - if selector == F::one() { + if selector == F::ONE { when_true } else { when_false @@ -137,7 +143,7 @@ pub mod select { /// Trait that implements functionality to get a constant expression from /// commonly used types. -pub trait Expr { +pub trait Expr { /// Returns an expression for the type. fn expr(&self) -> Expression; } @@ -146,7 +152,7 @@ pub trait Expr { #[macro_export] macro_rules! impl_expr { ($type:ty) => { - impl $crate::util::Expr for $type { + impl $crate::util::Expr for $type { #[inline] fn expr(&self) -> Expression { Expression::Constant(F::from(*self as u64)) @@ -154,7 +160,7 @@ macro_rules! impl_expr { } }; ($type:ty, $method:path) => { - impl $crate::util::Expr for $type { + impl $crate::util::Expr for $type { #[inline] fn expr(&self) -> Expression { Expression::Constant(F::from($method(self) as u64)) @@ -170,39 +176,34 @@ impl_expr!(usize); impl_expr!(OpcodeId, OpcodeId::as_u8); impl_expr!(GasCost, GasCost::as_u64); -impl Expr for Expression { +impl Expr for Expression { #[inline] fn expr(&self) -> Expression { self.clone() } } -impl Expr for &Expression { +impl Expr for &Expression { #[inline] fn expr(&self) -> Expression { (*self).clone() } } -impl Expr for i32 { +impl Expr for i32 { #[inline] fn expr(&self) -> Expression { Expression::Constant( - F::from(self.unsigned_abs() as u64) - * if self.is_negative() { - -F::one() - } else { - F::one() - }, + F::from(self.unsigned_abs() as u64) * if self.is_negative() { -F::ONE } else { F::ONE }, ) } } /// Given a bytes-representation of an expression, it computes and returns the /// single expression. -pub fn expr_from_bytes>(bytes: &[E]) -> Expression { +pub fn expr_from_bytes>(bytes: &[E]) -> Expression { let mut value = 0.expr(); - let mut multiplier = F::one(); + let mut multiplier = F::ONE; for byte in bytes.iter() { value = value + byte.expr() * multiplier; multiplier *= F::from(256); @@ -212,9 +213,9 @@ pub fn expr_from_bytes>(bytes: &[E]) -> Expression { /// Given a u16-array-representation of an expression, it computes and returns /// the single expression. -pub fn expr_from_u16>(u16s: &[E]) -> Expression { +pub fn expr_from_u16>(u16s: &[E]) -> Expression { let mut value = 0.expr(); - let mut multiplier = F::one(); + let mut multiplier = F::ONE; for u16 in u16s.iter() { value = value + u16.expr() * multiplier; multiplier *= F::from(2u64.pow(16)); @@ -222,9 +223,9 @@ pub fn expr_from_u16>(u16s: &[E]) -> Expression { value } -/// Returns 2**by as FieldExt -pub fn pow_of_two(by: usize) -> F { - F::from(2).pow(&[by as u64, 0, 0, 0]) +/// Returns 2**by as Field +pub fn pow_of_two(by: usize) -> F { + F::from(2).pow([by as u64, 0, 0, 0]) } /// Returns tuple consists of low and high part of U256 diff --git a/keccak256/src/arith_helpers.rs b/keccak256/src/arith_helpers.rs index c95b7c58fe..c217e97535 100644 --- a/keccak256/src/arith_helpers.rs +++ b/keccak256/src/arith_helpers.rs @@ -147,7 +147,7 @@ pub fn convert_b13_lane_to_b9(x: Lane13, rot: u32) -> Lane9 { // with the special chunk in the middle let rotated: Vec = right .iter() - .chain(vec![special].iter()) + .chain([special].iter()) .chain(left.iter()) .map(|&x| convert_b13_coef(x)) .collect_vec(); @@ -199,7 +199,7 @@ pub fn inspect(x: BigUint, name: &str, base: u8) { pub fn f_from_radix_be(buf: &[u8], base: u8) -> F { let base = F::from(base as u64); buf.iter() - .fold(F::zero(), |acc, &x| acc * base + F::from(x as u64)) + .fold(F::ZERO, |acc, &x| acc * base + F::from(x as u64)) } #[cfg(test)] diff --git a/rust-toolchain b/rust-toolchain index 44b874bfca..ab1164851e 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-12-10 +nightly-2023-10-27 diff --git a/zkevm-circuits/Cargo.toml b/zkevm-circuits/Cargo.toml index 169481750f..f3face234b 100644 --- a/zkevm-circuits/Cargo.toml +++ b/zkevm-circuits/Cargo.toml @@ -14,9 +14,12 @@ array-init = "2.0.0" bus-mapping = { path = "../bus-mapping" } either = "1.9" eth-types = { path = "../eth-types" } +ff.workspace = true gadgets = { path = "../gadgets" } ethers-core.workspace = true ethers-signers = { workspace = true, optional = true } +halo2-base.workspace = true +halo2-ecc.workspace = true mock = { path = "../mock", optional = true } strum.workspace = true strum_macros.workspace = true @@ -32,11 +35,8 @@ serde.workspace = true serde_json.workspace = true hash-circuit.workspace = true -misc-precompiled-circuit = { package = "misc-precompiled-circuit", git = "https://github.com/scroll-tech/misc-precompiled-circuit.git", tag = "v0.1.0" } - -halo2-base = { git = "https://github.com/scroll-tech/halo2-lib", tag = "v0.1.5", default-features=false, features=["halo2-pse","display"] } -halo2-ecc = { git = "https://github.com/scroll-tech/halo2-lib", tag = "v0.1.5", default-features=false, features=["halo2-pse","display"] } -halo2_gadgets = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop", features = ["unstable"] } +misc-precompiled-circuit = { package = "misc-precompiled-circuit", git = "https://github.com/scroll-tech/misc-precompiled-circuit.git", branch = "main" } +halo2_gadgets = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.0", features = ["unstable"] } num-bigint.workspace = true subtle.workspace = true diff --git a/zkevm-circuits/src/bytecode_circuit/bytecode_unroller.rs b/zkevm-circuits/src/bytecode_circuit/bytecode_unroller.rs index 83a912104c..807595c4cd 100644 --- a/zkevm-circuits/src/bytecode_circuit/bytecode_unroller.rs +++ b/zkevm-circuits/src/bytecode_circuit/bytecode_unroller.rs @@ -81,7 +81,7 @@ pub fn unroll_to_hash_input = super::circuit::BytecodeCircuitConfig; impl Circuit for BytecodeCircuit { type Config = (CircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/copy_circuit/dev.rs b/zkevm-circuits/src/copy_circuit/dev.rs index 239d847ecb..4aa744640d 100644 --- a/zkevm-circuits/src/copy_circuit/dev.rs +++ b/zkevm-circuits/src/copy_circuit/dev.rs @@ -14,6 +14,8 @@ use halo2_proofs::{ impl Circuit for CopyCircuit { type Config = (CopyCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/copy_circuit/test.rs b/zkevm-circuits/src/copy_circuit/test.rs index 591cb6fe9f..bbf23b7acd 100644 --- a/zkevm-circuits/src/copy_circuit/test.rs +++ b/zkevm-circuits/src/copy_circuit/test.rs @@ -528,6 +528,9 @@ fn assert_error_matches(result: Result<(), Vec>, names: Vec<&str> VerifyFailure::CellNotAssigned { .. } => panic!(), VerifyFailure::ConstraintPoisoned { .. } => panic!(), VerifyFailure::Permutation { .. } => panic!(), + // &VerifyFailure::InstanceCellNotAssigned { .. } | &VerifyFailure::Shuffle { .. } => { + // todo!() + // } } } } diff --git a/zkevm-circuits/src/ecc_circuit.rs b/zkevm-circuits/src/ecc_circuit.rs index 998820b83b..16be9af4f9 100644 --- a/zkevm-circuits/src/ecc_circuit.rs +++ b/zkevm-circuits/src/ecc_circuit.rs @@ -25,7 +25,6 @@ use halo2_ecc::{ }, }; use halo2_proofs::{ - arithmetic::Field as Halo2Field, circuit::{Layouter, Value}, halo2curves::{ bn256::{Fq, Fq12, Fq2, Fr, G1Affine, G2Affine}, diff --git a/zkevm-circuits/src/evm_circuit.rs b/zkevm-circuits/src/evm_circuit.rs index 77766a6bbd..6c2c65f5a2 100644 --- a/zkevm-circuits/src/evm_circuit.rs +++ b/zkevm-circuits/src/evm_circuit.rs @@ -447,6 +447,8 @@ use crate::util::MockChallenges as Challenges; impl Circuit for EvmCircuit { type Config = (EvmCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/evm_circuit/execution.rs b/zkevm-circuits/src/evm_circuit/execution.rs index 4e5dca867e..cd19100c81 100644 --- a/zkevm-circuits/src/evm_circuit/execution.rs +++ b/zkevm-circuits/src/evm_circuit/execution.rs @@ -28,7 +28,6 @@ use bus_mapping::util::read_env_var; use eth_types::{Field, ToLittleEndian}; use gadgets::util::not; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Layouter, Region, Value}, plonk::{ Advice, Assigned, Column, ConstraintSystem, Error, Expression, FirstPhase, Fixed, Selector, @@ -227,7 +226,7 @@ use sstore::SstoreGadget; use stop::StopGadget; use swap::SwapGadget; -pub(crate) trait ExecutionGadget { +pub(crate) trait ExecutionGadget { const NAME: &'static str; const EXECUTION_STATE: ExecutionState; @@ -1063,9 +1062,8 @@ impl ExecutionConfig { // There should be 3 group of regions // 1. real steps - // 2. padding EndBlocks. - // For the ease of implementation, even for `no_padding` case, - // we will still pad 1 end_block_not_last. + // 2. padding EndBlocks. For the ease of implementation, even for `no_padding` case, we will + // still pad 1 end_block_not_last. // 3. final EndBlock let region1_height = self.get_num_rows_required_no_padding(block); let region3_height = 2; // EndBlock, plus a dummy "next" row used for Rotation diff --git a/zkevm-circuits/src/evm_circuit/execution/mulmod.rs b/zkevm-circuits/src/evm_circuit/execution/mulmod.rs index 76b6f3f474..456172d592 100644 --- a/zkevm-circuits/src/evm_circuit/execution/mulmod.rs +++ b/zkevm-circuits/src/evm_circuit/execution/mulmod.rs @@ -58,13 +58,13 @@ impl ExecutionGadget for MulModGadget { let d = cb.query_word_rlc(); let e = cb.query_word_rlc(); - // 1. k1 * n + a_reduced == a + // 1. k1 * n + a_reduced == a let modword = ModGadget::construct(cb, [&a, &n, &a_reduced]); - // 2. a_reduced * b + 0 == d * 2^256 + e + // 2. a_reduced * b + 0 == d * 2^256 + e let mul512_left = MulAddWords512Gadget::construct(cb, [&a_reduced, &b, &d, &e], None); - // 3. k2 * n + r == d * 2^256 + e + // 3. k2 * n + r == d * 2^256 + e let mul512_right = MulAddWords512Gadget::construct(cb, [&k, &n, &d, &e], Some(&r)); // (r < n ) or n == 0 diff --git a/zkevm-circuits/src/evm_circuit/execution/precompiles/mod.rs b/zkevm-circuits/src/evm_circuit/execution/precompiles/mod.rs index 8cbf0c34ff..90b1e6c471 100644 --- a/zkevm-circuits/src/evm_circuit/execution/precompiles/mod.rs +++ b/zkevm-circuits/src/evm_circuit/execution/precompiles/mod.rs @@ -1,4 +1,6 @@ use bus_mapping::precompile::PrecompileAuxData; +use std::marker::ConstParamTy; + use eth_types::{Field, ToScalar}; use gadgets::util::{select, Expr}; use halo2_proofs::{circuit::Value, plonk::Error}; diff --git a/zkevm-circuits/src/evm_circuit/execution/precompiles/modexp.rs b/zkevm-circuits/src/evm_circuit/execution/precompiles/modexp.rs index d475735957..9eb2eb2519 100755 --- a/zkevm-circuits/src/evm_circuit/execution/precompiles/modexp.rs +++ b/zkevm-circuits/src/evm_circuit/execution/precompiles/modexp.rs @@ -422,7 +422,7 @@ impl ModExpInputs { input_limbs.assign(region, offset, val_r)?; } - for (val, input_bytes) in values.zip([&self.base, &self.exp, &self.modulus]) { + for (&val, input_bytes) in values.iter().zip([&self.base, &self.exp, &self.modulus]) { assign_word(region, offset, input_bytes, val)?; } @@ -1040,6 +1040,7 @@ mod test { precompile::PrecompileCalls, }; use eth_types::{bytecode, word, ToWord}; + use ethers_core::k256::elliptic_curve::PrimeField; use itertools::Itertools; use mock::TestContext; @@ -1048,7 +1049,7 @@ mod test { #[test] fn test_limbs() { use crate::table::ModExpTable; - use halo2_proofs::{arithmetic::FieldExt, halo2curves::bn256::Fr}; + use halo2_proofs::halo2curves::bn256::Fr; use misc_precompiled_circuit::circuits::modexp::Number; use num_bigint::BigUint; diff --git a/zkevm-circuits/src/evm_circuit/execution/sar.rs b/zkevm-circuits/src/evm_circuit/execution/sar.rs index 97e1e2c259..7b56d8a736 100644 --- a/zkevm-circuits/src/evm_circuit/execution/sar.rs +++ b/zkevm-circuits/src/evm_circuit/execution/sar.rs @@ -275,7 +275,7 @@ impl ExecutionGadget for SarGadget { self.b.assign(region, offset, Some(b.to_le_bytes()))?; let is_neg = 127 < a.to_le_bytes()[31]; - let shf0 = u128::from(shift.to_le_bytes()[0]); + let shf0 = u64::from(shift.to_le_bytes()[0]); let shf_div64 = shf0 / 64; let shf_mod64 = shf0 % 64; let p_lo = 1 << shf_mod64; @@ -288,7 +288,7 @@ impl ExecutionGadget for SarGadget { let shf_lt256 = shift .to_le_bytes() .iter() - .fold(0, |acc, val| acc + u128::from(*val)) + .fold(0, |acc, val| acc + u64::from(*val)) - shf0; let a64s = a.0; let mut a64s_lo = [0; 4]; @@ -320,9 +320,9 @@ impl ExecutionGadget for SarGadget { .map(|(c, v)| c.assign(region, offset, Value::known(F::from_u128(v)))) .collect::, _>>()?; self.shf_div64 - .assign(region, offset, Value::known(F::from_u128(shf_div64)))?; + .assign(region, offset, Value::known(F::from(shf_div64)))?; self.shf_mod64 - .assign(region, offset, Value::known(F::from_u128(shf_mod64)))?; + .assign(region, offset, Value::known(F::from(shf_mod64)))?; self.p_lo .assign(region, offset, Value::known(F::from_u128(p_lo)))?; self.p_hi @@ -336,19 +336,18 @@ impl ExecutionGadget for SarGadget { u64::from(a.to_le_bytes()[31]).into(), )?; self.shf_div64_lt_4 - .assign(region, offset, F::from_u128(shf_div64), 4.into())?; + .assign(region, offset, F::from(shf_div64), 4.into())?; self.shf_mod64_lt_64 - .assign(region, offset, F::from_u128(shf_mod64), 64.into())?; - self.shf_lt256 - .assign(region, offset, F::from_u128(shf_lt256))?; + .assign(region, offset, F::from(shf_mod64), 64.into())?; + self.shf_lt256.assign(region, offset, F::from(shf_lt256))?; self.shf_lo_div64_eq0 - .assign(region, offset, F::from_u128(shf_div64))?; + .assign(region, offset, F::from(shf_div64))?; self.shf_lo_div64_eq1 - .assign(region, offset, F::from_u128(shf_div64), F::from(1))?; + .assign(region, offset, F::from(shf_div64), F::from(1))?; self.shf_lo_div64_eq2 - .assign(region, offset, F::from_u128(shf_div64), F::from(2))?; + .assign(region, offset, F::from(shf_div64), F::from(2))?; self.shf_lo_div64_eq3 - .assign(region, offset, F::from_u128(shf_div64), F::from(3))?; + .assign(region, offset, F::from(shf_div64), F::from(3))?; self.a64s_lo_lt_p_lo .iter() .zip(a64s_lo.into_iter()) diff --git a/zkevm-circuits/src/evm_circuit/step.rs b/zkevm-circuits/src/evm_circuit/step.rs index 89026375f1..808f2d3290 100644 --- a/zkevm-circuits/src/evm_circuit/step.rs +++ b/zkevm-circuits/src/evm_circuit/step.rs @@ -1,3 +1,5 @@ +use std::marker::ConstParamTy; + use super::util::{CachedRegion, CellManager, CellType}; use crate::{ evm_circuit::{ @@ -9,9 +11,8 @@ use crate::{ witness::Transaction, }; use bus_mapping::{evm::OpcodeId, precompile::PrecompileCalls}; -use eth_types::evm_types::GasCost; +use eth_types::{evm_types::GasCost, Field}; use halo2_proofs::{ - arithmetic::FieldExt, circuit::Value, plonk::{Advice, Column, ConstraintSystem, Error, Expression}, }; @@ -36,7 +37,7 @@ impl From for ExecutionState { } #[allow(non_camel_case_types)] -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, EnumIter)] +#[derive(ConstParamTy, Clone, Copy, Debug, PartialEq, Eq, Hash, EnumIter)] pub enum ExecutionState { // Internal state BeginTx, @@ -437,7 +438,7 @@ pub(crate) struct DynamicSelectorHalf { pub(crate) target_pairs: Vec>, } -impl DynamicSelectorHalf { +impl DynamicSelectorHalf { pub(crate) fn new(cell_manager: &mut CellManager, count: usize) -> Self { let target_pairs = cell_manager.query_cells(CellType::StoragePhase1, (count + 1) / 2); let target_odd = cell_manager.query_cell(CellType::StoragePhase1); @@ -571,7 +572,7 @@ pub(crate) struct Step { pub(crate) cell_manager: CellManager, } -impl Step { +impl Step { pub(crate) fn new( meta: &mut ConstraintSystem, advices: [Column; STEP_WIDTH], diff --git a/zkevm-circuits/src/evm_circuit/util.rs b/zkevm-circuits/src/evm_circuit/util.rs index 44a4119bcc..3e51f1b8e3 100644 --- a/zkevm-circuits/src/evm_circuit/util.rs +++ b/zkevm-circuits/src/evm_circuit/util.rs @@ -11,9 +11,8 @@ use crate::{ witness::{Block, ExecStep, Rw, RwMap}, }; use bus_mapping::state_db::CodeDB; -use eth_types::{Address, ToLittleEndian, ToWord, U256}; +use eth_types::{Address, Field, ToLittleEndian, ToWord, U256}; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{AssignedCell, Region, Value}, halo2curves::group::ff::BatchInvert, plonk::{Advice, Assigned, Column, ConstraintSystem, Error, Expression, VirtualCells}, @@ -45,7 +44,7 @@ pub(crate) struct Cell { cell_column_index: usize, } -impl Cell { +impl Cell { pub(crate) fn new( meta: &mut VirtualCells, column: Column, @@ -80,18 +79,18 @@ impl Cell { } } -impl Expr for Cell { +impl Expr for Cell { fn expr(&self) -> Expression { self.expression.clone() } } -impl Expr for &Cell { +impl Expr for &Cell { fn expr(&self) -> Expression { self.expression.clone() } } -pub struct CachedRegion<'r, 'b, F: FieldExt> { +pub struct CachedRegion<'r, 'b, F: Field> { region: &'r mut Region<'b, F>, advice: Vec>, challenges: &'r Challenges>, @@ -106,7 +105,7 @@ pub struct CachedRegion<'r, 'b, F: FieldExt> { height_limit: usize, } -impl<'r, 'b, F: FieldExt> CachedRegion<'r, 'b, F> { +impl<'r, 'b, F: Field> CachedRegion<'r, 'b, F> { /// New cached region pub(crate) fn new( region: &'r mut Region<'b, F>, @@ -220,7 +219,7 @@ impl<'r, 'b, F: FieldExt> CachedRegion<'r, 'b, F> { pub fn code_hash(&self, n: U256) -> Value { if cfg!(feature = "poseidon-codehash") { - // only FieldExt is not enough for ToScalar trait so we have to make workaround + // only Field is not enough for ToScalar trait so we have to make workaround Value::known(rlc::value(&n.to_le_bytes(), F::from(256u64))) } else { self.challenges @@ -271,7 +270,7 @@ impl Hash for StoredExpression { } } -impl StoredExpression { +impl StoredExpression { pub fn assign( &self, region: &mut CachedRegion<'_, '_, F>, @@ -318,7 +317,7 @@ pub(crate) enum CellType { impl CellType { // The phase that given `Expression` becomes evaluateable. - fn expr_phase(expr: &Expression) -> u8 { + fn expr_phase(expr: &Expression) -> u8 { use Expression::*; match expr { Challenge(challenge) => challenge.phase() + 1, @@ -339,7 +338,7 @@ impl CellType { } /// Return the storage cell of the expression - pub(crate) fn storage_for_expr(expr: &Expression) -> CellType { + pub(crate) fn storage_for_expr(expr: &Expression) -> CellType { Self::storage_for_phase(Self::expr_phase::(expr)) } } @@ -352,7 +351,7 @@ pub(crate) struct CellColumn { pub(crate) expr: Expression, } -impl Expr for CellColumn { +impl Expr for CellColumn { fn expr(&self) -> Expression { self.expr.clone() } @@ -366,7 +365,7 @@ pub(crate) struct CellManager { columns: Vec>, } -impl CellManager { +impl CellManager { pub(crate) fn new( meta: &mut ConstraintSystem, height: usize, @@ -527,7 +526,7 @@ pub(crate) struct RandomLinearCombination { pub(crate) cells: [Cell; N], } -impl RandomLinearCombination { +impl RandomLinearCombination { const N_BYTES: usize = N; pub(crate) fn new(cells: [Cell; N], randomness: Expression) -> Self { @@ -555,7 +554,7 @@ impl RandomLinearCombination { } } -impl Expr for RandomLinearCombination { +impl Expr for RandomLinearCombination { fn expr(&self) -> Expression { self.expression.clone() } @@ -568,9 +567,10 @@ pub(crate) type MemoryAddress = RandomLinearCombination>(bytes: &[E]) -> Expression { + pub(crate) fn expr>(bytes: &[E]) -> Expression { debug_assert!( bytes.len() <= MAX_N_BYTES_INTEGER, "Too many bytes to compose an integer in field" @@ -584,7 +584,7 @@ pub(crate) mod from_bytes { value } - pub(crate) fn value(bytes: &[u8]) -> F { + pub(crate) fn value(bytes: &[u8]) -> F { debug_assert!( bytes.len() <= MAX_N_BYTES_INTEGER, "Too many bytes to compose an integer in field" @@ -602,9 +602,10 @@ pub(crate) mod from_bytes { /// Decodes a field element from its binary representation pub(crate) mod from_bits { use crate::{evm_circuit::param::MAX_N_BYTES_INTEGER, util::Expr}; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; - pub(crate) fn expr>(bits: &[E]) -> Expression { + pub(crate) fn expr>(bits: &[E]) -> Expression { debug_assert!( bits.len() <= MAX_N_BYTES_INTEGER * 8, "Too many bits to compose an integer in field" @@ -618,7 +619,7 @@ pub(crate) mod from_bits { value } - pub(crate) fn value(bits: &[bool]) -> F { + pub(crate) fn value(bits: &[bool]) -> F { debug_assert!( bits.len() <= MAX_N_BYTES_INTEGER * 8, "Too many bits to compose an integer in field" @@ -639,9 +640,10 @@ pub(crate) mod rlc { use std::ops::{Add, Mul}; use crate::util::Expr; - use halo2_proofs::{arithmetic::FieldExt, plonk::Expression}; + use eth_types::Field; + use halo2_proofs::plonk::Expression; - pub(crate) fn expr>(expressions: &[E], randomness: E) -> Expression { + pub(crate) fn expr>(expressions: &[E], randomness: E) -> Expression { if !expressions.is_empty() { generic(expressions.iter().map(|e| e.expr()), randomness.expr()) } else { @@ -649,7 +651,7 @@ pub(crate) mod rlc { } } - pub(crate) fn value<'a, F: FieldExt, I>(values: I, randomness: F) -> F + pub(crate) fn value<'a, F: Field, I>(values: I, randomness: F) -> F where I: IntoIterator, ::IntoIter: DoubleEndedIterator, @@ -678,13 +680,13 @@ pub(crate) mod rlc { } } -/// Returns 2**by as FieldExt -pub(crate) fn pow_of_two(by: usize) -> F { +/// Returns 2**by as Field +pub(crate) fn pow_of_two(by: usize) -> F { F::from(2).pow(&[by as u64, 0, 0, 0]) } /// Returns 2**by as Expression -pub(crate) fn pow_of_two_expr(by: usize) -> Expression { +pub(crate) fn pow_of_two_expr(by: usize) -> Expression { Expression::Constant(pow_of_two(by)) } @@ -756,7 +758,7 @@ pub struct Inverter { inverses: Vec, } -impl Inverter { +impl Inverter { /// Create a new Inverter with preloaded inverses up to `preload_up_to` inclusive. pub fn new(preload_up_to: u64) -> Self { let mut inverses = (0..=preload_up_to).map(F::from).collect::>(); diff --git a/zkevm-circuits/src/evm_circuit/util/common_gadget.rs b/zkevm-circuits/src/evm_circuit/util/common_gadget.rs index 9214f7c501..673495d8d2 100644 --- a/zkevm-circuits/src/evm_circuit/util/common_gadget.rs +++ b/zkevm-circuits/src/evm_circuit/util/common_gadget.rs @@ -286,13 +286,17 @@ impl RestoreContextGadget { [U256::zero(); 9] } else { field_tags + .iter() .zip([0, 1, 2, 3, 4, 5, 6, 7, 8]) - .map(|(field_tag, i)| { + .map(|(&field_tag, i)| { let idx = step.rw_indices[i + rw_offset]; let rw = block.rws[idx]; debug_assert_eq!(rw.field_tag(), Some(field_tag as u64)); rw.call_context_value() }) + .collect::>() + .try_into() + .unwrap() }; for (cell, value) in [ diff --git a/zkevm-circuits/src/evm_circuit/util/instrumentation.rs b/zkevm-circuits/src/evm_circuit/util/instrumentation.rs index e9839ef938..7de58deb45 100644 --- a/zkevm-circuits/src/evm_circuit/util/instrumentation.rs +++ b/zkevm-circuits/src/evm_circuit/util/instrumentation.rs @@ -3,7 +3,7 @@ use crate::evm_circuit::{ table::Table, util::{constraint_builder::EVMConstraintBuilder, CellType}, }; -use halo2_proofs::arithmetic::FieldExt; +use eth_types::Field; use itertools::Itertools; type StepSize = Vec<(CellType, ColumnSize)>; @@ -20,7 +20,7 @@ pub(crate) struct Instrument { impl Instrument { /// Collects `CellManager` stats from a compiled EVMCircuit in order to /// extract metrics. - pub(crate) fn on_gadget_built( + pub(crate) fn on_gadget_built( &mut self, execution_state: ExecutionState, cb: &EVMConstraintBuilder, diff --git a/zkevm-circuits/src/evm_circuit/util/math_gadget/test_util.rs b/zkevm-circuits/src/evm_circuit/util/math_gadget/test_util.rs index cda313a482..f8200c3838 100644 --- a/zkevm-circuits/src/evm_circuit/util/math_gadget/test_util.rs +++ b/zkevm-circuits/src/evm_circuit/util/math_gadget/test_util.rs @@ -102,6 +102,8 @@ impl UnitTestMathGadgetBaseCircuit { impl> Circuit for UnitTestMathGadgetBaseCircuit { type Config = (UnitTestMathGadgetBaseCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { UnitTestMathGadgetBaseCircuit { diff --git a/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs b/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs index 58012f1b98..56335318c6 100644 --- a/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs +++ b/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs @@ -24,7 +24,6 @@ use eth_types::{ Field, ToLittleEndian, U256, }; use halo2_proofs::{ - arithmetic::FieldExt, circuit::Value, plonk::{Error, Expression}, }; @@ -42,7 +41,7 @@ pub(crate) mod address_low { } /// Memory address trait to adapt for right and Uint overflow cases. -pub(crate) trait CommonMemoryAddressGadget { +pub(crate) trait CommonMemoryAddressGadget { fn construct_self(cb: &mut EVMConstraintBuilder) -> Self; /// Return the memory address (offset + length). diff --git a/zkevm-circuits/src/exp_circuit/dev.rs b/zkevm-circuits/src/exp_circuit/dev.rs index 51291c81c6..1c2114186b 100644 --- a/zkevm-circuits/src/exp_circuit/dev.rs +++ b/zkevm-circuits/src/exp_circuit/dev.rs @@ -14,6 +14,8 @@ use halo2_proofs::{ impl Circuit for ExpCircuit { type Config = (ExpCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/keccak_circuit/cell_manager.rs b/zkevm-circuits/src/keccak_circuit/cell_manager.rs index a2fdb30e57..3082daea02 100644 --- a/zkevm-circuits/src/keccak_circuit/cell_manager.rs +++ b/zkevm-circuits/src/keccak_circuit/cell_manager.rs @@ -1,7 +1,7 @@ use crate::keccak_circuit::util::extract_field; +use eth_types::Field; use gadgets::util::Expr; use halo2_proofs::{ - arithmetic::FieldExt, circuit::Value, plonk::{Advice, Column, ConstraintSystem, Expression, VirtualCells}, poly::Rotation, @@ -18,7 +18,7 @@ pub(crate) struct Cell { pub(crate) rotation: i32, } -impl Cell { +impl Cell { pub(crate) fn new( meta: &mut VirtualCells, column: Column, @@ -75,13 +75,13 @@ impl Cell { } } -impl Expr for Cell { +impl Expr for Cell { fn expr(&self) -> Expression { self.expression.clone() } } -impl Expr for &Cell { +impl Expr for &Cell { fn expr(&self) -> Expression { self.expression.clone() } @@ -103,7 +103,7 @@ pub struct CellManager { num_unused_cells: usize, } -impl CellManager { +impl CellManager { pub(crate) fn new(height: usize) -> Self { Self { height, diff --git a/zkevm-circuits/src/keccak_circuit/dev.rs b/zkevm-circuits/src/keccak_circuit/dev.rs index 22e7db5e95..fffade5318 100644 --- a/zkevm-circuits/src/keccak_circuit/dev.rs +++ b/zkevm-circuits/src/keccak_circuit/dev.rs @@ -14,6 +14,8 @@ use halo2_proofs::{ impl Circuit for KeccakCircuit { type Config = (KeccakCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs b/zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs index bf7e7bbfc2..9f58ad86dc 100644 --- a/zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs +++ b/zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs @@ -2,7 +2,6 @@ use super::{cell_manager::*, param::*, util::*}; use crate::{evm_circuit::util::rlc, util::Challenges}; use eth_types::Field; use halo2_proofs::{ - arithmetic::FieldExt, circuit::Value, plonk::{Error, Expression}, }; @@ -137,7 +136,7 @@ pub(crate) struct KeccakRegion { pub(crate) rows: Vec>, } -impl KeccakRegion { +impl KeccakRegion { pub(crate) fn new() -> Self { Self { rows: Vec::new() } } diff --git a/zkevm-circuits/src/keccak_circuit/table.rs b/zkevm-circuits/src/keccak_circuit/table.rs index be6d074798..8d64c595e6 100644 --- a/zkevm-circuits/src/keccak_circuit/table.rs +++ b/zkevm-circuits/src/keccak_circuit/table.rs @@ -258,6 +258,8 @@ mod tests { impl Circuit for TableTestCircuit { type Config = [TableColumn; 2]; type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { self.clone() diff --git a/zkevm-circuits/src/keccak_circuit/util.rs b/zkevm-circuits/src/keccak_circuit/util.rs index fa6acbd273..4a98fe1335 100644 --- a/zkevm-circuits/src/keccak_circuit/util.rs +++ b/zkevm-circuits/src/keccak_circuit/util.rs @@ -2,7 +2,7 @@ use super::{keccak_packed_multi::keccak_unusable_rows, param::*}; use eth_types::{Field, ToScalar, Word}; -use halo2_proofs::{circuit::Value, halo2curves::FieldExt}; +use halo2_proofs::circuit::Value; use std::env::var; /// Description of which bits (positions) a part contains @@ -233,7 +233,7 @@ pub(crate) fn get_num_bits_per_lookup_impl(range: usize, log_height: usize) -> u num_bits as usize } -pub(crate) fn extract_field(value: Value) -> F { +pub(crate) fn extract_field(value: Value) -> F { let mut field = F::zero(); let _ = value.map(|f| { field = f; diff --git a/zkevm-circuits/src/lib.rs b/zkevm-circuits/src/lib.rs index 00cf7e17f3..5534031813 100644 --- a/zkevm-circuits/src/lib.rs +++ b/zkevm-circuits/src/lib.rs @@ -5,7 +5,7 @@ #![allow(incomplete_features)] // Needed by DummyGadget in evm circuit #![feature(adt_const_params)] -#![feature(array_zip)] +// #![feature(array_zip)] #![feature(slice_group_by)] // Needed by some builder patterns in testing modules. #![cfg_attr(docsrs, feature(doc_cfg))] diff --git a/zkevm-circuits/src/modexp_circuit/dev.rs b/zkevm-circuits/src/modexp_circuit/dev.rs index 20273b6ca8..88ca65b416 100644 --- a/zkevm-circuits/src/modexp_circuit/dev.rs +++ b/zkevm-circuits/src/modexp_circuit/dev.rs @@ -9,6 +9,8 @@ use halo2_proofs::{ impl Circuit for ModExpCircuit { type Config = (ModExpCircuitConfig, MockChallenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/mpt_circuit.rs b/zkevm-circuits/src/mpt_circuit.rs index 23335d8048..99aa2acef1 100644 --- a/zkevm-circuits/src/mpt_circuit.rs +++ b/zkevm-circuits/src/mpt_circuit.rs @@ -156,6 +156,8 @@ impl SubCircuit for MptCircuit { impl Circuit for MptCircuit { type Config = (MptCircuitConfig, PoseidonTable, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self { diff --git a/zkevm-circuits/src/pi_circuit.rs b/zkevm-circuits/src/pi_circuit.rs index d9dbcaa35e..2ab91a88f9 100644 --- a/zkevm-circuits/src/pi_circuit.rs +++ b/zkevm-circuits/src/pi_circuit.rs @@ -614,12 +614,12 @@ impl SubCircuitConfig for PiCircuitConfig { // | lo | b0 | b15*2^120+... | b31*r^31+...| // We use copy constraints to - // 1. copy the RLC(data_bytes, keccak_rand) in the `rpi_rlc_acc` column - // to the `rpi` column on the row that q_keccak = 1 for data bytes. - // 2. copy the len(data_bytes) in the `rpi_length_acc` column to the - // `rpi_length_acc` column on the row that q_keccak = 1 for data bytes. - // 3. copy the RLC(data_hash_bytes, word_rand) in the `rpi_rlc_acc` column - // to the `rpi_rlc_acc` column on the row that q_keccak = 1 for data hash. + // 1. copy the RLC(data_bytes, keccak_rand) in the `rpi_rlc_acc` column to the `rpi` column + // on the row that q_keccak = 1 for data bytes. + // 2. copy the len(data_bytes) in the `rpi_length_acc` column to the `rpi_length_acc` column + // on the row that q_keccak = 1 for data bytes. + // 3. copy the RLC(data_hash_bytes, word_rand) in the `rpi_rlc_acc` column to the + // `rpi_rlc_acc` column on the row that q_keccak = 1 for data hash. // The layout for entire pi circuit looks like // data bytes: | rpi | rpi_bytes | rpi_bytes_acc | rpi_rlc_acc | rpi_length_acc | diff --git a/zkevm-circuits/src/pi_circuit/dev.rs b/zkevm-circuits/src/pi_circuit/dev.rs index cf9fcb061e..a6c991e688 100644 --- a/zkevm-circuits/src/pi_circuit/dev.rs +++ b/zkevm-circuits/src/pi_circuit/dev.rs @@ -78,6 +78,8 @@ impl, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/poseidon_circuit.rs b/zkevm-circuits/src/poseidon_circuit.rs index 3d55682117..2a686b4188 100644 --- a/zkevm-circuits/src/poseidon_circuit.rs +++ b/zkevm-circuits/src/poseidon_circuit.rs @@ -204,6 +204,8 @@ impl SubCircuit for PoseidonCircuit { impl Circuit for PoseidonCircuit { type Config = (PoseidonCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self(Default::default(), self.1) diff --git a/zkevm-circuits/src/rlp_circuit_fsm/dev.rs b/zkevm-circuits/src/rlp_circuit_fsm/dev.rs index 6926c15425..ec775f397c 100644 --- a/zkevm-circuits/src/rlp_circuit_fsm/dev.rs +++ b/zkevm-circuits/src/rlp_circuit_fsm/dev.rs @@ -13,6 +13,8 @@ use halo2_proofs::{ impl Circuit for RlpCircuit { type Config = (RlpCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/sha256_circuit/circuit.rs b/zkevm-circuits/src/sha256_circuit/circuit.rs index 0584f491c0..8e8eebd8a4 100644 --- a/zkevm-circuits/src/sha256_circuit/circuit.rs +++ b/zkevm-circuits/src/sha256_circuit/circuit.rs @@ -979,7 +979,7 @@ impl Hasher { &mut self, layouter: &mut impl Layouter, chng: Value, - ) -> Result<([BlockWord; DIGEST_SIZE]), Error> { + ) -> Result<[BlockWord; DIGEST_SIZE], Error> { // check padding requirement let mut padding_pos = Some(self.cur_block.len()); diff --git a/zkevm-circuits/src/sig_circuit/ecdsa.rs b/zkevm-circuits/src/sig_circuit/ecdsa.rs index 4ade29bb68..699e73f0ad 100644 --- a/zkevm-circuits/src/sig_circuit/ecdsa.rs +++ b/zkevm-circuits/src/sig_circuit/ecdsa.rs @@ -79,15 +79,15 @@ where .or(ctx, Existing(s_is_zero), Existing(s_in_range)); // load required constants - let zero = scalar_chip.load_constant(ctx, FpConfig::::fe_to_constant(SF::zero())); - let one = scalar_chip.load_constant(ctx, FpConfig::::fe_to_constant(SF::one())); + let zero = scalar_chip.load_constant(ctx, FpConfig::::fe_to_constant(SF::ZERO)); + let one = scalar_chip.load_constant(ctx, FpConfig::::fe_to_constant(SF::ONE)); let point_at_infinity = EcPoint::construct( ecc_chip .field_chip() - .load_constant(ctx, fe_to_biguint(&CF::zero())), + .load_constant(ctx, fe_to_biguint(&CF::ZERO)), ecc_chip .field_chip() - .load_constant(ctx, fe_to_biguint(&CF::zero())), + .load_constant(ctx, fe_to_biguint(&CF::ZERO)), ); // compute u1 = m * s^{-1} mod n @@ -179,7 +179,7 @@ where let lambda = { let a_val = base_chip.get_assigned_value(&dy); let b_val = base_chip.get_assigned_value(&dx); - let b_inv = b_val.map(|bv| bv.invert().unwrap_or(CF::zero())); + let b_inv = b_val.map(|bv| bv.invert().unwrap_or(CF::ZERO)); let quot_val = a_val.zip(b_inv).map(|(a, bi)| a * bi); let quot = base_chip.load_private(ctx, FpConfig::::fe_to_witness("_val)); // constrain quot * b - a = 0 mod p diff --git a/zkevm-circuits/src/state_circuit/dev.rs b/zkevm-circuits/src/state_circuit/dev.rs index 2cfe59c917..ee1006b1dd 100644 --- a/zkevm-circuits/src/state_circuit/dev.rs +++ b/zkevm-circuits/src/state_circuit/dev.rs @@ -17,6 +17,8 @@ where { type Config = (StateCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/state_circuit/lexicographic_ordering.rs b/zkevm-circuits/src/state_circuit/lexicographic_ordering.rs index b0567279a0..6c9787603d 100644 --- a/zkevm-circuits/src/state_circuit/lexicographic_ordering.rs +++ b/zkevm-circuits/src/state_circuit/lexicographic_ordering.rs @@ -38,10 +38,8 @@ use strum_macros::EnumIter; // 1. limb_difference fits into 16 bits. // 2. limb_difference is not zero because its inverse exists. -// 3. RLC of the pairwise limb differences before the first_different_limb is -// zero. -// 4. limb_difference equals the difference of the limbs at -// first_different_limb. +// 3. RLC of the pairwise limb differences before the first_different_limb is zero. +// 4. limb_difference equals the difference of the limbs at first_different_limb. #[derive(Clone, Copy, Debug, EnumIter)] pub enum LimbIndex { diff --git a/zkevm-circuits/src/state_circuit/test.rs b/zkevm-circuits/src/state_circuit/test.rs index 3f73904bba..0fec7fa179 100644 --- a/zkevm-circuits/src/state_circuit/test.rs +++ b/zkevm-circuits/src/state_circuit/test.rs @@ -1107,5 +1107,8 @@ fn assert_error_matches(result: Result<(), Vec>, name: &str) { VerifyFailure::CellNotAssigned { .. } => panic!(), VerifyFailure::ConstraintPoisoned { .. } => panic!(), VerifyFailure::Permutation { .. } => panic!(), + // FIXME + // &VerifyFailure::InstanceCellNotAssigned { .. } | &VerifyFailure::Shuffle { .. } => + // todo!(), } } diff --git a/zkevm-circuits/src/super_circuit.rs b/zkevm-circuits/src/super_circuit.rs index d25aad051f..e2dc6c4882 100644 --- a/zkevm-circuits/src/super_circuit.rs +++ b/zkevm-circuits/src/super_circuit.rs @@ -732,6 +732,8 @@ impl< { type Config = (SuperCircuitConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { let dummy_block = Block:: { diff --git a/zkevm-circuits/src/table.rs b/zkevm-circuits/src/table.rs index 9810cee984..b1838c6035 100644 --- a/zkevm-circuits/src/table.rs +++ b/zkevm-circuits/src/table.rs @@ -28,7 +28,6 @@ use gadgets::{ util::{and, not, split_u256, split_u256_limb64, Expr}, }; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{AssignedCell, Layouter, Region, Value}, halo2curves::bn256::{Fq, G1Affine}, plonk::{Advice, Any, Column, ConstraintSystem, Error, Expression, Fixed, VirtualCells}, @@ -608,7 +607,7 @@ impl LookupTable for RwTable { } impl RwTable { /// Construct a new RwTable - pub fn construct(meta: &mut ConstraintSystem) -> Self { + pub fn construct(meta: &mut ConstraintSystem) -> Self { Self { q_enable: meta.fixed_column(), rw_counter: meta.advice_column(), @@ -764,7 +763,7 @@ impl LookupTable for MptTable { impl MptTable { /// Construct a new MptTable - pub(crate) fn construct(meta: &mut ConstraintSystem) -> Self { + pub(crate) fn construct(meta: &mut ConstraintSystem) -> Self { Self { q_enable: meta.fixed_column(), address: meta.advice_column(), @@ -885,7 +884,7 @@ impl PoseidonTable { pub(crate) const INPUT_WIDTH: usize = Self::WIDTH - 1; /// Construct a new PoseidonTable - pub(crate) fn construct(meta: &mut ConstraintSystem) -> Self { + pub(crate) fn construct(meta: &mut ConstraintSystem) -> Self { Self { q_enable: meta.fixed_column(), hash_id: meta.advice_column(), @@ -2457,15 +2456,14 @@ impl LookupTable for SigTable { } } -/// 1. if EcAdd(P, Q) == R then: -/// (arg1_rlc, arg2_rlc, arg3_rlc, arg4_rlc) \mapsto (output1_rlc, output2_rlc). +/// 1. if EcAdd(P, Q) == R then: (arg1_rlc, arg2_rlc, arg3_rlc, arg4_rlc) \mapsto (output1_rlc, +/// output2_rlc). /// /// where arg1_rlc = rlc(P.x), arg2_rlc = rlc(P.y), /// arg3_rlc = rlc(Q.x), arg4_rlc = rlc(Q.x), /// output1_rlc = rlc(R.x), output2_rlc = rlc(R.y), /// -/// 2. if EcMul(P, s) == R then: -/// (arg1_rlc, arg2_rlc, arg3_rlc) \mapsto (output1_rlc, output2_rlc). +/// 2. if EcMul(P, s) == R then: (arg1_rlc, arg2_rlc, arg3_rlc) \mapsto (output1_rlc, output2_rlc). /// /// where arg1_rlc = rlc(P.x), arg2_rlc = rlc(P.y), /// arg3_rlc = s @@ -2721,7 +2719,7 @@ impl ModExpTable { let mut bytes = [0u8; 64]; remainder.to_little_endian(&mut bytes[..32]); - F::from_bytes_wide(&bytes) + F::from_uniform_bytes(&bytes) } /// fill a blank 4-row region start from offset for empty lookup @@ -2779,6 +2777,7 @@ impl ModExpTable { for i in 0..3 { for (limbs, &col) in [base_limbs, exp_limbs, modulus_limbs, result_limbs] + .iter() .zip([&self.base, &self.exp, &self.modulus, &self.result]) { region.assign_advice( @@ -2791,13 +2790,10 @@ impl ModExpTable { } // native is not used by lookup (and in fact it can be omitted in dev) - for (word, &col) in [ - &event.base, - &event.exponent, - &event.modulus, - &event.result, - ] - .zip([&self.base, &self.exp, &self.modulus, &self.result]) + for (word, &col) in + [&event.base, &event.exponent, &event.modulus, &event.result] + .iter() + .zip([&self.base, &self.exp, &self.modulus, &self.result]) { region.assign_advice( || format!("modexp table native row {}", offset + 3), diff --git a/zkevm-circuits/src/tx_circuit.rs b/zkevm-circuits/src/tx_circuit.rs index e007dc3ae6..80e52d17fb 100644 --- a/zkevm-circuits/src/tx_circuit.rs +++ b/zkevm-circuits/src/tx_circuit.rs @@ -14,7 +14,7 @@ pub use dev::TxCircuitTester as TestTxCircuit; use crate::{ evm_circuit::util::constraint_builder::{BaseConstraintBuilder, ConstrainBuilderCommon}, - sig_circuit::SigCircuit, + // sig_circuit::SigCircuit, table::{ BlockContextFieldTag::{CumNumTxs, NumAllTxs, NumTxs}, BlockTable, KeccakTable, LookupTable, RlpFsmRlpTable as RlpTable, SigTable, TxFieldTag, diff --git a/zkevm-circuits/src/tx_circuit/dev.rs b/zkevm-circuits/src/tx_circuit/dev.rs index 2d59cc2884..fe25a11783 100644 --- a/zkevm-circuits/src/tx_circuit/dev.rs +++ b/zkevm-circuits/src/tx_circuit/dev.rs @@ -155,6 +155,8 @@ impl SubCircuit for TxCircuitTester { impl Circuit for TxCircuitTester { type Config = (TxCircuitTesterConfig, Challenges); type FloorPlanner = SimpleFloorPlanner; + #[cfg(feature = "circuit-params")] + type Params = (); fn without_witnesses(&self) -> Self { Self::default() diff --git a/zkevm-circuits/src/tx_circuit/test.rs b/zkevm-circuits/src/tx_circuit/test.rs index 946a182ebd..4a85cd3693 100644 --- a/zkevm-circuits/src/tx_circuit/test.rs +++ b/zkevm-circuits/src/tx_circuit/test.rs @@ -8,6 +8,7 @@ use std::cmp::max; use super::*; use crate::{ + sig_circuit::{SigCircuit, SigCircuitConfig, SigCircuitConfigArgs}, tx_circuit::{dev::TxCircuitTester, get_sign_data}, util::{log2_ceil, unusable_rows}, }; diff --git a/zkevm-circuits/src/util.rs b/zkevm-circuits/src/util.rs index 3f9583b000..a0e10fac08 100644 --- a/zkevm-circuits/src/util.rs +++ b/zkevm-circuits/src/util.rs @@ -3,7 +3,6 @@ use std::collections::BTreeSet; use bus_mapping::evm::OpcodeId; use halo2_proofs::{ - arithmetic::FieldExt, circuit::{Layouter, Value}, plonk::{Challenge, Circuit, ConstraintSystem, Error, Expression, FirstPhase, VirtualCells}, }; @@ -22,7 +21,7 @@ pub use gadgets::util::Expr; /// A wrapper of is_zero in gadgets which gives is_zero at any rotation pub mod is_zero; -pub(crate) fn query_expression( +pub(crate) fn query_expression( meta: &mut ConstraintSystem, mut f: impl FnMut(&mut VirtualCells) -> T, ) -> T { @@ -34,7 +33,7 @@ pub(crate) fn query_expression( expr.unwrap() } -pub(crate) fn random_linear_combine_word(bytes: [u8; 32], randomness: F) -> F { +pub(crate) fn random_linear_combine_word(bytes: [u8; 32], randomness: F) -> F { rlc::value(&bytes, randomness) } @@ -64,7 +63,7 @@ pub struct MockChallenges { impl MockChallenges { /// .. - pub fn construct(_meta: &mut ConstraintSystem) -> Self { + pub fn construct(_meta: &mut ConstraintSystem) -> Self { Self { evm_word: 0x100, keccak_input: 0x101, @@ -72,7 +71,7 @@ impl MockChallenges { } } /// .. - pub fn exprs(&self, _meta: &mut ConstraintSystem) -> Challenges> { + pub fn exprs(&self, _meta: &mut ConstraintSystem) -> Challenges> { Challenges { evm_word: Expression::Constant(F::from(self.evm_word)), keccak_input: Expression::Constant(F::from(self.keccak_input)), @@ -80,7 +79,7 @@ impl MockChallenges { } } /// .. - pub fn values(&self, _layouter: &impl Layouter) -> Challenges> { + pub fn values(&self, _layouter: &impl Layouter) -> Challenges> { Challenges { evm_word: Value::known(F::from(self.evm_word)), keccak_input: Value::known(F::from(self.keccak_input)), @@ -91,7 +90,7 @@ impl MockChallenges { impl Challenges { /// Construct `Challenges` by allocating challenges in specific phases. - pub fn construct(meta: &mut ConstraintSystem) -> Self { + pub fn construct(meta: &mut ConstraintSystem) -> Self { #[cfg(any(not(feature = "onephase"), feature = "test", test))] let _dummy_cols = [ meta.advice_column(), @@ -107,7 +106,7 @@ impl Challenges { } /// Returns `Expression` of challenges from `ConstraintSystem`. - pub fn exprs(&self, meta: &mut ConstraintSystem) -> Challenges> { + pub fn exprs(&self, meta: &mut ConstraintSystem) -> Challenges> { let [evm_word, keccak_input, lookup_input] = query_expression(meta, |meta| { [self.evm_word, self.keccak_input, self.lookup_input] .map(|challenge| meta.query_challenge(challenge)) @@ -120,7 +119,7 @@ impl Challenges { } /// Returns `Value` of challenges from `Layouter`. - pub fn values(&self, layouter: &impl Layouter) -> Challenges> { + pub fn values(&self, layouter: &impl Layouter) -> Challenges> { Challenges { evm_word: layouter.get_challenge(self.evm_word), keccak_input: layouter.get_challenge(self.keccak_input), diff --git a/zkevm-circuits/src/witness/rlp_fsm.rs b/zkevm-circuits/src/witness/rlp_fsm.rs index 3a6b3cf077..bb2c2d9bc0 100644 --- a/zkevm-circuits/src/witness/rlp_fsm.rs +++ b/zkevm-circuits/src/witness/rlp_fsm.rs @@ -1,6 +1,6 @@ use eth_types::{Address, Field, H160, U256}; use gadgets::{impl_expr, util::Expr}; -use halo2_proofs::{arithmetic::FieldExt, circuit::Value, plonk::Expression}; +use halo2_proofs::{circuit::Value, plonk::Expression}; use strum_macros::EnumIter; use crate::util::Challenges; @@ -642,7 +642,7 @@ impl_expr!(Tag); impl_expr!(Format); impl_expr!(State); -impl Expr for RlpTag { +impl Expr for RlpTag { fn expr(&self) -> Expression { match self { Self::Tag(tag) => tag.expr(), @@ -653,7 +653,7 @@ impl Expr for RlpTag { /// Data table holds the raw RLP bytes #[derive(Clone, Copy, Debug)] -pub struct DataTable { +pub struct DataTable { /// The index of tx to be decoded pub tx_id: u64, /// The format of format to be decoded @@ -670,7 +670,7 @@ pub struct DataTable { pub gas_cost_acc: Value, } -impl DataTable { +impl DataTable { /// values pub fn values(&self) -> Vec> { vec![ @@ -687,7 +687,7 @@ impl DataTable { /// RLP table that is connected to the state machine in the RLP circuit. #[derive(Clone, Copy, Debug)] -pub struct RlpTable { +pub struct RlpTable { /// The index of tx we decoded pub tx_id: u64, /// The format of format we decoded @@ -710,7 +710,7 @@ pub struct RlpTable { /// State Machine #[derive(Clone, Copy, Debug)] -pub struct StateMachine { +pub struct StateMachine { /// Current state pub state: State, /// Current tag to be decoded @@ -742,7 +742,7 @@ pub struct StateMachine { /// Represents the witness in a single row of the RLP circuit. #[derive(Clone, Debug)] -pub struct RlpFsmWitnessRow { +pub struct RlpFsmWitnessRow { /// Witness to the RLP table. pub rlp_table: RlpTable, /// The state machine witness. @@ -751,7 +751,7 @@ pub struct RlpFsmWitnessRow { /// The RlpFsmWitnessGen trait is implemented by data types who's RLP encoding can /// be verified by the RLP-encoding circuit. -pub trait RlpFsmWitnessGen: Sized { +pub trait RlpFsmWitnessGen: Sized { /// Generate witness to the RLP state machine, as a vector of RlpFsmWitnessRow. fn gen_sm_witness(&self, challenges: &Challenges>) -> Vec>; diff --git a/zktrie/Cargo.toml b/zktrie/Cargo.toml index 219d3c87d9..3a6fa6d0e4 100644 --- a/zktrie/Cargo.toml +++ b/zktrie/Cargo.toml @@ -8,8 +8,8 @@ license.workspace = true [dependencies] halo2_proofs.workspace = true -mpt-circuits = { package = "halo2-mpt-circuits", git = "https://github.com/scroll-tech/mpt-circuit.git", tag = "v0.7.0" } -zktrie = { git = "https://github.com/scroll-tech/zktrie.git", branch = "v0.7"} +mpt-circuits = { package = "halo2-mpt-circuits", git = "https://github.com/scroll-tech/mpt-circuit.git", branch = "v0.7" } +zktrie = { git = "https://github.com/scroll-tech/zktrie.git", tag = "v0.7.1" } hash-circuit.workspace = true eth-types = { path = "../eth-types" } lazy_static.workspace = true diff --git a/zktrie/src/state/builder.rs b/zktrie/src/state/builder.rs index d020fb49d2..b5c5886353 100644 --- a/zktrie/src/state/builder.rs +++ b/zktrie/src/state/builder.rs @@ -8,10 +8,7 @@ use std::{ io::{Error, ErrorKind, Read}, }; -use halo2_proofs::{ - arithmetic::FieldExt, - halo2curves::{bn256::Fr, group::ff::PrimeField}, -}; +use halo2_proofs::halo2curves::{bn256::Fr, group::ff::PrimeField}; use hash_circuit::hash::Hashable; use lazy_static::lazy_static; diff --git a/zktrie/src/state/witness.rs b/zktrie/src/state/witness.rs index f10e7851cb..8b509a5e43 100644 --- a/zktrie/src/state/witness.rs +++ b/zktrie/src/state/witness.rs @@ -396,7 +396,7 @@ fn smt_hash_from_bytes(bt: &[u8]) -> SMTHash { } fn hash_zktrie_key(key_buf: &[u8; 32]) -> Word { - use halo2_proofs::{arithmetic::FieldExt, halo2curves::bn256::Fr}; + use halo2_proofs::halo2curves::bn256::Fr; use hash_circuit::hash::Hashable; let first_16bytes: [u8; 16] = key_buf[..16].try_into().expect("expect first 16 bytes");