diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json index 63c033ca3c..07194f6342 100644 --- a/.github/release-please/manifest.json +++ b/.github/release-please/manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.4" + ".": "0.0.7" } diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index a5dccaf60e..4d740a84ea 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -38,5 +38,4 @@ jobs: uses: ./.github/workflows/release.yml with: tag: ${{ needs.release-please.outputs.tag_name }} - version: ${{ (needs.release-please.outputs.tag_name && format('{0}.{1}.{2}', needs.release-please.outputs.major, needs.release-please.outputs.minor, needs.release-please.outputs.patch)) || ''}} secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 441baf40b7..fc163ce281 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,11 +12,6 @@ on: type: string required: true default: "" - version: - description: "Version for the release." - type: string - required: true - default: "" env: CARGO_TERM_COLOR: always @@ -43,21 +38,31 @@ jobs: id: release_info run: | echo "nightly: $IS_NIGHTLY" - if [ $IS_NIGHTLY == "true" ]; then - TAG="${{ inputs.tag || format('nightly-{0}', github.sha) }}" - VERSION="${{ inputs.version || 'nightly' }}" + if [ $IS_NIGHTLY == "true" ]; then + if [ "${{inputs.tag}}" ]; then + TAG="${{ inputs.tag }}" + VERSION="${TAG#foundry-zksync-}" + else + TAG="${{ format('nightly-{0}', github.sha) }}" + VERSION=nightly + fi echo "tag_name=${TAG}" >> $GITHUB_OUTPUT echo "version_name=${VERSION}" >> $GITHUB_OUTPUT echo "release_name=foundry-zksync Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT echo "prerelease=true" >> $GITHUB_OUTPUT else - TAG="${{ inputs.tag || format('stable-{0}', github.sha) }}" - VERSION="${{ inputs.version || 'stable' }}" + if [ "${{inputs.tag}}" ]; then + TAG="${{ inputs.tag }}" + VERSION="${TAG#foundry-zksync-}" + else + TAG="${{ format('stable-{0}', github.sha) }}" + VERSION=stable + fi echo "tag_name=${TAG}" >> $GITHUB_OUTPUT - echo "version_name=v${VERSION}" >> $GITHUB_OUTPUT - echo "release_name=foundry-zksync v${VERSION}" >> $GITHUB_OUTPUT + echo "version_name=${VERSION}" >> $GITHUB_OUTPUT + echo "release_name=foundry-zksync ${VERSION}" >> $GITHUB_OUTPUT echo "prerelease=false" >> $GITHUB_OUTPUT fi @@ -211,8 +216,8 @@ jobs: help2man -N ./target/${TARGET}/release/cast > cast.1 gzip forge.1 gzip cast.1 - tar -czvf "foundry_man_${VERSION_NAME}.tar.gz" forge.1.gz cast.1.gz - echo "foundry_man=foundry_man_${VERSION_NAME}.tar.gz" >> $GITHUB_OUTPUT + tar -czvf "foundry_zksync_man_${VERSION_NAME}.tar.gz" forge.1.gz cast.1.gz + echo "foundry_man=foundry_zksync_man_${VERSION_NAME}.tar.gz" >> $GITHUB_OUTPUT # Creates the release for this specific version - name: Create release diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e9df348f..ae83e8d3ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # Changelog +## [0.0.7](https://github.com/matter-labs/foundry-zksync/compare/foundry-zksync-v0.0.6...foundry-zksync-v0.0.7) (2025-01-31) + + +### Bug Fixes + +* fix installation script for v0.0.6 ([#887](https://github.com/matter-labs/foundry-zksync/issues/887)) ([296c8f3](https://github.com/matter-labs/foundry-zksync/commit/296c8f3b14d7fe28ef6ed64592568cfed005e422)) +* foundry man artifact name ([#886](https://github.com/matter-labs/foundry-zksync/issues/886)) ([62d5ff6](https://github.com/matter-labs/foundry-zksync/commit/62d5ff66cae2af74f4fad8524337a33394ae8437)) + +## [0.0.6](https://github.com/matter-labs/foundry-zksync/compare/foundry-zksync-v0.0.5...foundry-zksync-v0.0.6) (2025-01-31) + + +### Features + +* implement compiler backwards compatibility policy ([#843](https://github.com/matter-labs/foundry-zksync/issues/843)) ([469b770](https://github.com/matter-labs/foundry-zksync/commit/469b7700404178060e6ee135ab967d723851bfa2)) + + +### Bug Fixes + +* trim tag name to obtain version ([#885](https://github.com/matter-labs/foundry-zksync/issues/885)) ([113501c](https://github.com/matter-labs/foundry-zksync/commit/113501c28a53e95393e20f1ab37df8848b472b95)) + +## [0.0.5](https://github.com/matter-labs/foundry-zksync/compare/foundry-zksync-v0.0.4...foundry-zksync-v0.0.5) (2025-01-29) + + +### Features + +* add assemblycreate for warning suppression for zksolc 1.5.10 ([#840](https://github.com/matter-labs/foundry-zksync/issues/840)) ([62af6f9](https://github.com/matter-labs/foundry-zksync/commit/62af6f93260e470ae77501cfdcab27e94e9424de)) +* Cache invalidation on zksolc version change ([#871](https://github.com/matter-labs/foundry-zksync/issues/871)) ([60a8f35](https://github.com/matter-labs/foundry-zksync/commit/60a8f35202d23064e589b3334be331fc42e31993)) +* Upstream 5e72c69 ([#876](https://github.com/matter-labs/foundry-zksync/issues/876)) ([7b50143](https://github.com/matter-labs/foundry-zksync/commit/7b5014354a71a58e5a8e1326abe375ad0be988b4)) +* **zk:** zksolc linking ([#800](https://github.com/matter-labs/foundry-zksync/issues/800)) ([b69695a](https://github.com/matter-labs/foundry-zksync/commit/b69695a020ba4d2850e069e7a0d53a03c5d92ac2)) + + +### Bug Fixes + +* add proper filter sets for ci test runs ([#875](https://github.com/matter-labs/foundry-zksync/issues/875)) ([886ff8b](https://github.com/matter-labs/foundry-zksync/commit/886ff8b4e4e3b466665f0236f30fb32bc6af1c2b)) +* release artifact names and tags ([#866](https://github.com/matter-labs/foundry-zksync/issues/866)) ([b993907](https://github.com/matter-labs/foundry-zksync/commit/b993907c8c4873bdc720d7a942e0ae70466ed1be)) +* Remove wrong estimation in create for zksync transactions ([#864](https://github.com/matter-labs/foundry-zksync/issues/864)) ([cf0a88d](https://github.com/matter-labs/foundry-zksync/commit/cf0a88d18218471dcf13d62afa4f8fe5335d9740)) +* set log level for nonce revert to trace ([#873](https://github.com/matter-labs/foundry-zksync/issues/873)) ([a9289fb](https://github.com/matter-labs/foundry-zksync/commit/a9289fbb04b528a30d42d3daac5e62f250b04dc7)) + ## [0.0.4](https://github.com/matter-labs/foundry-zksync/compare/foundry-zksync-v0.0.3...foundry-zksync-v0.0.4) (2025-01-23) diff --git a/Cargo.lock b/Cargo.lock index a2d0cf6dac..4fc7ebad6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.57" +version = "0.1.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab9d1367c6ffb90c93fb4a9a4989530aa85112438c6f73a734067255d348469" +checksum = "a0161082e0edd9013d23083465cc04b20e44b7a15646d36ba7b0cdb7cd6fe18f" dependencies = [ "alloy-primitives", "num_enum 0.7.3", @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "alloy-core" -version = "0.8.19" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648275bb59110f88cc5fa9a176845e52a554ebfebac2d21220bcda8c9220f797" +checksum = "c618bd382f0bc2ac26a7e4bfae01c9b015ca8f21b37ca40059ae35a7e62b3dc6" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -209,7 +209,7 @@ dependencies = [ "proptest", "serde", "serde_json", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] @@ -446,7 +446,7 @@ dependencies = [ "foldhash", "getrandom", "hashbrown 0.15.2", - "indexmap 2.7.1", + "indexmap 2.7.0", "itoa", "k256 0.13.4", "keccak-asm", @@ -492,7 +492,7 @@ dependencies = [ "futures-utils-wasm", "lru", "parking_lot", - "pin-project 1.1.8", + "pin-project 1.1.7", "reqwest 0.12.9", "schnellru", "serde", @@ -525,9 +525,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.11" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6c1d995bff8d011f7cd6c81820d51825e6e06d6db73914c1630ecf544d83d6" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "alloy-rlp-derive", "arrayvec 0.7.6", @@ -536,13 +536,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.11" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40e1ef334153322fd878d07e86af7a529bcb86b2439525920a88eba87bcf943" +checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -559,7 +559,7 @@ dependencies = [ "alloy-transport-ipc", "alloy-transport-ws", "futures 0.3.31", - "pin-project 1.1.8", + "pin-project 1.1.7", "reqwest 0.12.9", "serde", "serde_json", @@ -876,7 +876,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -889,11 +889,11 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.7.1", + "indexmap 2.7.0", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "syn-solidity", "tiny-keccak 2.0.2", ] @@ -911,7 +911,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.96", + "syn 2.0.90", "syn-solidity", ] @@ -922,7 +922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74e60b084fe1aef8acecda2743ff2d93c18ff3eb67a2d3b12f62582a1e66ef5e" dependencies = [ "serde", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] @@ -985,7 +985,7 @@ dependencies = [ "bytes", "futures 0.3.31", "interprocess", - "pin-project 1.1.8", + "pin-project 1.1.7", "serde", "serde_json", "tempfile", @@ -1004,7 +1004,7 @@ dependencies = [ "alloy-transport", "futures 0.3.31", "http 1.2.0", - "rustls 0.23.21", + "rustls 0.23.19", "serde_json", "tokio", "tokio-tungstenite", @@ -1159,18 +1159,17 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anvil" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-chains", "alloy-consensus 0.9.2", @@ -1240,7 +1239,7 @@ dependencies = [ [[package]] name = "anvil-core" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-consensus 0.9.2", "alloy-dyn-abi", @@ -1264,7 +1263,7 @@ dependencies = [ [[package]] name = "anvil-rpc" -version = "0.0.4" +version = "0.0.7" dependencies = [ "serde", "serde_json", @@ -1272,7 +1271,7 @@ dependencies = [ [[package]] name = "anvil-server" -version = "0.0.4" +version = "0.0.7" dependencies = [ "anvil-rpc", "async-trait", @@ -1282,7 +1281,7 @@ dependencies = [ "futures 0.3.31", "interprocess", "parking_lot", - "pin-project 1.1.8", + "pin-project 1.1.7", "serde", "serde_json", "thiserror 2.0.11", @@ -1356,7 +1355,7 @@ dependencies = [ "flate2", "futures 0.3.31", "hex", - "indexmap 2.7.1", + "indexmap 2.7.0", "itertools 0.13.0", "lazy_static", "once_cell", @@ -1595,7 +1594,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -1617,18 +1616,18 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -1675,13 +1674,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -1692,9 +1691,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.15" +version = "1.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc47e70fc35d054c8fcd296d47a61711f043ac80534a10b4f741904f81e73a90" +checksum = "9b49afaa341e8dd8577e1a2200468f98956d6eda50bcf4a53246cc00174ba924" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1703,7 +1702,7 @@ dependencies = [ "aws-sdk-sts", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-json", + "aws-smithy-json 0.60.7", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", @@ -1734,34 +1733,36 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.12.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca" +checksum = "cdd82dba44d209fddb11c190e0a94b78651f95299598e472215667417a03ff1d" dependencies = [ "aws-lc-sys", + "mirai-annotations", "paste", "zeroize", ] [[package]] name = "aws-lc-sys" -version = "0.25.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b2ddd3ada61a305e1d8bb6c005d1eaa7d14d903681edfc400406d523a9b491" +checksum = "df7a4168111d7eb622a31b214057b8509c0a7e1794f44c546d742330dc793972" dependencies = [ "bindgen", "cc", "cmake", "dunce", "fs_extra", + "libc", "paste", ] [[package]] name = "aws-runtime" -version = "1.5.4" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee7643696e7fdd74c10f9eb42848a87fe469d35eae9c3323f80aa98f350baac" +checksum = "b5ac934720fbb46206292d2c75b57e67acfc56fe7dfd34fb9a02334af08409ea" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -1779,20 +1780,20 @@ dependencies = [ "percent-encoding", "pin-project-lite", "tracing", - "uuid 1.12.1", + "uuid 1.11.0", ] [[package]] name = "aws-sdk-kms" -version = "1.57.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b2cd8354dcccf1ae003100a41c7b862837cfd7af14a42b1e3ed98a8c3e487b" +checksum = "3c30f6fd5646b99d9b45ec3a0c22e67112c175b2383100c960d7ee39d96c8d96" dependencies = [ "aws-credential-types", "aws-runtime", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-json", + "aws-smithy-json 0.61.1", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", @@ -1806,15 +1807,15 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.56.0" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e057fdcb8842de9b83592a70f5b4da0ee10bc0ad278247da1425a742a444d7" +checksum = "05ca43a4ef210894f93096039ef1d6fa4ad3edfabb3be92b80908b9f2e4b4eab" dependencies = [ "aws-credential-types", "aws-runtime", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-json", + "aws-smithy-json 0.61.1", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", @@ -1828,15 +1829,15 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.57.1" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a120ade4a44691b3c5c2ff2fa61b14ed331fdc218397f61ab48d66593012ae2a" +checksum = "abaf490c2e48eed0bb8e2da2fb08405647bd7f253996e0f93b981958ea0f73b0" dependencies = [ "aws-credential-types", "aws-runtime", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-json", + "aws-smithy-json 0.61.1", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", @@ -1850,15 +1851,15 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.57.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115fd4fb663817ed595a5ee4f1649d7aacd861d47462323cb37576ce89271b93" +checksum = "b68fde0d69c8bfdc1060ea7da21df3e39f6014da316783336deff0a9ec28f4bf" dependencies = [ "aws-credential-types", "aws-runtime", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-json", + "aws-smithy-json 0.61.1", "aws-smithy-query", "aws-smithy-runtime", "aws-smithy-runtime-api", @@ -1873,9 +1874,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.7" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "690118821e46967b3c4501d67d7d52dd75106a9c54cf36cefa1985cedbe94e05" +checksum = "7d3820e0c08d0737872ff3c7c1f21ebbb6693d832312d6152bf18ef50a5471c2" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -1896,9 +1897,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.4" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa59d1327d8b5053c54bf2eaae63bf629ba9e904434d0835a28ed3c0ed0a614e" +checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" dependencies = [ "futures-util", "pin-project-lite", @@ -1907,9 +1908,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.12" +version = "0.60.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7809c27ad8da6a6a68c454e651d4962479e81472aa19ae99e59f9aba1f9713cc" +checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -1927,9 +1928,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.61.2" +version = "0.60.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-json" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623a51127f24c30776c8b374295f2df78d92517386f77ba30773f15a30ce1422" +checksum = "ee4e69cc50921eb913c6b662f8d909131bb3e6ad6cb6090d3a39b66fc5c52095" dependencies = [ "aws-smithy-types", ] @@ -1946,9 +1956,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.7" +version = "1.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f7050bbc7107a6c98a397a9fcd9413690c27fa718446967cf03b2d3ac517e" +checksum = "9f20685047ca9d6f17b994a07f629c813f08b5bce65523e47124879e60103d45" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -1990,9 +2000,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.12" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28f6feb647fb5e0d5b50f0472c19a7db9462b74e2fec01bb0b44eedcc834e97" +checksum = "4fbd94a32b3a7d55d3806fe27d98d3ad393050439dd05eb53ece36ec5e3d3510" dependencies = [ "base64-simd", "bytes", @@ -2022,9 +2032,9 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.4" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0df5a18c4f951c645300d365fec53a61418bcf4650f604f85fe2a665bfaa0c2" +checksum = "5221b91b3e441e6675310829fd8984801b772cb1546ef6c0e54dec9f1ac13fef" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -2199,7 +2209,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cexpr", "clang-sys", "itertools 0.11.0", @@ -2212,7 +2222,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.96", + "syn 2.0.90", "which 4.4.2", ] @@ -2242,9 +2252,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "arbitrary", "serde", @@ -2374,7 +2384,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -2497,7 +2507,7 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cast" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-chains", "alloy-consensus 0.9.2", @@ -2545,7 +2555,7 @@ dependencies = [ "rayon", "regex", "rpassword", - "rustls 0.23.21", + "rustls 0.23.19", "semver 1.0.23", "serde", "serde_json", @@ -2568,9 +2578,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.10" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ "jobserver", "libc", @@ -2598,6 +2608,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" @@ -2606,7 +2622,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chisel" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -2730,9 +2746,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.27" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -2740,9 +2756,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -2755,9 +2771,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.42" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a7e468e750fa4b6be660e8b5651ad47372e8fb114030b594c2d75d48c5ffd0" +checksum = "d9647a559c112175f17cf724dc72d3645680a883c58481332779192b0d8e7a01" dependencies = [ "clap", ] @@ -2774,14 +2790,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3103,9 +3119,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -3181,7 +3197,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "crossterm_winapi", "mio 1.0.3", "parking_lot", @@ -3202,9 +3218,9 @@ dependencies = [ [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" @@ -3247,7 +3263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3314,7 +3330,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3336,7 +3352,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3355,9 +3371,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.7.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" @@ -3397,7 +3413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.12.1", + "uuid 1.11.0", ] [[package]] @@ -3449,7 +3465,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3470,7 +3486,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3480,7 +3496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3501,7 +3517,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "unicode-xid", ] @@ -3616,7 +3632,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3641,7 +3657,7 @@ checksum = "8dc51d98e636f5e3b0759a39257458b22619cac7e96d932da6eeb052891bb67c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3825,7 +3841,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -3836,7 +3852,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -4222,7 +4238,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.3", + "miniz_oxide 0.8.0", ] [[package]] @@ -4254,7 +4270,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "forge" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-chains", "alloy-consensus 0.9.2", @@ -4321,7 +4337,7 @@ dependencies = [ "regex", "reqwest 0.12.9", "revm-inspectors", - "rustls 0.23.21", + "rustls 0.23.19", "semver 1.0.23", "serde", "serde_json", @@ -4350,7 +4366,7 @@ dependencies = [ [[package]] name = "forge-doc" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "derive_more", @@ -4373,7 +4389,7 @@ dependencies = [ [[package]] name = "forge-fmt" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "ariadne", @@ -4389,7 +4405,7 @@ dependencies = [ [[package]] name = "forge-script" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-chains", "alloy-consensus 0.9.2", @@ -4438,7 +4454,7 @@ dependencies = [ [[package]] name = "forge-script-sequence" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-network 0.9.2", "alloy-primitives", @@ -4457,7 +4473,7 @@ dependencies = [ [[package]] name = "forge-sol-macro-gen" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-json-abi", "alloy-sol-macro-expander", @@ -4468,12 +4484,12 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "forge-verify" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -4535,7 +4551,7 @@ dependencies = [ [[package]] name = "foundry-cheatcodes" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-consensus 0.9.2", "alloy-dyn-abi", @@ -4585,7 +4601,7 @@ dependencies = [ [[package]] name = "foundry-cheatcodes-common" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "revm", @@ -4593,7 +4609,7 @@ dependencies = [ [[package]] name = "foundry-cheatcodes-spec" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-sol-types", "foundry-macros", @@ -4604,7 +4620,7 @@ dependencies = [ [[package]] name = "foundry-cli" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-chains", "alloy-dyn-abi", @@ -4648,7 +4664,7 @@ dependencies = [ [[package]] name = "foundry-common" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-consensus 0.9.2", "alloy-contract", @@ -4703,7 +4719,7 @@ dependencies = [ [[package]] name = "foundry-common-fmt" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-consensus 0.9.2", "alloy-dyn-abi", @@ -4723,22 +4739,22 @@ dependencies = [ [[package]] name = "foundry-compilers" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0e0897aa7088fa1340d58c18a11b5be7f3a76e582c947a9bd86ee440e735b2" +checksum = "203e96bd596350ec8d9aedfca7eff573e9347e2b2fe50eedfbf78532dabe418e" dependencies = [ "alloy-json-abi", "alloy-primitives", "auto_impl", "derive_more", - "dirs 5.0.1", + "dirs 6.0.0", "dyn-clone", "foundry-compilers-artifacts", "foundry-compilers-core", "fs_extra", "futures-util", "home", - "itertools 0.14.0", + "itertools 0.13.0", "md-5", "path-slash", "rand 0.8.5", @@ -4754,15 +4770,15 @@ dependencies = [ "thiserror 2.0.11", "tokio", "tracing", - "winnow 0.6.24", + "winnow 0.7.1", "yansi", ] [[package]] name = "foundry-compilers-artifacts" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8956905969f3610dc048a7748a8b8ffcefd5d868aeebf5769012574f9ee36077" +checksum = "be8ba2ccf8a4bf7730b2ad2815984c1af8e5b8c492420f1cf1d26a8be29cc9e4" dependencies = [ "foundry-compilers-artifacts-solc", "foundry-compilers-artifacts-vyper", @@ -4770,9 +4786,9 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-solc" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233e93be9079903ed3e72970cf28e156f69772782281d08a4d97a3dfa0693675" +checksum = "5889eeb7d6729afbbbb1313b22e8f58aa909fcf38aa6b2f9c9b2443ca0765c59" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -4794,9 +4810,9 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-vyper" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19f32fc5479271e31f7977a36ff7c0359e3ae2884cb3aaab95a28d2087245c4" +checksum = "b01048f354b4e98bf5fb4810e0607c87d4b8cc7fe6305a42103ce192e33b2da7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -4809,9 +4825,9 @@ dependencies = [ [[package]] name = "foundry-compilers-core" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb8c5859a768b990f10bc17cd76e20d77965c352fd84822b5234345103c9dd88" +checksum = "079b80a4f188af9c273b081547d1a95a0a33f782851a99e21aa4eba06e47fa34" dependencies = [ "alloy-primitives", "cfg-if", @@ -4831,7 +4847,7 @@ dependencies = [ [[package]] name = "foundry-config" -version = "0.0.4" +version = "0.0.7" dependencies = [ "Inflector", "alloy-chains", @@ -4870,7 +4886,7 @@ dependencies = [ [[package]] name = "foundry-debugger" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "crossterm", @@ -4888,7 +4904,7 @@ dependencies = [ [[package]] name = "foundry-evm" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -4920,7 +4936,7 @@ dependencies = [ [[package]] name = "foundry-evm-abi" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -4933,7 +4949,7 @@ dependencies = [ [[package]] name = "foundry-evm-core" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-consensus 0.9.2", "alloy-dyn-abi", @@ -4969,7 +4985,7 @@ dependencies = [ [[package]] name = "foundry-evm-coverage" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "eyre", @@ -4984,7 +5000,7 @@ dependencies = [ [[package]] name = "foundry-evm-fuzz" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -5009,7 +5025,7 @@ dependencies = [ [[package]] name = "foundry-evm-traces" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -5062,7 +5078,7 @@ dependencies = [ [[package]] name = "foundry-linking" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "foundry-compilers", @@ -5075,17 +5091,17 @@ dependencies = [ [[package]] name = "foundry-macros" -version = "0.0.4" +version = "0.0.7" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "foundry-strategy-zksync" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -5114,7 +5130,7 @@ dependencies = [ [[package]] name = "foundry-test-utils" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "alloy-provider", @@ -5142,7 +5158,7 @@ dependencies = [ [[package]] name = "foundry-wallets" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-consensus 0.9.2", "alloy-dyn-abi", @@ -5173,7 +5189,7 @@ dependencies = [ [[package]] name = "foundry-zksync-compilers" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -5200,7 +5216,7 @@ dependencies = [ [[package]] name = "foundry-zksync-core" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-network 0.9.2", "alloy-primitives", @@ -5229,7 +5245,7 @@ dependencies = [ [[package]] name = "foundry-zksync-inspectors" -version = "0.0.4" +version = "0.0.7" dependencies = [ "alloy-primitives", "foundry-evm-core", @@ -5256,9 +5272,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.12.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c29c30684418547d476f0b48e84f4821639119c483b1eccd566c8cd0cd05f521" +checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -5370,7 +5386,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -5502,7 +5518,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror 1.0.69", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] @@ -5523,16 +5539,16 @@ dependencies = [ "smallvec", "thiserror 1.0.69", "unicode-bom", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] name = "gix-config-value" -version = "0.14.11" +version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11365144ef93082f3403471dbaa94cfe4b5e72743bdb9560719a251d439f4cee" +checksum = "49aaeef5d98390a3bcf9dbc6440b520b793d1bf3ed99317dc407b02be995b28e" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "bstr", "gix-path", "libc", @@ -5583,7 +5599,7 @@ version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "bstr", "gix-features", "gix-path", @@ -5626,14 +5642,14 @@ dependencies = [ "itoa", "smallvec", "thiserror 1.0.69", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] name = "gix-path" -version = "0.10.14" +version = "0.10.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40f12bb65a8299be0cfb90fe718e3be236b7a94b434877012980863a883a99f" +checksum = "afc292ef1a51e340aeb0e720800338c805975724c1dfbd243185452efd8645b7" dependencies = [ "bstr", "gix-trace", @@ -5660,16 +5676,16 @@ dependencies = [ "gix-validate", "memmap2", "thiserror 1.0.69", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] name = "gix-sec" -version = "0.10.11" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84dae13271f4313f8d60a166bf27e54c968c7c33e2ffd31c48cafe5da649875" +checksum = "a8b876ef997a955397809a2ec398d6a45b7a55b4918f2446344330f778d14fd6" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -5690,15 +5706,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c396a2036920c69695f760a65e7f2677267ccf483f25046977d87e4cb2665f7" +checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-utils" -version = "0.1.14" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08f24e03ac8916c478c8419d7d3c33393da9bb41fa4c24455d5406aeefd35f" +checksum = "ba427e3e9599508ed98a6ddf8ed05493db114564e338e41f6a996d2e4790335f" dependencies = [ "fastrand", "unicode-normalization", @@ -5706,9 +5722,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.9.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eaa01c3337d885617c0a42e92823922a2aea71f4caeace6fe87002bdcadbd90" +checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", "thiserror 2.0.11", @@ -5745,7 +5761,7 @@ dependencies = [ "gloo-utils", "http 0.2.12", "js-sys", - "pin-project 1.1.8", + "pin-project 1.1.7", "serde", "serde_json", "thiserror 1.0.69", @@ -5813,7 +5829,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.7.1", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -5832,7 +5848,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.2.0", - "indexmap 2.7.1", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -5851,18 +5867,17 @@ dependencies = [ [[package]] name = "handlebars" -version = "6.3.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6b224b95c1e668ac0270325ad563b2eef1469fbbb8959bc7c692c844b813d9" +checksum = "fd4ccde012831f9a071a637b0d4e31df31c0f6c525784b35ae76a9ac6bc1e315" dependencies = [ - "derive_builder", "log", "num-order", "pest", "pest_derive", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 1.0.69", ] [[package]] @@ -5987,7 +6002,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -6152,7 +6167,7 @@ dependencies = [ "hyper 1.5.1", "hyper-util", "log", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", @@ -6360,7 +6375,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -6478,7 +6493,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -6505,9 +6520,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "arbitrary", "equivalent", @@ -6536,9 +6551,9 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inferno" -version = "0.12.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692eda1cc790750b9f5a5e3921ef9c117fd5498b97cfacbc910693e5b29002dc" +checksum = "75a5d75fee4d36809e6b021e4b96b686e763d365ffdb03af2bd00786353f84fe" dependencies = [ "ahash", "itoa", @@ -6587,15 +6602,16 @@ dependencies = [ [[package]] name = "instability" -version = "0.3.7" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" +checksum = "b829f37dead9dc39df40c2d3376c179fdfd2ac771f53f55d3c30dc096a3c0c6e" dependencies = [ "darling 0.20.10", "indoc", + "pretty_assertions", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -6638,19 +6654,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.11.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" -version = "0.4.15" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -6703,29 +6719,25 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.27" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85348106ab244d90fe2d70faad939b71c5dad1258e5da9116e176064fc6c078" +checksum = "db69f08d4fb10524cacdb074c10b296299d71274ddbc830a8ee65666867002e9" dependencies = [ "jiff-tzdb-platform", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", "windows-sys 0.59.0", ] [[package]] name = "jiff-tzdb" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2cec2f5d266af45a071ece48b1fb89f3b00b2421ac3a5fe10285a6caaa60d3" +checksum = "91335e575850c5c4c673b9bd467b0e025f164ca59d0564f69d0c2ee0ffad4653" [[package]] name = "jiff-tzdb-platform" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a63c62e404e7b92979d2792352d885a7f8f83fd1d0d31eea582d77b2ceca697e" +checksum = "9835f0060a626fe59f160437bc725491a6af23133ea906500027d1bd2f8f4329" dependencies = [ "jiff-tzdb", ] @@ -6761,9 +6773,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -6810,8 +6822,8 @@ dependencies = [ "gloo-net", "http 1.2.0", "jsonrpsee-core", - "pin-project 1.1.8", - "rustls 0.23.21", + "pin-project 1.1.7", + "rustls 0.23.19", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -6840,7 +6852,7 @@ dependencies = [ "http-body-util", "jsonrpsee-types", "parking_lot", - "pin-project 1.1.8", + "pin-project 1.1.7", "rand 0.8.5", "rustc-hash 1.1.0", "serde", @@ -6866,7 +6878,7 @@ dependencies = [ "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-platform-verifier", "serde", "serde_json", @@ -6887,7 +6899,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -6905,7 +6917,7 @@ dependencies = [ "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "pin-project 1.1.8", + "pin-project 1.1.7", "route-recognizer", "serde", "serde_json", @@ -7128,7 +7140,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "libc", "redox_syscall", ] @@ -7147,9 +7159,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" @@ -7175,9 +7187,9 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.25" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" @@ -7199,7 +7211,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -7385,7 +7397,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -7396,7 +7408,7 @@ checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -7432,9 +7444,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ "adler2", ] @@ -7463,6 +7475,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "mockall" version = "0.13.1" @@ -7486,7 +7504,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -7523,9 +7541,9 @@ checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" [[package]] name = "native-tls" -version = "0.2.13" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ "libc", "log", @@ -7546,11 +7564,11 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "newtype-uuid" -version = "1.2.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3224f0e8be7c2a1ebc77ef9c3eecb90f55c6594399ee825de964526b3c9056" +checksum = "4c8781e2ef64806278a55ad223f0bc875772fd40e1fe6e73e8adbf027817229d" dependencies = [ - "uuid 1.12.1", + "uuid 1.11.0", ] [[package]] @@ -7575,15 +7593,27 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "nix" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases 0.1.1", + "libc", +] + [[package]] name = "nix" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", ] @@ -7624,7 +7654,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -7792,7 +7822,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -7804,7 +7834,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -7904,11 +7934,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.69" +version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" +checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -7925,20 +7955,20 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "openssl-probe" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" dependencies = [ "cc", "libc", @@ -8072,9 +8102,9 @@ dependencies = [ [[package]] name = "outref" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" +checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" [[package]] name = "overload" @@ -8149,7 +8179,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8232,7 +8262,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8291,7 +8321,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8312,7 +8342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.7.1", + "indexmap 2.7.0", ] [[package]] @@ -8327,22 +8357,22 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared 0.11.3", + "phf_shared 0.11.2", ] [[package]] name = "phf_codegen" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "phf_generator 0.11.3", - "phf_shared 0.11.3", + "phf_generator 0.11.2", + "phf_shared 0.11.2", ] [[package]] @@ -8357,25 +8387,25 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.3", + "phf_shared 0.11.2", "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "phf_generator 0.11.3", - "phf_shared 0.11.3", + "phf_generator 0.11.2", + "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8384,16 +8414,16 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "siphasher 0.3.11", + "siphasher", ] [[package]] name = "phf_shared" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ - "siphasher 1.0.1", + "siphasher", ] [[package]] @@ -8407,11 +8437,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ - "pin-project-internal 1.1.8", + "pin-project-internal 1.1.7", ] [[package]] @@ -8427,20 +8457,20 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "pin-project-lite" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -8480,15 +8510,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -8548,12 +8569,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.29" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8653,14 +8674,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -8673,23 +8694,23 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "version_check", "yansi", ] [[package]] name = "process-wrap" -version = "8.2.0" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d35f4dc9988d1326b065b4def5e950c3ed727aa03e3151b86cc9e2aec6b03f54" +checksum = "38ee68ae331824036479c84060534b18254c864fa73366c58d86db3b7b811619" dependencies = [ "futures 0.3.31", - "indexmap 2.7.1", - "nix 0.29.0", + "indexmap 2.7.0", + "nix 0.28.0", "tokio", "tracing", - "windows 0.59.0", + "windows 0.56.0", ] [[package]] @@ -8729,7 +8750,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8739,7 +8760,7 @@ source = "git+https://github.com/nbaztec/proptest?branch=v1.5.0-foundry-zksync#b dependencies = [ "bit-set", "bit-vec", - "bitflags 2.8.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand 0.8.5", @@ -8759,7 +8780,7 @@ checksum = "6ff7ff745a347b87471d859a377a9a404361e7efc2a971d73424a6d183c0fc77" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8799,7 +8820,7 @@ dependencies = [ "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.96", + "syn 2.0.90", "tempfile", ] @@ -8813,7 +8834,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8826,7 +8847,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -8925,7 +8946,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "memchr", "pulldown-cmark-escape", "unicase", @@ -8950,12 +8971,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed1a693391a16317257103ad06a88c6529ac640846021da7c435a06fffdacd7" dependencies = [ "chrono", - "indexmap 2.7.1", + "indexmap 2.7.0", "newtype-uuid", "quick-xml 0.37.1", "strip-ansi-escapes", "thiserror 2.0.11", - "uuid 1.12.1", + "uuid 1.11.0", ] [[package]] @@ -9005,7 +9026,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.0", - "rustls 0.23.21", + "rustls 0.23.19", "socket2", "thiserror 2.0.11", "tokio", @@ -9023,7 +9044,7 @@ dependencies = [ "rand 0.8.5", "ring", "rustc-hash 2.1.0", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-pki-types", "slab", "thiserror 2.0.11", @@ -9038,7 +9059,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", "once_cell", "socket2", @@ -9151,7 +9172,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cassowary", "compact_str", "crossterm", @@ -9207,7 +9228,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", ] [[package]] @@ -9353,7 +9374,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -9451,7 +9472,7 @@ dependencies = [ "alloy-eip7702 0.5.0", "alloy-primitives", "auto_impl", - "bitflags 2.8.0", + "bitflags 2.6.0", "bitvec 1.0.1", "c-kzg", "cfg-if", @@ -9640,11 +9661,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -9665,9 +9686,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.21" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "aws-lc-rs", "log", @@ -9713,7 +9734,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.2.0", + "security-framework 3.0.1", ] [[package]] @@ -9754,7 +9775,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -9816,7 +9837,7 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee1e066dc922e513bda599c6ccb5f3bb2b0ea5870a579448f2622993f0a9a2f" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "cfg-if", "clipboard-win", "fd-lock", @@ -9905,7 +9926,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -10052,7 +10073,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -10062,11 +10083,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.2.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -10075,9 +10096,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -10227,7 +10248,7 @@ dependencies = [ "thiserror 1.0.69", "time", "url", - "uuid 1.12.1", + "uuid 1.11.0", ] [[package]] @@ -10266,7 +10287,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -10277,7 +10298,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -10286,7 +10307,7 @@ version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.7.0", "itoa", "memchr", "ryu", @@ -10321,7 +10342,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -10384,7 +10405,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -10413,7 +10434,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -10602,9 +10623,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "similar" -version = "2.7.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" dependencies = [ "bstr", "unicode-segmentation", @@ -10612,9 +10633,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.6.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f08357795f0d604ea7d7130f22c74b03838c959bdb14adde3142aab4d18a293" +checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e" dependencies = [ "console", "similar", @@ -10622,13 +10643,13 @@ dependencies = [ [[package]] name = "simple_asn1" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint", "num-traits", - "thiserror 2.0.11", + "thiserror 1.0.69", "time", ] @@ -10638,12 +10659,6 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "slab" version = "0.4.9" @@ -10770,7 +10785,7 @@ checksum = "71d07263243b313296eca18f18eda3a190902dc3284bf67ceff29b8b54dac3e6" dependencies = [ "bumpalo", "index_vec", - "indexmap 2.7.1", + "indexmap 2.7.0", "parking_lot", "rayon", "rustc-hash 2.1.0", @@ -10789,7 +10804,7 @@ dependencies = [ "const-hex", "derive_builder", "dunce", - "itertools 0.14.0", + "itertools 0.13.0", "itoa", "lasso", "match_cfg", @@ -10813,7 +10828,7 @@ checksum = "970d7c774741f786d62cab78290e47d845b0b9c0c9d094a1642aced1d7946036" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -10823,9 +10838,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e1e2d07fae218aca1b4cca81216e5c9ad7822516d48a28f11e2eaa8ffa5b249" dependencies = [ "alloy-primitives", - "bitflags 2.8.0", + "bitflags 2.6.0", "bumpalo", - "itertools 0.14.0", + "itertools 0.13.0", "memchr", "num-bigint", "num-rational", @@ -10878,7 +10893,7 @@ dependencies = [ "thiserror 2.0.11", "tokio", "toml_edit 0.22.22", - "uuid 1.12.1", + "uuid 1.11.0", "zip", "zip-extract", ] @@ -10968,9 +10983,9 @@ dependencies = [ [[package]] name = "strip-ansi-escapes" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" dependencies = [ "vte", ] @@ -11006,7 +11021,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11030,29 +11045,29 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svm-rs" -version = "0.5.10" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2079b44b2dc358e0aa611988e806f92a0d1f174206566de745a4a422a8009c65" +checksum = "4aebac1b1ef2b46e2e2bdf3c09db304800f2a77c1fa902bd5231490203042be8" dependencies = [ "const-hex", "dirs 5.0.1", - "fs4 0.12.0", + "fs4 0.9.1", "reqwest 0.12.9", "semver 1.0.23", "serde", "serde_json", "sha2 0.10.8", "tempfile", - "thiserror 2.0.11", + "thiserror 1.0.69", "url", "zip", ] [[package]] name = "svm-rs-builds" -version = "0.5.10" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9379e64a7d61f2a288e97c4b7d80a5cdcc893f24a83b6ec0ec18ffd36d58c6e2" +checksum = "f2fa0f145894cb4d1c14446f08098ee5f21fc37ccbd1a7dd9dd355bbc806de3b" dependencies = [ "build_const", "const-hex", @@ -11074,9 +11089,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -11092,7 +11107,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11118,7 +11133,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11138,7 +11153,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "core-foundation 0.9.4", "system-configuration-sys 0.6.0", ] @@ -11269,7 +11284,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11280,7 +11295,7 @@ checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11400,9 +11415,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.43.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -11419,13 +11434,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11454,7 +11469,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.21", + "rustls 0.23.19", "tokio", ] @@ -11490,7 +11505,7 @@ checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -11527,7 +11542,7 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -11549,7 +11564,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.7.0", "toml_datetime", "winnow 0.5.40", ] @@ -11560,11 +11575,11 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.24", + "winnow 0.6.20", ] [[package]] @@ -11586,7 +11601,7 @@ dependencies = [ "hyper-timeout", "hyper-util", "percent-encoding", - "pin-project 1.1.8", + "pin-project 1.1.7", "prost 0.13.4", "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", @@ -11615,7 +11630,7 @@ dependencies = [ "futures-core", "futures-util", "indexmap 1.9.3", - "pin-project 1.1.8", + "pin-project 1.1.7", "pin-project-lite", "rand 0.8.5", "slab", @@ -11648,7 +11663,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "bytes", "futures-util", "http 1.2.0", @@ -11711,7 +11726,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -11860,7 +11875,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.23.21", + "rustls 0.23.19", "rustls-pki-types", "sha1", "thiserror 1.0.69", @@ -11935,9 +11950,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-linebreak" @@ -12086,9 +12101,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.12.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "serde", @@ -12096,9 +12111,9 @@ dependencies = [ [[package]] name = "valuable" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vcpkg" @@ -12159,7 +12174,7 @@ checksum = "6a511871dc5de990a3b2a0e715facfbc5da848c0c0395597a1415029fb7c250a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -12170,11 +12185,22 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" [[package]] name = "vte" -version = "0.14.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" dependencies = [ - "memchr", + "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +dependencies = [ + "proc-macro2", + "quote", ] [[package]] @@ -12213,35 +12239,34 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", - "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", @@ -12252,9 +12277,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12262,25 +12287,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-streams" @@ -12374,9 +12396,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -12476,22 +12498,22 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.58.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "windows-core 0.58.0", + "windows-core 0.56.0", "windows-targets 0.52.6", ] [[package]] name = "windows" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core 0.59.0", - "windows-targets 0.53.0", + "windows-core 0.58.0", + "windows-targets 0.52.6", ] [[package]] @@ -12505,72 +12527,71 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.58.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result 0.1.2", "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-implement 0.59.0", - "windows-interface 0.59.0", - "windows-result 0.3.0", - "windows-strings 0.3.0", - "windows-targets 0.53.0", + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", ] [[package]] name = "windows-implement" -version = "0.58.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "windows-implement" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "windows-interface" -version = "0.58.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] name = "windows-interface" -version = "0.59.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -12580,26 +12601,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result 0.2.0", - "windows-strings 0.1.0", + "windows-strings", "windows-targets 0.52.6", ] [[package]] name = "windows-result" -version = "0.2.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ "windows-targets 0.52.6", ] [[package]] name = "windows-result" -version = "0.3.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08106ce80268c4067c0571ca55a9b4e9516518eaa1a1fe9b37ca403ae1d1a34" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-targets 0.53.0", + "windows-targets 0.52.6", ] [[package]] @@ -12612,15 +12633,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-strings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b888f919960b42ea4e11c2f408fadb55f78a9f236d5eef084103c8ce52893491" -dependencies = [ - "windows-targets 0.53.0", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -12672,29 +12684,13 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", + "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -12707,12 +12703,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -12725,12 +12715,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -12743,24 +12727,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -12773,12 +12745,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -12791,12 +12757,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -12809,12 +12769,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -12828,25 +12782,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] [[package]] name = "winnow" -version = "0.6.24" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f" dependencies = [ "memchr", ] @@ -12948,7 +12905,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "synstructure", ] @@ -12970,7 +12927,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -12990,7 +12947,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", "synstructure", ] @@ -13011,7 +12968,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -13033,7 +12990,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -13048,7 +13005,7 @@ dependencies = [ "crossbeam-utils", "displaydoc", "flate2", - "indexmap 2.7.1", + "indexmap 2.7.0", "memchr", "thiserror 2.0.11", "zopfli", @@ -13203,7 +13160,7 @@ version = "0.132.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0769f7b27d8fb06e715da3290c575cac5d04d10a557faef180e847afce50ac4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "blake2", "ethereum-types 0.14.1", "k256 0.11.6", @@ -13218,7 +13175,7 @@ version = "0.141.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6be7bd5f0e0b61211f544147289640b4712715589d7f2fe5229d92a7a3ac64c0" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "blake2", "ethereum-types 0.14.1", "k256 0.13.4", @@ -13233,7 +13190,7 @@ version = "0.150.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bad437d4891536fdcc0054a3f04562c408817ff19d83b6c27569217692e6e74" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.6.0", "blake2", "ethereum-types 0.14.1", "k256 0.13.4", @@ -13297,7 +13254,7 @@ checksum = "e8312ab73d3caa55775bd531795b507fa8f76bd9dabfaeb0954fe43e8fc1323b" dependencies = [ "anyhow", "once_cell", - "pin-project 1.1.8", + "pin-project 1.1.7", "rand 0.8.5", "sha3 0.10.8", "thiserror 1.0.69", @@ -13479,7 +13436,7 @@ dependencies = [ "prost-reflect", "protox", "quote", - "syn 2.0.96", + "syn 2.0.90", ] [[package]] @@ -13613,7 +13570,7 @@ dependencies = [ "jsonrpsee", "pin-project-lite", "rlp", - "rustls 0.23.21", + "rustls 0.23.19", "serde", "serde_json", "thiserror 1.0.69", diff --git a/Cargo.toml b/Cargo.toml index 7ae931e155..49ddd0c862 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.0.4" # x-release-please-version +version = "0.0.7" # x-release-please-version edition = "2021" # Remember to update clippy.toml as well rust-version = "1.83" diff --git a/crates/anvil/tests/it/fork.rs b/crates/anvil/tests/it/fork.rs index 61adaa9335..e729240502 100644 --- a/crates/anvil/tests/it/fork.rs +++ b/crates/anvil/tests/it/fork.rs @@ -1306,8 +1306,8 @@ async fn test_base_fork_gas_limit() { .unwrap() .unwrap(); - assert!(api.gas_limit() >= uint!(132_000_000_U256)); - assert!(block.header.gas_limit >= 132_000_000_u64); + assert!(api.gas_limit() >= uint!(96_000_000_U256)); + assert!(block.header.gas_limit >= 96_000_000_u64); } // diff --git a/crates/cast/src/lib.rs b/crates/cast/src/lib.rs index 81f2b19484..20ae80245c 100644 --- a/crates/cast/src/lib.rs +++ b/crates/cast/src/lib.rs @@ -20,9 +20,6 @@ use alloy_rpc_types::{BlockId, BlockNumberOrTag, Filter, TransactionRequest}; use alloy_serde::WithOtherFields; use alloy_sol_types::sol; use alloy_transport::Transport; -use alloy_zksync::network::{ - transaction_request::TransactionRequest as ZkTransactionRequest, Zksync, -}; use base::{Base, NumberWithBase, ToBase}; use chrono::DateTime; use eyre::{Context, ContextCompat, OptionExt, Result}; @@ -60,6 +57,9 @@ mod rlp_converter; use rlp_converter::Item; +pub mod zksync; +pub use zksync::*; + #[macro_use] extern crate foundry_common; @@ -73,59 +73,6 @@ sol! { } } -pub struct ZkCast { - provider: Z, - inner: Cast, -} - -impl AsRef> for ZkCast -where - P: Provider, - T: Transport + Clone, - Z: Provider, -{ - fn as_ref(&self) -> &Cast { - &self.inner - } -} - -impl ZkCast -where - P: Provider, - T: Transport + Clone, - Z: Provider, -{ - /// Creates a new ZkCast instance from the provided client and Cast instance - /// - /// # Example - /// - /// ``` - /// use alloy_provider::{network::AnyNetwork, ProviderBuilder, RootProvider}; - /// use cast::Cast; - /// - /// # async fn foo() -> eyre::Result<()> { - /// let provider = - /// ProviderBuilder::<_, _, AnyNetwork>::default().on_builtin("http://localhost:8545").await?; - /// let cast = Cast::new(provider); - /// let zk_provider = - /// ProviderBuilder::<_, _, Zksync>::default().on_builtin("http://localhost:8011").await?; - /// let zk_cast = ZkCast::new(provider, cast); - /// # Ok(()) - /// # } - /// ``` - pub fn new(provider: Z, cast: Cast) -> Self { - Self { provider, inner: cast } - } - - pub async fn send_zk( - &self, - tx: ZkTransactionRequest, - ) -> Result> { - let res = self.provider.send_transaction(tx).await?; - - Ok(res) - } -} pub struct Cast { provider: P, transport: PhantomData, diff --git a/crates/cast/src/zksync.rs b/crates/cast/src/zksync.rs new file mode 100644 index 0000000000..14234adf69 --- /dev/null +++ b/crates/cast/src/zksync.rs @@ -0,0 +1,65 @@ +//! Contains zksync specific logic for foundry's `cast` functionality + +use alloy_network::AnyNetwork; +use alloy_provider::{PendingTransactionBuilder, Provider}; +use alloy_transport::Transport; +use alloy_zksync::network::{ + transaction_request::TransactionRequest as ZkTransactionRequest, Zksync, +}; +use eyre::Result; + +use crate::Cast; + +pub struct ZkCast { + provider: Z, + inner: Cast, +} + +impl AsRef> for ZkCast +where + P: Provider, + T: Transport + Clone, + Z: Provider, +{ + fn as_ref(&self) -> &Cast { + &self.inner + } +} + +impl ZkCast +where + P: Provider, + T: Transport + Clone, + Z: Provider, +{ + /// Creates a new ZkCast instance from the provided client and Cast instance + /// + /// # Example + /// + /// ``` + /// use alloy_provider::{network::AnyNetwork, ProviderBuilder, RootProvider}; + /// use cast::Cast; + /// + /// # async fn foo() -> eyre::Result<()> { + /// let provider = + /// ProviderBuilder::<_, _, AnyNetwork>::default().on_builtin("http://localhost:8545").await?; + /// let cast = Cast::new(provider); + /// let zk_provider = + /// ProviderBuilder::<_, _, Zksync>::default().on_builtin("http://localhost:8011").await?; + /// let zk_cast = ZkCast::new(provider, cast); + /// # Ok(()) + /// # } + /// ``` + pub fn new(provider: Z, cast: Cast) -> Self { + Self { provider, inner: cast } + } + + pub async fn send_zk( + &self, + tx: ZkTransactionRequest, + ) -> Result> { + let res = self.provider.send_transaction(tx).await?; + + Ok(res) + } +} diff --git a/crates/common/src/compile.rs b/crates/common/src/compile.rs index bd276157e4..a2dcfdf3ad 100644 --- a/crates/common/src/compile.rs +++ b/crates/common/src/compile.rs @@ -19,12 +19,8 @@ use foundry_compilers::{ solc::SolcSettings, Artifact, Project, ProjectBuilder, ProjectCompileOutput, ProjectPathsConfig, SolcConfig, }; -use foundry_zksync_compilers::compilers::{ - artifact_output::zk::ZkArtifactOutput, - zksolc::{ZkSolc, ZkSolcCompiler}, -}; - use num_format::{Locale, ToFormattedString}; + use std::{ collections::BTreeMap, fmt::Display, @@ -33,6 +29,8 @@ use std::{ time::Instant, }; +mod zksync; + /// Builder type to configure how to compile a project. /// /// This is merely a wrapper for [`Project::compile()`] which also prints to stdout depending on its @@ -137,13 +135,6 @@ impl ProjectCompiler { self } - /// Enables zksync contract sizes. - #[inline] - pub fn zksync_sizes(mut self) -> Self { - self.zksync = true; - self - } - /// Compiles the project. pub fn compile>( mut self, @@ -309,175 +300,6 @@ impl ProjectCompiler { } } } - - /// Compiles the project. - pub fn zksync_compile( - self, - project: &Project, - ) -> Result> { - // TODO: Avoid process::exit - if !project.paths.has_input_files() && self.files.is_empty() { - sh_println!("Nothing to compile")?; - // nothing to do here - std::process::exit(0); - } - - // Taking is fine since we don't need these in `compile_with`. - //let filter = std::mem::take(&mut self.filter); - - // We need to clone files since we use them in `compile_with` - // for filtering artifacts in missing libraries detection - let files = self.files.clone(); - - { - let zksolc_version = ZkSolc::get_version_for_path(&project.compiler.zksolc)?; - Report::new(SpinnerReporter::spawn_with(format!("Using zksolc-{zksolc_version}"))); - } - self.zksync_compile_with(|| { - let files_to_compile = - if !files.is_empty() { files } else { project.paths.input_files() }; - let sources = Source::read_all(files_to_compile)?; - foundry_compilers::project::ProjectCompiler::with_sources(project, sources)? - .compile() - .map_err(Into::into) - }) - } - - #[instrument(target = "forge::compile", skip_all)] - fn zksync_compile_with( - self, - f: F, - ) -> Result> - where - F: FnOnce() -> Result>, - { - let quiet = self.quiet.unwrap_or(false); - let bail = self.bail.unwrap_or(true); - #[allow(clippy::collapsible_else_if)] - let reporter = if quiet { - Report::new(NoReporter::default()) - } else { - if std::io::stdout().is_terminal() { - Report::new(SpinnerReporter::spawn_with("Compiling (zksync)")) - } else { - Report::new(BasicStdoutReporter::default()) - } - }; - - let output = foundry_compilers::report::with_scoped(&reporter, || { - tracing::debug!("compiling project"); - - let timer = std::time::Instant::now(); - let r = f(); - let elapsed = timer.elapsed(); - - tracing::debug!("finished compiling in {:.3}s", elapsed.as_secs_f64()); - r - })?; - - // need to drop the reporter here, so that the spinner terminates - drop(reporter); - - if bail && output.has_compiler_errors() { - eyre::bail!("{output}") - } - - if !quiet { - if output.is_unchanged() { - sh_println!("No files changed, compilation skipped")?; - } else { - // print the compiler output / warnings - sh_println!("{output}")?; - } - - self.zksync_handle_output(&output)?; - } - - Ok(output) - } - - /// If configured, this will print sizes or names - fn zksync_handle_output( - &self, - output: &ProjectCompileOutput, - ) -> Result<()> { - let print_names = self.print_names.unwrap_or(false); - let print_sizes = self.print_sizes.unwrap_or(false); - - // print any sizes or names - if print_names { - let mut artifacts: BTreeMap<_, Vec<_>> = BTreeMap::new(); - for (name, (_, version)) in output.versioned_artifacts() { - artifacts.entry(version).or_default().push(name); - } - for (version, names) in artifacts { - let _ = sh_println!( - " compiler version: {}.{}.{}", - version.major, - version.minor, - version.patch - ); - for name in names { - let _ = sh_println!(" - {name}"); - } - } - } - - if print_sizes { - // add extra newline if names were already printed - if print_names && !shell::is_json() { - let _ = sh_println!(); - } - - let mut size_report = SizeReport { - report_kind: report_kind(), - contracts: BTreeMap::new(), - zksync: self.zksync, - }; - - let artifacts: BTreeMap<_, _> = output - .artifact_ids() - .filter(|(id, _)| { - // filter out forge-std specific contracts - !id.source.to_string_lossy().contains("/forge-std/src/") - }) - .map(|(id, artifact)| (id.name, artifact)) - .collect(); - - for (name, artifact) in artifacts { - let runtime_size = contract_size(artifact, false).unwrap_or_default(); - let init_size = contract_size(artifact, true).unwrap_or_default(); - - let is_dev_contract = artifact - .abi - .as_ref() - .map(|abi| { - abi.functions().any(|f| { - f.test_function_kind().is_known() || - matches!(f.name.as_str(), "IS_TEST" | "IS_SCRIPT") - }) - }) - .unwrap_or(false); - size_report - .contracts - .insert(name, ContractInfo { runtime_size, init_size, is_dev_contract }); - } - - let _ = sh_println!("{size_report}"); - - // TODO: avoid process::exit - // exit with error if any contract exceeds the size limit, excluding test contracts. - if size_report.exceeds_runtime_size_limit() { - std::process::exit(1); - } - - // Check size limits only if not ignoring EIP-3860 - if !self.ignore_eip_3860 && size_report.exceeds_initcode_size_limit() { - std::process::exit(1); - } - } - Ok(()) - } } // https://eips.ethereum.org/EIPS/eip-170 @@ -486,9 +308,6 @@ const CONTRACT_RUNTIME_SIZE_LIMIT: usize = 24576; // https://eips.ethereum.org/EIPS/eip-3860 const CONTRACT_INITCODE_SIZE_LIMIT: usize = 49152; -// https://docs.zksync.io/build/developer-reference/ethereum-differences/contract-deployment#contract-size-limit-and-format-of-bytecode-hash -const ZKSYNC_CONTRACT_SIZE_LIMIT: usize = 450999; - /// Contracts with info about their size pub struct SizeReport { /// What kind of report to generate. @@ -523,7 +342,7 @@ impl SizeReport { /// Returns true if any contract exceeds the runtime size limit, excluding dev contracts. pub fn exceeds_runtime_size_limit(&self) -> bool { if self.zksync { - self.max_runtime_size() > ZKSYNC_CONTRACT_SIZE_LIMIT + self.max_runtime_size() > zksync::ZKSYNC_CONTRACT_SIZE_LIMIT } else { self.max_runtime_size() > CONTRACT_RUNTIME_SIZE_LIMIT } @@ -532,7 +351,7 @@ impl SizeReport { /// Returns true if any contract exceeds the initcode size limit, excluding dev contracts. pub fn exceeds_initcode_size_limit(&self) -> bool { if self.zksync { - self.max_init_size() > ZKSYNC_CONTRACT_SIZE_LIMIT + self.max_init_size() > zksync::ZKSYNC_CONTRACT_SIZE_LIMIT } else { self.max_init_size() > CONTRACT_INITCODE_SIZE_LIMIT } @@ -595,23 +414,7 @@ impl SizeReport { .filter(|(_, c)| !c.is_dev_contract && (c.runtime_size > 0 || c.init_size > 0)); for (name, contract) in contracts { let ((runtime_margin, runtime_color), (init_margin, init_color)) = if self.zksync { - let runtime_margin = - ZKSYNC_CONTRACT_SIZE_LIMIT as isize - contract.runtime_size as isize; - let init_margin = ZKSYNC_CONTRACT_SIZE_LIMIT as isize - contract.init_size as isize; - - let runtime_color = match contract.runtime_size { - 0..=329999 => Color::Reset, - 330000..=ZKSYNC_CONTRACT_SIZE_LIMIT => Color::Yellow, - _ => Color::Red, - }; - - let init_color = match contract.init_size { - 0..=329999 => Color::Reset, - 330000..=ZKSYNC_CONTRACT_SIZE_LIMIT => Color::Yellow, - _ => Color::Red, - }; - - ((runtime_margin, runtime_color), (init_margin, init_color)) + Self::zk_limits_table_format(contract) } else { let runtime_margin = CONTRACT_RUNTIME_SIZE_LIMIT as isize - contract.runtime_size as isize; diff --git a/crates/common/src/compile/zksync.rs b/crates/common/src/compile/zksync.rs new file mode 100644 index 0000000000..7d7a741a50 --- /dev/null +++ b/crates/common/src/compile/zksync.rs @@ -0,0 +1,235 @@ +use std::{collections::BTreeMap, io::IsTerminal}; + +use comfy_table::Color; +use eyre::Result; +use foundry_compilers::{ + artifacts::Source, + report::{BasicStdoutReporter, NoReporter, Report}, + Project, ProjectCompileOutput, +}; +use foundry_zksync_compilers::compilers::{ + artifact_output::zk::ZkArtifactOutput, + zksolc::{ZkSolc, ZkSolcCompiler, ZKSOLC_UNSUPPORTED_VERSIONS}, +}; + +use crate::{reports::report_kind, shell, term::SpinnerReporter, TestFunctionExt}; + +use super::{contract_size, ContractInfo, ProjectCompiler, SizeReport}; + +// https://docs.zksync.io/build/developer-reference/ethereum-differences/contract-deployment#contract-size-limit-and-format-of-bytecode-hash +pub(super) const ZKSYNC_CONTRACT_SIZE_LIMIT: usize = 450999; + +impl ProjectCompiler { + /// Enables zksync contract sizes. + #[inline] + pub fn zksync_sizes(mut self) -> Self { + self.zksync = true; + self + } + + /// Compiles the project. + pub fn zksync_compile( + self, + project: &Project, + ) -> Result> { + // TODO: Avoid process::exit + if !project.paths.has_input_files() && self.files.is_empty() { + sh_println!("Nothing to compile")?; + // nothing to do here + std::process::exit(0); + } + + // Taking is fine since we don't need these in `compile_with`. + //let filter = std::mem::take(&mut self.filter); + + // We need to clone files since we use them in `compile_with` + // for filtering artifacts in missing libraries detection + let files = self.files.clone(); + + { + let zksolc_current_version = project.settings.zksolc_version_ref(); + let zksolc_min_supported_version = ZkSolc::zksolc_minimum_supported_version(); + let zksolc_latest_supported_version = ZkSolc::zksolc_latest_supported_version(); + if ZKSOLC_UNSUPPORTED_VERSIONS.contains(zksolc_current_version) { + sh_warn!("Compiling with zksolc v{zksolc_current_version} which is not supported and may lead to unexpected errors. Specifying an unsupported version is deprecated and will return an error in future versions of foundry-zksync.")?; + } + if zksolc_current_version < &zksolc_min_supported_version { + sh_warn!("Compiling with zksolc v{zksolc_current_version} which is not supported and may lead to unexpected errors. Specifying an unsupported version is deprecated and will return an error in future versions of foundry-zksync. Minimum version supported is v{zksolc_min_supported_version}")?; + } + if zksolc_current_version > &zksolc_latest_supported_version { + sh_warn!("Compiling with zksolc v{zksolc_current_version} which is still not supported and may lead to unexpected errors. Specifying an unsupported version is deprecated and will return an error in future versions of foundry-zksync. Latest version supported is v{zksolc_latest_supported_version}")?; + } + Report::new(SpinnerReporter::spawn_with(format!( + "Using zksolc-{zksolc_current_version}" + ))); + } + + self.zksync_compile_with(|| { + let files_to_compile = + if !files.is_empty() { files } else { project.paths.input_files() }; + let sources = Source::read_all(files_to_compile)?; + foundry_compilers::project::ProjectCompiler::with_sources(project, sources)? + .compile() + .map_err(Into::into) + }) + } + + #[instrument(target = "forge::compile", skip_all)] + fn zksync_compile_with( + self, + f: F, + ) -> Result> + where + F: FnOnce() -> Result>, + { + let quiet = self.quiet.unwrap_or(false); + let bail = self.bail.unwrap_or(true); + #[allow(clippy::collapsible_else_if)] + let reporter = if quiet { + Report::new(NoReporter::default()) + } else { + if std::io::stdout().is_terminal() { + Report::new(SpinnerReporter::spawn_with("Compiling (zksync)")) + } else { + Report::new(BasicStdoutReporter::default()) + } + }; + + let output = foundry_compilers::report::with_scoped(&reporter, || { + tracing::debug!("compiling project"); + + let timer = std::time::Instant::now(); + let r = f(); + let elapsed = timer.elapsed(); + + tracing::debug!("finished compiling in {:.3}s", elapsed.as_secs_f64()); + r + })?; + + // need to drop the reporter here, so that the spinner terminates + drop(reporter); + + if bail && output.has_compiler_errors() { + eyre::bail!("{output}") + } + + if !quiet { + if output.is_unchanged() { + sh_println!("No files changed, compilation skipped")?; + } else { + // print the compiler output / warnings + sh_println!("{output}")?; + } + + self.zksync_handle_output(&output)?; + } + + Ok(output) + } + + /// If configured, this will print sizes or names + fn zksync_handle_output( + &self, + output: &ProjectCompileOutput, + ) -> Result<()> { + let print_names = self.print_names.unwrap_or(false); + let print_sizes = self.print_sizes.unwrap_or(false); + + // print any sizes or names + if print_names { + let mut artifacts: BTreeMap<_, Vec<_>> = BTreeMap::new(); + for (name, (_, version)) in output.versioned_artifacts() { + artifacts.entry(version).or_default().push(name); + } + for (version, names) in artifacts { + let _ = sh_println!( + " compiler version: {}.{}.{}", + version.major, + version.minor, + version.patch + ); + for name in names { + let _ = sh_println!(" - {name}"); + } + } + } + + if print_sizes { + // add extra newline if names were already printed + if print_names && !shell::is_json() { + let _ = sh_println!(); + } + + let mut size_report = SizeReport { + report_kind: report_kind(), + contracts: BTreeMap::new(), + zksync: self.zksync, + }; + + let artifacts: BTreeMap<_, _> = output + .artifact_ids() + .filter(|(id, _)| { + // filter out forge-std specific contracts + !id.source.to_string_lossy().contains("/forge-std/src/") + }) + .map(|(id, artifact)| (id.name, artifact)) + .collect(); + + for (name, artifact) in artifacts { + let runtime_size = contract_size(artifact, false).unwrap_or_default(); + let init_size = contract_size(artifact, true).unwrap_or_default(); + + let is_dev_contract = artifact + .abi + .as_ref() + .map(|abi| { + abi.functions().any(|f| { + f.test_function_kind().is_known() || + matches!(f.name.as_str(), "IS_TEST" | "IS_SCRIPT") + }) + }) + .unwrap_or(false); + size_report + .contracts + .insert(name, ContractInfo { runtime_size, init_size, is_dev_contract }); + } + + let _ = sh_println!("{size_report}"); + + // TODO: avoid process::exit + // exit with error if any contract exceeds the size limit, excluding test contracts. + if size_report.exceeds_runtime_size_limit() { + std::process::exit(1); + } + + // Check size limits only if not ignoring EIP-3860 + if !self.ignore_eip_3860 && size_report.exceeds_initcode_size_limit() { + std::process::exit(1); + } + } + Ok(()) + } +} + +impl SizeReport { + pub(super) fn zk_limits_table_format( + contract: &ContractInfo, + ) -> ((isize, Color), (isize, Color)) { + let runtime_margin = ZKSYNC_CONTRACT_SIZE_LIMIT as isize - contract.runtime_size as isize; + let init_margin = ZKSYNC_CONTRACT_SIZE_LIMIT as isize - contract.init_size as isize; + + let runtime_color = match contract.runtime_size { + 0..=329999 => Color::Reset, + 330000..=ZKSYNC_CONTRACT_SIZE_LIMIT => Color::Yellow, + _ => Color::Red, + }; + + let init_color = match contract.init_size { + 0..=329999 => Color::Reset, + 330000..=ZKSYNC_CONTRACT_SIZE_LIMIT => Color::Yellow, + _ => Color::Red, + }; + + ((runtime_margin, runtime_color), (init_margin, init_color)) + } +} diff --git a/crates/config/README.md b/crates/config/README.md index 6caa0d408e..0d3eafbcf0 100644 --- a/crates/config/README.md +++ b/crates/config/README.md @@ -157,7 +157,7 @@ no_storage_caching = false # Whether to store the referenced sources in the metadata as literal data. use_literal_content = false # use ipfs method to generate the metadata hash, solc's default. -# To not include the metadata hash, to allow for deterministic code: https://docs.soliditylang.org/en/latest/metadata.html, use "none" +# To not include the metadata hash, to allow for deterministic code: https://docs.soliditylang.org/en/latest/metadata.html, use "none" (evm compilation only, field will be ignored for zksync) bytecode_hash = "ipfs" # Whether to append the CBOR-encoded metadata file. cbor_metadata = true @@ -228,11 +228,12 @@ The `zksync` settings must be prefixed with the profile they correspond to: compile = false # Enable zkVM at startup, needs `compile = true` to have effect startup = true -# By default the latest version is used +# By default the latest supported version is used zksolc = "1.5.0" # By default the corresponding solc patched version from matter-labs is used solc_path = "./solc-0.8.23-1.0.1" -bytecode_hash = "none" +# By default, no value is passed and the default for the compiler (keccak256) will be used +hash_type = "none" # Allow compiler to use mode 'z' if contracts won't fit in the EraVM bytecode # size limitations fallback_oz = false diff --git a/crates/config/src/zksync.rs b/crates/config/src/zksync.rs index 1997aad7d1..34209151a2 100644 --- a/crates/config/src/zksync.rs +++ b/crates/config/src/zksync.rs @@ -46,7 +46,11 @@ pub struct ZkSyncConfig { /// solc path to use along the zksolc compiler pub solc_path: Option, - /// Whether to include the metadata hash for zksolc compiled bytecode. + /// Hash type for the the metadata hash appended by zksolc to the compiled bytecode. + pub hash_type: Option, + + /// Hash type for the the metadata hash appended by zksolc to the compiled bytecode. + /// Deprecated in favor of `hash_type` pub bytecode_hash: Option, /// Whether to try to recompile with -Oz if the bytecode is too large. @@ -83,6 +87,7 @@ impl Default for ZkSyncConfig { startup: false, zksolc: Default::default(), solc_path: Default::default(), + hash_type: Default::default(), bytecode_hash: Default::default(), fallback_oz: Default::default(), enable_eravm_extensions: Default::default(), @@ -114,7 +119,8 @@ impl ZkSyncConfig { libraries: Libraries, evm_version: EvmVersion, via_ir: bool, - ) -> ZkSolcSettings { + offline: bool, + ) -> Result { let optimizer = Optimizer { enabled: Some(self.optimizer), mode: Some(self.optimizer_mode), @@ -124,11 +130,11 @@ impl ZkSyncConfig { jump_table_density_threshold: None, }; - let zk_settings = ZkSettings { + let settings = ZkSettings { libraries, optimizer, evm_version: Some(evm_version), - metadata: Some(SettingsMetadata { bytecode_hash: self.bytecode_hash }), + metadata: Some(SettingsMetadata::new(self.hash_type.or(self.bytecode_hash))), via_ir: Some(via_ir), // Set in project paths. remappings: Vec::new(), @@ -146,8 +152,22 @@ impl ZkSyncConfig { suppressed_errors: self.suppressed_errors.clone(), }; + let zksolc_path = if let Some(path) = config_ensure_zksolc(self.zksolc.as_ref(), offline)? { + path + } else if !offline { + let default_version = semver::Version::new(1, 5, 11); + let mut zksolc = ZkSolc::find_installed_version(&default_version)?; + if zksolc.is_none() { + ZkSolc::blocking_install(&default_version)?; + zksolc = ZkSolc::find_installed_version(&default_version)?; + } + zksolc.unwrap_or_else(|| panic!("Could not install zksolc v{default_version}")) + } else { + "zksolc".into() + }; + // `cli_settings` get set from `Project` values when building `ZkSolcVersionedInput` - ZkSolcSettings { settings: zk_settings, cli_settings: CliSettings::default() } + ZkSolcSettings::new_from_path(settings, CliSettings::default(), zksolc_path) } } @@ -163,34 +183,10 @@ pub fn config_zksolc_settings(config: &Config) -> Result return Err(SolcError::msg(format!("Failed to parse libraries: {e}"))), }; - Ok(config.zksync.settings(libraries, config.evm_version, config.via_ir)) -} - -/// Return the configured `zksolc` compiler -/// -/// If not `offline`, will install the default version automatically -/// Will fallback to `zksolc` present in the environment -pub fn config_zksolc_compiler(config: &Config) -> Result { - let zksolc = if let Some(zksolc) = - config_ensure_zksolc(config.zksync.zksolc.as_ref(), config.offline)? - { - zksolc - } else if !config.offline { - let default_version = semver::Version::new(1, 5, 11); - let mut zksolc = ZkSolc::find_installed_version(&default_version)?; - if zksolc.is_none() { - ZkSolc::blocking_install(&default_version)?; - zksolc = ZkSolc::find_installed_version(&default_version)?; - } - zksolc.unwrap_or_else(|| panic!("Could not install zksolc v{default_version}")) - } else { - "zksolc".into() - }; - - Ok(ZkSolcCompiler { zksolc, solc: config_solc_compiler(config)? }) + config.zksync.settings(libraries, config.evm_version, config.via_ir, config.offline) } -/// Create a new zkSync project +/// Create a new ZKsync project pub fn config_create_project( config: &Config, cached: bool, @@ -217,7 +213,7 @@ pub fn config_create_project( builder = builder.sparse_output(filter); } - let zksolc_compiler = config_zksolc_compiler(config)?; + let zksolc_compiler = ZkSolcCompiler { solc: config_solc_compiler(config)? }; let project = builder.build(zksolc_compiler)?; diff --git a/crates/forge/bin/cmd/create.rs b/crates/forge/bin/cmd/create.rs index 34713bc771..a5662e09c4 100644 --- a/crates/forge/bin/cmd/create.rs +++ b/crates/forge/bin/cmd/create.rs @@ -2,28 +2,22 @@ use crate::cmd::install; use alloy_chains::Chain; use alloy_dyn_abi::{DynSolValue, JsonAbiExt, Specifier}; use alloy_json_abi::{Constructor, JsonAbi}; -use alloy_network::{ - AnyNetwork, AnyTransactionReceipt, EthereumWallet, Network, ReceiptResponse, TransactionBuilder, -}; +use alloy_network::{AnyNetwork, AnyTransactionReceipt, EthereumWallet, TransactionBuilder}; use alloy_primitives::{hex, Address, Bytes}; use alloy_provider::{PendingTransactionError, Provider, ProviderBuilder}; use alloy_rpc_types::TransactionRequest; use alloy_serde::WithOtherFields; use alloy_signer::Signer; use alloy_transport::{Transport, TransportError}; -use alloy_zksync::{ - network::{unsigned_tx::eip712::PaymasterParams, Zksync}, - wallet::ZksyncWallet, -}; use clap::{Parser, ValueHint}; use eyre::{Context, Result}; use forge_verify::{zk_provider::CompilerVerificationContext, RetryArgs, VerifierArgs, VerifyArgs}; use foundry_cli::{ opts::{BuildOpts, EthereumOpts, EtherscanOpts, TransactionOpts}, - utils::{self, read_constructor_args_file, remove_contract, remove_zk_contract, LoadConfig}, + utils::{self, read_constructor_args_file, remove_contract, LoadConfig}, }; use foundry_common::{ - compile::{self, ProjectCompiler}, + compile::{self}, fmt::parse_tokens, shell, }; @@ -38,16 +32,10 @@ use foundry_config::{ }, merge_impl_figment_convert, Config, }; -use foundry_zksync_compilers::compilers::artifact_output::zk::ZkContractArtifact; -use foundry_zksync_core::convert::ConvertH160; use serde_json::json; -use std::{ - borrow::Borrow, - collections::{HashSet, VecDeque}, - marker::PhantomData, - path::PathBuf, - sync::Arc, -}; +use std::{borrow::Borrow, marker::PhantomData, path::PathBuf, sync::Arc}; + +mod zksync; merge_impl_figment_convert!(CreateArgs, build, eth); @@ -114,25 +102,14 @@ pub struct CreateArgs { #[command(flatten)] retry: RetryArgs, - /// Gas per pubdata - #[clap(long = "zk-gas-per-pubdata", value_name = "GAS_PER_PUBDATA")] - pub zk_gas_per_pubdata: Option, -} - -#[derive(Debug, Default)] -/// Data used to deploy a contract on zksync -pub struct ZkSyncData { - #[allow(dead_code)] - bytecode: Vec, - factory_deps: Vec>, - paymaster_params: Option, + #[command(flatten)] + pub zksync: zksync::ZkCreateArgs, } impl CreateArgs { /// Executes the command to create a contract pub async fn run(mut self) -> Result<()> { let mut config = self.load_config()?; - let timeout = config.transaction_timeout; // Install missing dependencies. if install::install_missing_dependencies(&mut config) && config.auto_detect_remappings { // need to re-configure here to also catch additional remappings @@ -142,175 +119,8 @@ impl CreateArgs { // Find Project & Compile let project = config.project()?; - let zksync = self.build.compiler.zk.enabled(); - if zksync { - let paymaster_params = - if let Some(paymaster_address) = self.build.compiler.zk.paymaster_address { - Some(PaymasterParams { - paymaster: paymaster_address, - paymaster_input: self - .build - .compiler - .zk - .paymaster_input - .clone() - .unwrap_or_default(), - }) - } else { - None - }; - let target_path = if let Some(ref mut path) = self.contract.path { - canonicalize(project.root().join(path))? - } else { - project.find_contract_path(&self.contract.name)? - }; - - let config = self.load_config()?; - let zk_project = - foundry_config::zksync::config_create_project(&config, config.cache, false)?; - let zk_compiler = ProjectCompiler::new().files([target_path.clone()]); - let mut zk_output = zk_compiler.zksync_compile(&zk_project)?; - - let (artifact, id) = - remove_zk_contract(&mut zk_output, &target_path, &self.contract.name)?; - - let ZkContractArtifact { bytecode, abi, factory_dependencies, .. } = &artifact; - - let abi = abi.clone().expect("Abi not found"); - let bin = bytecode.as_ref().expect("Bytecode not found"); - - let bytecode = match bin.object() { - BytecodeObject::Bytecode(bytes) => bytes.to_vec(), - _ => { - let link_refs = bin - .missing_libraries - .iter() - .map(|library| { - let mut parts = library.split(':'); - let path = parts.next().unwrap(); - let name = parts.next().unwrap(); - format!("\t{name}: {path}") - }) - .collect::>() - .into_iter() - .collect::>() - .join("\n"); - eyre::bail!("Dynamic linking not supported in `create` command - deploy the following library contracts first, then provide the address to link at compile time\n{}", link_refs) - } - }; - - // Add arguments to constructor - let config = self.eth.load_config()?; - let provider = utils::get_provider_zksync(&config)?; - let params = match abi.constructor { - Some(ref v) => { - let constructor_args = - if let Some(ref constructor_args_path) = self.constructor_args_path { - read_constructor_args_file(constructor_args_path.to_path_buf())? - } else { - self.constructor_args.clone() - }; - self.parse_constructor_args(v, &constructor_args)? - } - None => vec![], - }; - - // respect chain, if set explicitly via cmd args - let chain_id = if let Some(chain_id) = self.chain_id() { - chain_id - } else { - provider.get_chain_id().await? - }; - - let factory_deps: Vec> = { - let factory_dependencies_map = - factory_dependencies.as_ref().expect("factory deps not found"); - let mut visited_paths = HashSet::new(); - let mut visited_bytecodes = HashSet::new(); - let mut queue = VecDeque::new(); - - for dep in factory_dependencies_map.values() { - queue.push_back(dep.clone()); - } - - while let Some(dep_info) = queue.pop_front() { - if visited_paths.insert(dep_info.clone()) { - let mut split = dep_info.split(':'); - let contract_path = split - .next() - .expect("Failed to extract contract path for factory dependency"); - let contract_name = split - .next() - .expect("Failed to extract contract name for factory dependency"); - let mut abs_path_buf = PathBuf::new(); - abs_path_buf.push(project.root()); - abs_path_buf.push(contract_path); - let fdep_art = - zk_output.find(&abs_path_buf, contract_name).unwrap_or_else(|| { - panic!( - "Could not find contract {contract_name} at path {contract_path} for compilation output", - ) - }); - let fdep_fdeps_map = - fdep_art.factory_dependencies.as_ref().expect("factory deps not found"); - for dep in fdep_fdeps_map.values() { - queue.push_back(dep.clone()) - } - - // NOTE(zk): unlinked factory deps don't show up in `factory_dependencies` - let fdep_bytecode = fdep_art - .bytecode - .clone() - .expect("Bytecode not found for factory dependency") - .object() - .into_bytes() - .unwrap() - .to_vec(); - visited_bytecodes.insert(fdep_bytecode); - } - } - visited_bytecodes.insert(bytecode.clone()); - visited_bytecodes.into_iter().collect() - }; - let zk_data = ZkSyncData { bytecode, factory_deps, paymaster_params }; - - return if self.unlocked { - // Deploy with unlocked account - let sender = self.eth.wallet.from.expect("required"); - self.deploy_zk( - abi, - bin.object(), - params, - provider, - chain_id, - sender, - config.transaction_timeout, - id, - zk_data, - ) - .await - } else { - // Deploy with signer - // Avoid initializing `signer` twice as it will error out with Ledger - // and potentially other devices that rely on HID too - let zk_signer = self.eth.wallet.signer().await?; - let deployer = zk_signer.address(); - let provider = ProviderBuilder::<_, _, Zksync>::default() - .wallet(ZksyncWallet::new(zk_signer)) - .on_provider(provider); - self.deploy_zk( - abi, - bin.object(), - params, - provider, - chain_id, - deployer, - timeout, - id, - zk_data, - ) - .await - } + if self.build.compiler.zk.enabled() { + return self.run_zksync(project).await; } let target_path = if let Some(ref mut path) = self.contract.path { @@ -634,150 +444,6 @@ impl CreateArgs { verify.run().await } - /// Deploys the contract using ZKsync provider. - #[allow(clippy::too_many_arguments)] - async fn deploy_zk, T: Transport + Clone>( - self, - abi: JsonAbi, - bin: BytecodeObject, - args: Vec, - provider: P, - chain: u64, - deployer_address: Address, - timeout: u64, - id: ArtifactId, - zk_data: ZkSyncData, - ) -> Result<()> { - let bin = bin.into_bytes().unwrap_or_else(|| { - panic!("no bytecode found in bin object for {}", self.contract.name) - }); - let provider = Arc::new(provider); - let factory = ContractFactory::new_zk(abi.clone(), bin.clone(), provider.clone(), timeout); - - let is_args_empty = args.is_empty(); - let mut deployer = - factory.deploy_tokens_zk(args.clone(), &zk_data).context("failed to deploy contract").map_err(|e| { - if is_args_empty { - e.wrap_err("no arguments provided for contract constructor; consider --constructor-args or --constructor-args-path") - } else { - e - } - })?; - - deployer.tx = deployer.tx.with_factory_deps( - zk_data.factory_deps.clone().into_iter().map(|dep| dep.into()).collect(), - ); - if let Some(paymaster_params) = zk_data.paymaster_params { - deployer.tx.set_paymaster_params(paymaster_params); - } - deployer.tx.set_from(deployer_address); - deployer.tx.set_chain_id(chain); - // `to` field must be set explicitly, cannot be None. - if deployer.tx.to().is_none() { - deployer.tx.set_create(); - } - deployer.tx.set_nonce(if let Some(nonce) = self.tx.nonce { - Ok(nonce.to()) - } else { - provider.get_transaction_count(deployer_address).await - }?); - - // set tx value if specified - if let Some(value) = self.tx.value { - deployer.tx.set_value(value); - } - - let gas_price = if let Some(gas_price) = self.tx.gas_price { - gas_price.to() - } else { - provider.get_gas_price().await? - }; - deployer.tx.set_gas_price(gas_price); - - // estimate fee - foundry_zksync_core::estimate_fee( - &mut deployer.tx, - &provider, - 130, - self.zk_gas_per_pubdata, - ) - .await?; - - if let Some(gas_limit) = self.tx.gas_limit { - deployer.tx.set_gas_limit(gas_limit.to::()); - }; - - // Before we actually deploy the contract we try check if the verify settings are valid - let mut constructor_args = None; - if self.verify { - if !args.is_empty() { - let encoded_args = abi - .constructor() - .ok_or_else(|| eyre::eyre!("could not find constructor"))? - .abi_encode_input(&args)?; - constructor_args = Some(hex::encode_prefixed(encoded_args)); - } - - self.verify_preflight_check(constructor_args.clone(), chain, &id).await?; - } - - // Deploy the actual contract - let (deployed_contract, receipt) = deployer.send_with_receipt().await?; - let tx_hash = receipt.transaction_hash(); - - let address = deployed_contract; - if shell::is_json() { - let output = json!({ - "deployer": deployer_address.to_string(), - "deployedTo": address.to_string(), - "transactionHash": tx_hash - }); - sh_println!("{output}")?; - } else { - sh_println!("Deployer: {deployer_address}")?; - sh_println!("Deployed to: {address}")?; - sh_println!("Transaction hash: {:?}", tx_hash)?; - }; - - if !self.verify { - return Ok(()); - } - - sh_println!("Starting contract verification...")?; - - let num_of_optimizations = if self.build.compiler.optimize.unwrap_or_default() { - self.build.compiler.optimizer_runs - } else { - None - }; - let verify = VerifyArgs { - address, - contract: Some(self.contract), - compiler_version: None, - constructor_args, - constructor_args_path: None, - num_of_optimizations, - etherscan: EtherscanOpts { key: self.eth.etherscan.key(), chain: Some(chain.into()) }, - rpc: Default::default(), - flatten: false, - force: false, - skip_is_verified_check: true, - watch: true, - retry: self.retry, - libraries: self.build.libraries.clone(), - root: None, - verifier: self.verifier, - via_ir: self.build.via_ir, - evm_version: self.build.compiler.evm_version, - show_standard_json_input: self.show_standard_json_input, - guess_constructor_args: false, - compilation_profile: None, //TODO(zk): provide comp profile - zksync: self.build.compiler.zk.enabled(), - }; - sh_println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier)?; - verify.run().await - } - /// Parses the given constructor arguments into a vector of `DynSolValue`s, by matching them /// against the constructor's input params. /// @@ -875,8 +541,6 @@ pub struct Deployer { client: B, confs: usize, timeout: u64, - zk_factory_deps: Option>>, - zk_paymaster_params: Option, _p: PhantomData

, _t: PhantomData, } @@ -892,8 +556,6 @@ where client: self.client.clone(), confs: self.confs, timeout: self.timeout, - zk_factory_deps: self.zk_factory_deps.clone(), - zk_paymaster_params: self.zk_paymaster_params.clone(), _p: PhantomData, _t: PhantomData, } @@ -929,69 +591,6 @@ where } } -/// Helper which manages the deployment transaction of a smart contract -#[derive(Debug)] -#[must_use = "Deployer does nothing unless you `send` it"] -pub struct ZkDeployer { - /// The deployer's transaction, exposed for overriding the defaults - pub tx: alloy_zksync::network::transaction_request::TransactionRequest, - abi: JsonAbi, - client: B, - confs: usize, - timeout: u64, - zk_factory_deps: Option>>, - _p: PhantomData

, - _t: PhantomData, -} - -impl Clone for ZkDeployer -where - B: Clone, -{ - fn clone(&self) -> Self { - Self { - tx: self.tx.clone(), - abi: self.abi.clone(), - client: self.client.clone(), - confs: self.confs, - timeout: self.timeout, - zk_factory_deps: self.zk_factory_deps.clone(), - _p: PhantomData, - _t: PhantomData, - } - } -} - -impl ZkDeployer -where - B: Borrow

+ Clone, - P: Provider, - T: Transport + Clone, -{ - /// Broadcasts the contract deployment transaction and after waiting for it to - /// be sufficiently confirmed (default: 1), it returns a tuple with - /// the [`Contract`](crate::Contract) struct at the deployed contract's address - /// and the corresponding [`AnyReceipt`]. - pub async fn send_with_receipt( - self, - ) -> Result<(Address, ::ReceiptResponse), ContractDeploymentError> { - let receipt = self - .client - .borrow() - .send_transaction(self.tx) - .await? - .with_required_confirmations(self.confs as u64) - .with_timeout(Some(std::time::Duration::from_secs(self.timeout))) - .get_receipt() - .await?; - - let address = - receipt.contract_address().ok_or(ContractDeploymentError::ContractNotDeployed)?; - - Ok((address, receipt)) - } -} - /// To deploy a contract to the Ethereum network, a `ContractFactory` can be /// created which manages the Contract bytecode and Application Binary Interface /// (ABI), usually generated from the Solidity compiler. @@ -1099,64 +698,6 @@ where tx, confs: 1, timeout: self.timeout, - zk_factory_deps: None, - zk_paymaster_params: None, - _p: PhantomData, - _t: PhantomData, - }) - } -} - -impl DeploymentTxFactory -where - B: Borrow

+ Clone, - P: Provider, - T: Transport + Clone, -{ - /// Creates a factory for deployment of the Contract with bytecode, and the - /// constructor defined in the abi. The client will be used to send any deployment - /// transaction. - pub fn new_zk(abi: JsonAbi, bytecode: Bytes, client: B, timeout: u64) -> Self { - Self { client, abi, bytecode, timeout, _p: PhantomData, _t: PhantomData } - } - - /// Create a deployment tx using the provided tokens as constructor - /// arguments - pub fn deploy_tokens_zk( - self, - params: Vec, - zk_data: &ZkSyncData, - ) -> Result, ContractDeploymentError> - where - B: Clone, - { - // Encode the constructor args & concatenate with the bytecode if necessary - if self.abi.constructor().is_none() && !params.is_empty() { - return Err(ContractDeploymentError::ConstructorError) - } - - // Encode the constructor args & concatenate with the bytecode if necessary - let constructor_args = match self.abi.constructor() { - None => Default::default(), - Some(constructor) => constructor.abi_encode_input(¶ms).unwrap_or_default(), - }; - - let tx = alloy_zksync::network::transaction_request::TransactionRequest::default() - .with_to(foundry_zksync_core::CONTRACT_DEPLOYER_ADDRESS.to_address()) - .with_create_params( - zk_data.bytecode.clone(), - constructor_args, - zk_data.factory_deps.clone(), - ) - .map_err(|_| ContractDeploymentError::TransactionBuildError)?; - - Ok(ZkDeployer { - client: self.client.clone(), - abi: self.abi, - tx, - confs: 1, - timeout: self.timeout, - zk_factory_deps: None, _p: PhantomData, _t: PhantomData, }) @@ -1188,8 +729,6 @@ impl From for ContractDeploymentError { mod tests { use super::*; use alloy_primitives::I256; - use alloy_zksync::network::tx_type::TxType; - use utils::get_provider_zksync; #[test] fn can_parse_create() { @@ -1258,20 +797,4 @@ mod tests { let params = args.parse_constructor_args(&constructor, &args.constructor_args).unwrap(); assert_eq!(params, vec![DynSolValue::Int(I256::unchecked_from(-5), 256)]); } - - #[test] - fn test_zk_deployer_builds_eip712_transactions() { - let client = get_provider_zksync(&Default::default()).expect("failed creating client"); - let factory = - DeploymentTxFactory::new_zk(Default::default(), Default::default(), client, 0); - - let deployer = factory - .deploy_tokens_zk( - Default::default(), - &ZkSyncData { bytecode: [0u8; 32].into(), ..Default::default() }, - ) - .expect("failed deploying tokens"); - - assert_eq!(TxType::Eip712, deployer.tx.output_tx_type()); - } } diff --git a/crates/forge/bin/cmd/create/zksync.rs b/crates/forge/bin/cmd/create/zksync.rs new file mode 100644 index 0000000000..745a55e8b6 --- /dev/null +++ b/crates/forge/bin/cmd/create/zksync.rs @@ -0,0 +1,507 @@ +//! Contains zksync-specific code to run `forge create` + +use std::{ + borrow::Borrow, + collections::{HashSet, VecDeque}, + marker::PhantomData, + path::PathBuf, + sync::Arc, +}; + +use alloy_dyn_abi::{DynSolValue, JsonAbiExt}; +use alloy_json_abi::JsonAbi; +use alloy_network::{Network, ReceiptResponse, TransactionBuilder}; +use alloy_primitives::{hex, Address, Bytes}; +use alloy_provider::{Provider, ProviderBuilder}; +use alloy_signer::Signer; +use alloy_transport::Transport; +use alloy_zksync::{ + network::{ + transaction_request::TransactionRequest, unsigned_tx::eip712::PaymasterParams, Zksync, + }, + wallet::ZksyncWallet, +}; +use clap::Parser; +use eyre::{Context, Result}; +use forge_verify::VerifyArgs; +use foundry_cli::{ + opts::EtherscanOpts, + utils, + utils::{read_constructor_args_file, remove_zk_contract, LoadConfig}, +}; +use foundry_common::{compile::ProjectCompiler, shell}; +use foundry_compilers::{artifacts::BytecodeObject, utils::canonicalize, ArtifactId, Project}; +use foundry_zksync_compilers::compilers::artifact_output::zk::ZkContractArtifact; +use foundry_zksync_core::convert::ConvertH160; +use serde_json::json; + +use super::{ContractDeploymentError, ContractFactory, CreateArgs, DeploymentTxFactory}; + +#[derive(Clone, Debug, Parser)] +pub struct ZkCreateArgs { + /// Gas per pubdata + #[clap(long = "zk-gas-per-pubdata", value_name = "GAS_PER_PUBDATA")] + pub gas_per_pubdata: Option, +} + +#[derive(Debug, Default)] +/// Data used to deploy a contract on zksync +pub struct ZkSyncData { + #[allow(dead_code)] + bytecode: Vec, + factory_deps: Vec>, + paymaster_params: Option, +} + +impl CreateArgs { + pub(super) async fn run_zksync(mut self, project: Project) -> Result<()> { + let paymaster_params = if let Some(paymaster_address) = + self.build.compiler.zk.paymaster_address + { + Some(PaymasterParams { + paymaster: paymaster_address, + paymaster_input: self.build.compiler.zk.paymaster_input.clone().unwrap_or_default(), + }) + } else { + None + }; + let target_path = if let Some(ref mut path) = self.contract.path { + canonicalize(project.root().join(path))? + } else { + project.find_contract_path(&self.contract.name)? + }; + + let config = self.build.load_config()?; + let zk_project = + foundry_config::zksync::config_create_project(&config, config.cache, false)?; + let zk_compiler = ProjectCompiler::new().files([target_path.clone()]); + let mut zk_output = zk_compiler.zksync_compile(&zk_project)?; + + let (artifact, id) = remove_zk_contract(&mut zk_output, &target_path, &self.contract.name)?; + + let ZkContractArtifact { bytecode, abi, factory_dependencies, .. } = &artifact; + + let abi = abi.clone().expect("Abi not found"); + let bin = bytecode.as_ref().expect("Bytecode not found"); + + let bytecode = match bin.object() { + BytecodeObject::Bytecode(bytes) => bytes.to_vec(), + _ => { + let link_refs = bin + .missing_libraries + .iter() + .map(|library| { + let mut parts = library.split(':'); + let path = parts.next().unwrap(); + let name = parts.next().unwrap(); + format!("\t{name}: {path}") + }) + .collect::>() + .into_iter() + .collect::>() + .join("\n"); + eyre::bail!("Dynamic linking not supported in `create` command - deploy the following library contracts first, then provide the address to link at compile time\n{}", link_refs) + } + }; + + // Add arguments to constructor + let config = self.eth.load_config()?; + let provider = utils::get_provider_zksync(&config)?; + let params = match abi.constructor { + Some(ref v) => { + let constructor_args = + if let Some(ref constructor_args_path) = self.constructor_args_path { + read_constructor_args_file(constructor_args_path.to_path_buf())? + } else { + self.constructor_args.clone() + }; + self.parse_constructor_args(v, &constructor_args)? + } + None => vec![], + }; + + // respect chain, if set explicitly via cmd args + let chain_id = if let Some(chain_id) = self.chain_id() { + chain_id + } else { + provider.get_chain_id().await? + }; + + let factory_deps: Vec> = { + let factory_dependencies_map = + factory_dependencies.as_ref().expect("factory deps not found"); + let mut visited_paths = HashSet::new(); + let mut visited_bytecodes = HashSet::new(); + let mut queue = VecDeque::new(); + + for dep in factory_dependencies_map.values() { + queue.push_back(dep.clone()); + } + + while let Some(dep_info) = queue.pop_front() { + if visited_paths.insert(dep_info.clone()) { + let mut split = dep_info.split(':'); + let contract_path = split + .next() + .expect("Failed to extract contract path for factory dependency"); + let contract_name = split + .next() + .expect("Failed to extract contract name for factory dependency"); + let mut abs_path_buf = PathBuf::new(); + abs_path_buf.push(project.root()); + abs_path_buf.push(contract_path); + let fdep_art = + zk_output.find(&abs_path_buf, contract_name).unwrap_or_else(|| { + panic!( + "Could not find contract {contract_name} at path {contract_path} for compilation output", + ) + }); + let fdep_fdeps_map = + fdep_art.factory_dependencies.as_ref().expect("factory deps not found"); + for dep in fdep_fdeps_map.values() { + queue.push_back(dep.clone()) + } + + // NOTE(zk): unlinked factory deps don't show up in `factory_dependencies` + let fdep_bytecode = fdep_art + .bytecode + .clone() + .expect("Bytecode not found for factory dependency") + .object() + .into_bytes() + .unwrap() + .to_vec(); + visited_bytecodes.insert(fdep_bytecode); + } + } + visited_bytecodes.insert(bytecode.clone()); + visited_bytecodes.into_iter().collect() + }; + let zk_data = ZkSyncData { bytecode, factory_deps, paymaster_params }; + + if self.unlocked { + // Deploy with unlocked account + let sender = self.eth.wallet.from.expect("required"); + self.deploy_zk( + abi, + bin.object(), + params, + provider, + chain_id, + sender, + config.transaction_timeout, + id, + zk_data, + ) + .await + } else { + // Deploy with signer + // Avoid initializing `signer` twice as it will error out with Ledger + // and potentially other devices that rely on HID too + let zk_signer = self.eth.wallet.signer().await?; + let deployer = zk_signer.address(); + let provider = ProviderBuilder::<_, _, Zksync>::default() + .wallet(ZksyncWallet::new(zk_signer)) + .on_provider(provider); + self.deploy_zk( + abi, + bin.object(), + params, + provider, + chain_id, + deployer, + config.transaction_timeout, + id, + zk_data, + ) + .await + } + } + + /// Deploys the contract using ZKsync provider. + #[allow(clippy::too_many_arguments)] + async fn deploy_zk, T: Transport + Clone>( + self, + abi: JsonAbi, + bin: BytecodeObject, + args: Vec, + provider: P, + chain: u64, + deployer_address: Address, + timeout: u64, + id: ArtifactId, + zk_data: ZkSyncData, + ) -> Result<()> { + let bin = bin.into_bytes().unwrap_or_else(|| { + panic!("no bytecode found in bin object for {}", self.contract.name) + }); + let provider = Arc::new(provider); + let factory = ContractFactory::new_zk(abi.clone(), bin.clone(), provider.clone(), timeout); + + let is_args_empty = args.is_empty(); + let mut deployer = + factory.deploy_tokens_zk(args.clone(), &zk_data).context("failed to deploy contract").map_err(|e| { + if is_args_empty { + e.wrap_err("no arguments provided for contract constructor; consider --constructor-args or --constructor-args-path") + } else { + e + } + })?; + + deployer.tx = deployer.tx.with_factory_deps( + zk_data.factory_deps.clone().into_iter().map(|dep| dep.into()).collect(), + ); + if let Some(paymaster_params) = zk_data.paymaster_params { + deployer.tx.set_paymaster_params(paymaster_params); + } + deployer.tx.set_from(deployer_address); + deployer.tx.set_chain_id(chain); + // `to` field must be set explicitly, cannot be None. + if deployer.tx.to().is_none() { + deployer.tx.set_create(); + } + deployer.tx.set_nonce(if let Some(nonce) = self.tx.nonce { + Ok(nonce.to()) + } else { + provider.get_transaction_count(deployer_address).await + }?); + + // set tx value if specified + if let Some(value) = self.tx.value { + deployer.tx.set_value(value); + } + + let gas_price = if let Some(gas_price) = self.tx.gas_price { + gas_price.to() + } else { + provider.get_gas_price().await? + }; + deployer.tx.set_gas_price(gas_price); + + // estimate fee + foundry_zksync_core::estimate_fee( + &mut deployer.tx, + &provider, + 130, + self.zksync.gas_per_pubdata, + ) + .await?; + + if let Some(gas_limit) = self.tx.gas_limit { + deployer.tx.set_gas_limit(gas_limit.to::()); + }; + + // Before we actually deploy the contract we try check if the verify settings are valid + let mut constructor_args = None; + if self.verify { + if !args.is_empty() { + let encoded_args = abi + .constructor() + .ok_or_else(|| eyre::eyre!("could not find constructor"))? + .abi_encode_input(&args)?; + constructor_args = Some(hex::encode_prefixed(encoded_args)); + } + + self.verify_preflight_check(constructor_args.clone(), chain, &id).await?; + } + + // Deploy the actual contract + let (deployed_contract, receipt) = deployer.send_with_receipt().await?; + let tx_hash = receipt.transaction_hash(); + + let address = deployed_contract; + if shell::is_json() { + let output = json!({ + "deployer": deployer_address.to_string(), + "deployedTo": address.to_string(), + "transactionHash": tx_hash + }); + sh_println!("{output}")?; + } else { + sh_println!("Deployer: {deployer_address}")?; + sh_println!("Deployed to: {address}")?; + sh_println!("Transaction hash: {:?}", tx_hash)?; + }; + + if !self.verify { + return Ok(()); + } + + sh_println!("Starting contract verification...")?; + + let num_of_optimizations = if self.build.compiler.optimize.unwrap_or_default() { + self.build.compiler.optimizer_runs + } else { + None + }; + let verify = VerifyArgs { + address, + contract: Some(self.contract), + compiler_version: None, + constructor_args, + constructor_args_path: None, + num_of_optimizations, + etherscan: EtherscanOpts { key: self.eth.etherscan.key(), chain: Some(chain.into()) }, + rpc: Default::default(), + flatten: false, + force: false, + skip_is_verified_check: true, + watch: true, + retry: self.retry, + libraries: self.build.libraries.clone(), + root: None, + verifier: self.verifier, + via_ir: self.build.via_ir, + evm_version: self.build.compiler.evm_version, + show_standard_json_input: self.show_standard_json_input, + guess_constructor_args: false, + compilation_profile: None, //TODO(zk): provide comp profile + zksync: self.build.compiler.zk.enabled(), + }; + sh_println!("Waiting for {} to detect contract deployment...", verify.verifier.verifier)?; + verify.run().await + } +} + +/// Helper which manages the deployment transaction of a smart contract +#[derive(Debug)] +#[must_use = "Deployer does nothing unless you `send` it"] +pub struct ZkDeployer { + /// The deployer's transaction, exposed for overriding the defaults + pub tx: TransactionRequest, + abi: JsonAbi, + client: B, + confs: usize, + timeout: u64, + zk_factory_deps: Option>>, + _p: PhantomData

, + _t: PhantomData, +} + +impl Clone for ZkDeployer +where + B: Clone, +{ + fn clone(&self) -> Self { + Self { + tx: self.tx.clone(), + abi: self.abi.clone(), + client: self.client.clone(), + confs: self.confs, + timeout: self.timeout, + zk_factory_deps: self.zk_factory_deps.clone(), + _p: PhantomData, + _t: PhantomData, + } + } +} + +impl ZkDeployer +where + B: Borrow

+ Clone, + P: Provider, + T: Transport + Clone, +{ + /// Broadcasts the contract deployment transaction and after waiting for it to + /// be sufficiently confirmed (default: 1), it returns a tuple with + /// the [`Contract`](crate::Contract) struct at the deployed contract's address + /// and the corresponding [`AnyReceipt`]. + pub async fn send_with_receipt( + self, + ) -> Result<(Address, ::ReceiptResponse), ContractDeploymentError> { + let receipt = self + .client + .borrow() + .send_transaction(self.tx) + .await? + .with_required_confirmations(self.confs as u64) + .with_timeout(Some(std::time::Duration::from_secs(self.timeout))) + .get_receipt() + .await?; + + let address = + receipt.contract_address().ok_or(ContractDeploymentError::ContractNotDeployed)?; + + Ok((address, receipt)) + } +} + +impl DeploymentTxFactory +where + B: Borrow

+ Clone, + P: Provider, + T: Transport + Clone, +{ + /// Creates a factory for deployment of the Contract with bytecode, and the + /// constructor defined in the abi. The client will be used to send any deployment + /// transaction. + pub fn new_zk(abi: JsonAbi, bytecode: Bytes, client: B, timeout: u64) -> Self { + Self { client, abi, bytecode, timeout, _p: PhantomData, _t: PhantomData } + } + + /// Create a deployment tx using the provided tokens as constructor + /// arguments + pub fn deploy_tokens_zk( + self, + params: Vec, + zk_data: &ZkSyncData, + ) -> Result, ContractDeploymentError> + where + B: Clone, + { + // Encode the constructor args & concatenate with the bytecode if necessary + if self.abi.constructor().is_none() && !params.is_empty() { + return Err(ContractDeploymentError::ConstructorError) + } + + // Encode the constructor args & concatenate with the bytecode if necessary + let constructor_args = match self.abi.constructor() { + None => Default::default(), + Some(constructor) => constructor.abi_encode_input(¶ms).unwrap_or_default(), + }; + + let tx = TransactionRequest::default() + .with_to(foundry_zksync_core::CONTRACT_DEPLOYER_ADDRESS.to_address()) + .with_create_params( + zk_data.bytecode.clone(), + constructor_args, + zk_data.factory_deps.clone(), + ) + .map_err(|_| ContractDeploymentError::TransactionBuildError)?; + + Ok(ZkDeployer { + client: self.client.clone(), + abi: self.abi, + tx, + confs: 1, + timeout: self.timeout, + zk_factory_deps: None, + _p: PhantomData, + _t: PhantomData, + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use crate::utils::get_provider_zksync; + use alloy_zksync::network::tx_type::TxType; + + #[test] + fn test_zk_deployer_builds_eip712_transactions() { + let client = get_provider_zksync(&Default::default()).expect("failed creating client"); + let factory = + DeploymentTxFactory::new_zk(Default::default(), Default::default(), client, 0); + + let deployer = factory + .deploy_tokens_zk( + Default::default(), + &ZkSyncData { bytecode: [0u8; 32].into(), ..Default::default() }, + ) + .expect("failed deploying tokens"); + + assert_eq!(TxType::Eip712, deployer.tx.output_tx_type()); + } +} diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs index 322355dbc0..a50033c4b5 100644 --- a/crates/forge/tests/cli/config.rs +++ b/crates/forge/tests/cli/config.rs @@ -964,6 +964,9 @@ contract CounterTest { cmd.forge_fuse().args(["build"]).assert_success(); }); +// NOTE(zk): This test output differs from the original due to zksync integration: +// 1. Additional zksync-specific configuration items are present +// 2. Some existing configuration items appear in a different order #[cfg(not(feature = "isolate-by-default"))] forgetest_init!(test_default_config, |prj, cmd| { cmd.forge_fuse().args(["config"]).assert_success().stdout_eq(str![[r#" @@ -1003,8 +1006,8 @@ ignored_warnings_from = [] deny_warnings = false test_failures_file = "cache/test-failures" show_progress = false +additional_compiler_profiles = [] eof = false -transaction_timeout = 120 ffi = false allow_internal_expect_revert = false always_use_create_2_factory = false @@ -1034,15 +1037,15 @@ cbor_metadata = true sparse_mode = false build_info = false compilation_restrictions = [] -additional_compiler_profiles = [] -assertions_revert = true +legacy_assertions = false isolate = false disable_block_gas_limit = false -odyssey = false +transaction_timeout = 120 unchecked_cheatcode_artifacts = false create2_library_salt = "0x0000000000000000000000000000000000000000000000000000000000000000" create2_deployer = "0x4e59b44847b379578588920ca78fbf26c0b4956c" -legacy_assertions = false +odyssey = false +assertions_revert = true [[profile.default.fs_permissions]] access = "read" @@ -1052,6 +1055,18 @@ path = "out" chains = "all" endpoints = "all" +[profile.default.zksync] +compile = false +startup = false +fallback_oz = false +enable_eravm_extensions = false +force_evmla = false +llvm_options = [] +optimizer = true +optimizer_mode = "3" +suppressed_warnings = [] +suppressed_errors = [] + [fmt] line_length = 120 tab_width = 4 @@ -1086,6 +1101,7 @@ max_fuzz_dictionary_values = 6553600 gas_report_samples = 256 failure_persist_dir = "cache/fuzz" failure_persist_file = "failures" +no_zksync_reserved_addresses = false show_logs = false [invariant] @@ -1103,6 +1119,7 @@ max_assume_rejects = 65536 gas_report_samples = 256 failure_persist_dir = "cache/invariant" show_metrics = false +no_zksync_reserved_addresses = false [labels] @@ -1187,6 +1204,7 @@ exclude = [] "gas_report_samples": 256, "failure_persist_dir": "cache/fuzz", "failure_persist_file": "failures", + "no_zksync_reserved_addresses": false, "show_logs": false, "timeout": null }, @@ -1205,7 +1223,8 @@ exclude = [] "gas_report_samples": 256, "failure_persist_dir": "cache/invariant", "show_metrics": false, - "timeout": null + "timeout": null, + "no_zksync_reserved_addresses": false }, "ffi": false, "allow_internal_expect_revert": false, @@ -1295,7 +1314,24 @@ exclude = [] "transaction_timeout": 120, "eof": false, "additional_compiler_profiles": [], - "compilation_restrictions": [] + "compilation_restrictions": [], + "zksync": { + "compile": false, + "startup": false, + "zksolc": null, + "solc_path": null, + "hash_type": null, + "bytecode_hash": null, + "fallback_oz": false, + "enable_eravm_extensions": false, + "force_evmla": false, + "llvm_options": [], + "optimizer": true, + "optimizer_mode": "3", + "optimizer_details": null, + "suppressed_warnings": [], + "suppressed_errors": [] + } } "#]]); diff --git a/crates/forge/tests/cli/odyssey.rs b/crates/forge/tests/cli/odyssey.rs index 49b8c01fc7..7d98e79fcf 100644 --- a/crates/forge/tests/cli/odyssey.rs +++ b/crates/forge/tests/cli/odyssey.rs @@ -11,7 +11,6 @@ forgetest_init!(test_eof_flag, |prj, cmd| { Compiler run successful with warnings: Warning (3805): This is a pre-release compiler version, please do not use it in production. - Ran 2 tests for test/Counter.t.sol:CounterTest [PASS] testFuzz_SetNumber(uint256) (runs: 256, [AVG_GAS]) [PASS] test_Increment() ([GAS]) diff --git a/crates/forge/tests/it/zk/cheats.rs b/crates/forge/tests/it/zk/cheats.rs index 2fb3c21b18..5533394b6b 100644 --- a/crates/forge/tests/it/zk/cheats.rs +++ b/crates/forge/tests/it/zk/cheats.rs @@ -79,6 +79,29 @@ async fn test_zk_cheat_expect_emit_works() { TestConfig::with_filter(runner, filter).spec_id(SpecId::SHANGHAI).run().await; } +#[tokio::test(flavor = "multi_thread")] +async fn test_zk_cheat_expect_revert_works() { + let runner = TEST_DATA_DEFAULT.runner_zksync(); + let filter = Filter::new("test(ExpectRevert$|FailExpectRevert)", "ZkCheatcodesTest", ".*"); + + TestConfig::with_filter(runner, filter).spec_id(SpecId::SHANGHAI).run().await; +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_zk_cheat_expect_revert_works_with_internal_reverts() { + let mut runner = TEST_DATA_DEFAULT.runner_zksync(); + let mut config = runner.config.as_ref().clone(); + config.allow_internal_expect_revert = true; + runner.config = std::sync::Arc::new(config); + let filter = Filter::new( + "testExpectRevertDeeperDepthsWithInternalRevertsEnabled", + "ZkCheatcodesTest", + ".*", + ); + + TestConfig::with_filter(runner, filter).spec_id(SpecId::SHANGHAI).run().await; +} + #[tokio::test(flavor = "multi_thread")] async fn test_zk_cheat_expect_call_works() { let runner = TEST_DATA_DEFAULT.runner_zksync(); @@ -140,7 +163,12 @@ async fn test_zk_record_logs() { #[tokio::test(flavor = "multi_thread")] async fn test_zk_cheatcodes_in_zkvm() { - let runner = TEST_DATA_DEFAULT.runner_zksync(); + let mut runner = TEST_DATA_DEFAULT.runner_zksync(); + let mut config = runner.config.as_ref().clone(); + // This is now false by default so in order to expect a revert from an internal call, we need to + // set it to true https://github.com/foundry-rs/foundry/pull/9537 + config.allow_internal_expect_revert = true; + runner.config = std::sync::Arc::new(config); let filter = Filter::new(".*", "ZkCheatcodesInZkVmTest", ".*"); TestConfig::with_filter(runner, filter).spec_id(SpecId::SHANGHAI).run().await; @@ -158,6 +186,7 @@ forgetest_async!(test_zk_use_factory_dep, |prj, cmd| { setup_deploy_prj(&mut prj); cmd.forge_fuse(); + // We added the optimizer flag which is now false by default so we need to set it to true run_zk_script_test( prj.root(), &mut cmd, @@ -165,7 +194,7 @@ forgetest_async!(test_zk_use_factory_dep, |prj, cmd| { "DeployCounterWithBytecodeHash", Some("transmissions11/solmate@v7 OpenZeppelin/openzeppelin-contracts cyfrin/zksync-contracts"), 2, - Some(&["-vvvvv", "--via-ir", "--system-mode", "true", "--broadcast"]), + Some(&["-vvvvv", "--via-ir", "--system-mode", "true", "--broadcast", "--optimize", "true"]), ).await; }); diff --git a/crates/forge/tests/it/zk/contracts.rs b/crates/forge/tests/it/zk/contracts.rs index 714ec931f7..1ae90b0ec3 100644 --- a/crates/forge/tests/it/zk/contracts.rs +++ b/crates/forge/tests/it/zk/contracts.rs @@ -79,7 +79,16 @@ async fn test_zk_contract_create2() { prj.add_test("Create2.t.sol", include_str!("../../fixtures/zk/Create2.t.sol")).unwrap(); - cmd.args(["test", "--zk-startup", "--evm-version", "shanghai", "--mc", "Create2Test"]); + cmd.args([ + "test", + "--zk-startup", + "--evm-version", + "shanghai", + "--mc", + "Create2Test", + "--optimize", + "true", + ]); cmd.assert_success().get_output().stdout_lossy().contains("Suite result: ok"); } diff --git a/crates/forge/tests/it/zk/gas.rs b/crates/forge/tests/it/zk/gas.rs index 916068e80b..a6b42718b4 100644 --- a/crates/forge/tests/it/zk/gas.rs +++ b/crates/forge/tests/it/zk/gas.rs @@ -79,10 +79,39 @@ forgetest_async!(zk_script_execution_with_gas_per_pubdata, |prj, cmd| { let private_key = get_rich_wallet_key(); // Test with unacceptable gas per pubdata (should fail) - let zero_pubdata_args = create_script_args(&private_key, &url, "--zk-gas-per-pubdata", "1"); - cmd.arg("script").args(&zero_pubdata_args); - cmd.assert_failure(); - cmd.forge_fuse(); + let mut forge_bin = prj.forge_bin(); + // We had to change the approach of testing an invalid gas per pubdata value because there were + // changes upstream for the timeout and retries mechanism Now we execute the command + // directly and check the output with a manual timeout. The previous approach was to use the + // `forge script` command with a timeout but now it's not timeouting anymore for this error. + let mut child = forge_bin + .args([ + "script", + "--zksync", + "script/Gas.s.sol:GasScript", + "--private-key", + &private_key, + "--chain", + "260", + "--rpc-url", + &url, + "--slow", + "-vvvvv", + "--broadcast", + "--zk-gas-per-pubdata", + "1", + ]) + .current_dir(prj.root()) + .spawn() + .expect("failed to spawn process"); + + // Wait for 10 seconds then kill the process + std::thread::sleep(std::time::Duration::from_secs(10)); + child.kill().expect("failed to kill process"); + let output = child.wait().expect("failed to wait for process"); + + // Assert command was killed + assert!(!output.success()); // Test with sufficient gas per pubdata (should succeed) let sufficient_pubdata_args = diff --git a/crates/forge/tests/it/zk/paymaster.rs b/crates/forge/tests/it/zk/paymaster.rs index abfc54d2ba..dc3f69782e 100644 --- a/crates/forge/tests/it/zk/paymaster.rs +++ b/crates/forge/tests/it/zk/paymaster.rs @@ -32,7 +32,15 @@ async fn test_zk_contract_paymaster() { prj.add_source("MyPaymaster.sol", include_str!("../../fixtures/zk/MyPaymaster.sol")).unwrap(); prj.add_source("Paymaster.t.sol", include_str!("../../fixtures/zk/Paymaster.t.sol")).unwrap(); - cmd.args(["test", "--zk-startup", "--via-ir", "--match-contract", "TestPaymasterFlow"]); + cmd.args([ + "test", + "--zk-startup", + "--via-ir", + "--match-contract", + "TestPaymasterFlow", + "--optimize", + "true", + ]); assert!(cmd.assert_success().get_output().stdout_lossy().contains("Suite result: ok")); } @@ -128,6 +136,7 @@ forgetest_async!(test_zk_deploy_with_paymaster, |prj, cmd| { forgetest_async!(paymaster_script_test, |prj, cmd| { setup_deploy_prj(&mut prj); cmd.forge_fuse(); + // We added the optimizer flag which is now false by default so we need to set it to true run_zk_script_test( prj.root(), &mut cmd, @@ -135,7 +144,7 @@ forgetest_async!(paymaster_script_test, |prj, cmd| { "PaymasterScript", Some("OpenZeppelin/openzeppelin-contracts cyfrin/zksync-contracts"), 3, - Some(&["-vvvvv", "--via-ir"]), + Some(&["-vvvvv", "--via-ir", "--optimize", "true"]), ) .await; }); diff --git a/crates/forge/tests/it/zk/traces.rs b/crates/forge/tests/it/zk/traces.rs index d2c4500d4d..608645600b 100644 --- a/crates/forge/tests/it/zk/traces.rs +++ b/crates/forge/tests/it/zk/traces.rs @@ -31,8 +31,8 @@ const VALUE_TEN: Bytes = Bytes::from_static( hex!("000000000000000000000000000000000000000000000000000000000000000a").as_slice(), ); const VALUE_LOG_UINT_TEN: Bytes = Bytes::from_static( - hex!("f5b1bba9000000000000000000000000000000000000000000000000000000000000000a").as_slice(), -); // selector: log(uint) + hex!("f82c50f1000000000000000000000000000000000000000000000000000000000000000a").as_slice(), +); // selector: log(uint256) static BYTECODE_ADDER: LazyLock> = LazyLock::new(|| get_zk_artifact_bytecode("Trace.t.sol/Adder.json")); diff --git a/crates/linking/src/zksync.rs b/crates/linking/src/zksync.rs index 5afa522e19..ee649793c5 100644 --- a/crates/linking/src/zksync.rs +++ b/crates/linking/src/zksync.rs @@ -44,7 +44,7 @@ pub const DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION: Version = Version::new(1, 5, 9 #[derive(Debug)] pub struct ZkLinker<'a> { pub linker: Linker<'a>, - pub compiler: ZkSolcCompiler, + pub compiler: PathBuf, pub compiler_output: &'a ProjectCompileOutput, } @@ -57,7 +57,7 @@ impl<'a> ZkLinker<'a> { pub fn new( root: impl Into, contracts: ArtifactContracts>, - compiler: ZkSolcCompiler, + compiler: PathBuf, compiler_output: &'a ProjectCompileOutput, ) -> Self { Self { linker: Linker::new(root, contracts), compiler, compiler_output } @@ -299,7 +299,7 @@ impl<'a> ZkLinker<'a> { contracts: &ArtifactContracts>, target: &ArtifactId, libraries: &Libraries, - zksolc: &ZkSolcCompiler, + zksolc_path: &Path, ) -> Result, ZkLinkerError> { let artifact_to_link_id = |id: &ArtifactId| format!("{}:{}", id.source.display(), id.name); @@ -336,7 +336,7 @@ impl<'a> ZkLinker<'a> { .collect::>(); let mut link_output = - zk_link::zksolc_link(zksolc, zk_link::LinkJsonInput { bytecodes, libraries }) + zk_link::zksolc_link(zksolc_path, zk_link::LinkJsonInput { bytecodes, libraries }) .expect("able to call zksolc --link"); // TODO(zk): proper error check let link_id = &artifact_to_link_id(target); diff --git a/crates/script/src/build/zksync.rs b/crates/script/src/build/zksync.rs index 43d5245a39..25727347da 100644 --- a/crates/script/src/build/zksync.rs +++ b/crates/script/src/build/zksync.rs @@ -18,23 +18,27 @@ use super::BuildData; impl BuildData { fn get_zk_linker(&self, script_config: &ScriptConfig) -> Result> { - let zksolc = foundry_config::zksync::config_zksolc_compiler(&script_config.config) + let zksolc_settings = foundry_config::zksync::config_zksolc_settings(&script_config.config) .context("retrieving zksolc compiler to be used for linking")?; - let version = zksolc.version().context("trying to determine zksolc version")?; + let version = zksolc_settings.zksolc_version_ref(); let Some(input) = self.zk_output.as_ref() else { eyre::bail!("unable to link zk artifacts if no zk compilation output is provided") }; - let linker = - ZkLinker::new(self.project_root.clone(), input.artifact_ids().collect(), zksolc, input); + let linker = ZkLinker::new( + self.project_root.clone(), + input.artifact_ids().collect(), + zksolc_settings.zksolc_path(), + input, + ); let mut libs = Default::default(); linker.zk_collect_dependencies(&self.target, &mut libs, None)?; // if there are no no libs, no linking will happen // so we can skip version check - if !libs.is_empty() && version < DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION { + if !libs.is_empty() && version < &DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION { eyre::bail!( "deploy-time linking not supported. minimum: {}, given: {}", DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION, diff --git a/crates/strategy/zksync/src/executor/runner/libraries.rs b/crates/strategy/zksync/src/executor/runner/libraries.rs index 6ef5004123..e3833dd248 100644 --- a/crates/strategy/zksync/src/executor/runner/libraries.rs +++ b/crates/strategy/zksync/src/executor/runner/libraries.rs @@ -56,14 +56,14 @@ impl ZksyncExecutorStrategyRunner { let contracts: ArtifactContracts> = input.artifact_ids().collect(); - let Ok(zksolc) = foundry_config::zksync::config_zksolc_compiler(config) else { + let Ok(zksolc_settings) = foundry_config::zksync::config_zksolc_settings(config) else { tracing::error!("unable to determine zksolc compiler to be used for linking"); // TODO(zk): better error return Err(LinkerError::CyclicDependency); }; - let version = zksolc.version().map_err(|_| LinkerError::CyclicDependency)?; + let version = zksolc_settings.zksolc_version_ref(); - let linker = ZkLinker::new(root, contracts.clone(), zksolc, input); + let linker = ZkLinker::new(root, contracts.clone(), zksolc_settings.zksolc_path(), input); let zk_linker_error_to_linker = |zk_error| match zk_error { ZkLinkerError::Inner(err) => err, @@ -93,7 +93,7 @@ impl ZksyncExecutorStrategyRunner { // so we can skip the version check if !libraries.is_empty() { // TODO(zk): better error - if version < DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION { + if version < &DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION { tracing::error!( %version, minimum_version = %DEPLOY_TIME_LINKING_ZKSOLC_MIN_VERSION, diff --git a/crates/verify/src/etherscan/flatten.rs b/crates/verify/src/etherscan/flatten.rs index 40ae509087..f40baea0c5 100644 --- a/crates/verify/src/etherscan/flatten.rs +++ b/crates/verify/src/etherscan/flatten.rs @@ -68,7 +68,7 @@ impl EtherscanSourceProvider for EtherscanFlattenedSource { context: &ZkVerificationContext, ) -> Result<(String, String, CodeFormat)> { let metadata = context.project.settings.settings.metadata.as_ref(); - let bch = metadata.and_then(|m| m.bytecode_hash).unwrap_or_default(); + let bch = metadata.and_then(|m| m.hash_type).unwrap_or_default(); eyre::ensure!( bch == foundry_zksync_compilers::compilers::zksolc::settings::BytecodeHash::Keccak256, @@ -188,6 +188,7 @@ Diagnostics: {diags}", }, solc_version: solc_version.clone(), cli_settings: CliSettings::default(), + zksolc_path, }; let solc_compiler = if compiler_version.is_zksync_solc { @@ -199,7 +200,7 @@ Diagnostics: {diags}", SolcCompiler::Specific(solc) }; - let zksolc_compiler = ZkSolcCompiler { zksolc: zksolc_path, solc: solc_compiler }; + let zksolc_compiler = ZkSolcCompiler { solc: solc_compiler }; let out = zksolc_compiler.compile(&input)?; if out.errors.iter().any(|e| e.is_error()) { diff --git a/crates/verify/src/zk_provider.rs b/crates/verify/src/zk_provider.rs index 1f85797f41..4834c5d83c 100644 --- a/crates/verify/src/zk_provider.rs +++ b/crates/verify/src/zk_provider.rs @@ -45,7 +45,7 @@ impl ZkVerificationContext { let mut project = foundry_config::zksync::config_create_project(&config, config.cache, false)?; project.no_artifacts = true; - let zksolc_version = ZkSolc::get_version_for_path(&project.compiler.zksolc)?; + let zksolc_version = project.settings.zksolc_version_ref(); let (solc_version, is_zksync_solc) = if let Some(solc) = &config.zksync.solc_path { let solc_type_and_version = zksolc::get_solc_version_info(solc)?; @@ -68,7 +68,7 @@ impl ZkVerificationContext { }; let compiler_version = - ZkVersion { zksolc: zksolc_version, solc: solc_version, is_zksync_solc }; + ZkVersion { zksolc: zksolc_version.clone(), solc: solc_version, is_zksync_solc }; Ok(Self { config, project, target_name, target_path, compiler_version }) } diff --git a/crates/zksync/compilers/Cargo.toml b/crates/zksync/compilers/Cargo.toml index a4a7643ab0..f4dfc50d1a 100644 --- a/crates/zksync/compilers/Cargo.toml +++ b/crates/zksync/compilers/Cargo.toml @@ -37,3 +37,4 @@ similar-asserts.workspace = true fd-lock = "4.0.2" tempfile.workspace = true foundry-test-utils.workspace = true + diff --git a/crates/zksync/compilers/src/compilers/zksolc/input.rs b/crates/zksync/compilers/src/compilers/zksolc/input.rs index a8e21cd3c7..650229cdd7 100644 --- a/crates/zksync/compilers/src/compilers/zksolc/input.rs +++ b/crates/zksync/compilers/src/compilers/zksolc/input.rs @@ -26,6 +26,8 @@ pub struct ZkSolcVersionedInput { pub solc_version: Version, /// zksolc cli settings pub cli_settings: solc::CliSettings, + /// zksolc binary path + pub zksolc_path: PathBuf, } impl CompilerInput for ZkSolcVersionedInput { @@ -41,10 +43,13 @@ impl CompilerInput for ZkSolcVersionedInput { language: Self::Language, version: Version, ) -> Self { - let ZkSolcSettings { settings, cli_settings } = settings; - let input = ZkSolcInput::new(language, sources, settings).sanitized(&version); + let zksolc_path = settings.zksolc_path(); + let zksolc_version = settings.zksolc_version_ref().clone(); + let ZkSolcSettings { settings, cli_settings, .. } = settings; + let input = + ZkSolcInput::new(language, sources, settings, &zksolc_version).sanitized(&version); - Self { solc_version: version, input, cli_settings } + Self { solc_version: version, input, cli_settings, zksolc_path } } fn language(&self) -> Self::Language { @@ -107,9 +112,24 @@ impl Default for ZkSolcInput { } impl ZkSolcInput { - fn new(language: SolcLanguage, sources: Sources, settings: ZkSettings) -> Self { - let suppressed_warnings = settings.suppressed_warnings.clone(); - let suppressed_errors = settings.suppressed_errors.clone(); + fn new( + language: SolcLanguage, + sources: Sources, + mut settings: ZkSettings, + zksolc_version: &Version, + ) -> Self { + let mut suppressed_warnings = HashSet::default(); + let mut suppressed_errors = HashSet::default(); + // zksolc <= 1.5.6 has suppressed warnings/errors in at the root input level + if zksolc_version <= &Version::new(1, 5, 6) { + suppressed_warnings = std::mem::take(&mut settings.suppressed_warnings); + suppressed_errors = std::mem::take(&mut settings.suppressed_errors); + } + + if let Some(ref mut metadata) = settings.metadata { + metadata.sanitize(zksolc_version); + }; + Self { language, sources, settings, suppressed_warnings, suppressed_errors } } diff --git a/crates/zksync/compilers/src/compilers/zksolc/mod.rs b/crates/zksync/compilers/src/compilers/zksolc/mod.rs index e273ec4625..01aba9eecf 100644 --- a/crates/zksync/compilers/src/compilers/zksolc/mod.rs +++ b/crates/zksync/compilers/src/compilers/zksolc/mod.rs @@ -35,12 +35,11 @@ pub mod input; pub mod settings; pub use settings::{ZkSettings, ZkSolcSettings}; -/// zksolc command -pub const ZKSOLC: &str = "zksolc"; /// ZKsync solc release used for all ZKsync solc versions pub const ZKSYNC_SOLC_RELEASE: Version = Version::new(1, 0, 1); -/// Default zksolc version -pub const ZKSOLC_VERSION: Version = Version::new(1, 5, 11); + +/// Get zksolc versions that are specifically not supported +pub const ZKSOLC_UNSUPPORTED_VERSIONS: [Version; 1] = [Version::new(1, 5, 9)]; #[cfg(test)] macro_rules! take_solc_installer_lock { @@ -121,22 +120,12 @@ impl ZkSolcOS { } /// ZkSolc compiler -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Default)] pub struct ZkSolcCompiler { - /// zksolc path - pub zksolc: PathBuf, /// solc compiler to use along zksolc pub solc: SolcCompiler, } -impl Default for ZkSolcCompiler { - fn default() -> Self { - let zksolc = - ZkSolc::get_path_for_version(&ZKSOLC_VERSION).expect("Could not install zksolc"); - Self { zksolc, solc: Default::default() } - } -} - impl Compiler for ZkSolcCompiler { type Input = ZkSolcVersionedInput; type CompilationError = Error; @@ -152,6 +141,7 @@ impl Compiler for ZkSolcCompiler { let zksolc = self.zksolc(input)?; let mut zk_output = zksolc.compile(&input.input)?; + let mut metadata = BTreeMap::new(); if let Some(solc_version) = zk_output.version.take() { metadata.insert("solcVersion".to_string(), solc_version.into()); @@ -236,7 +226,7 @@ impl ZkSolcCompiler { } }; - let mut zksolc = ZkSolc::new(self.zksolc.clone(), solc)?; + let mut zksolc = ZkSolc::new(input.zksolc_path.clone(), solc)?; zksolc.base_path.clone_from(&input.cli_settings.base_path); zksolc.allow_paths.clone_from(&input.cli_settings.allow_paths); @@ -244,11 +234,6 @@ impl ZkSolcCompiler { Ok(zksolc) } - - /// Retrieve the version of the specified `zksolc` - pub fn version(&self) -> Result { - ZkSolc::get_version_for_path(self.zksolc.as_ref()) - } } /// Version metadata. Will include `zksync_version` if compiler is zksync solc. @@ -422,14 +407,41 @@ impl ZkSolc { } } + /// Get supported zksolc versions + pub fn zksolc_supported_versions() -> Vec { + let mut ret = vec![]; + let version_ranges = vec![(1, 5, 6..=11)]; + + for (major, minor, patch_range) in version_ranges { + for patch in patch_range { + let v = Version::new(major, minor, patch); + if !ZKSOLC_UNSUPPORTED_VERSIONS.contains(&v) { + ret.push(v); + } + } + } + + ret + } + + /// Get zksolc minimum supported version + pub fn zksolc_minimum_supported_version() -> Version { + ZkSolc::zksolc_supported_versions().remove(0) + } + + /// Get zksolc minimum supported version + pub fn zksolc_latest_supported_version() -> Version { + ZkSolc::zksolc_supported_versions().pop().expect("No supported zksolc versions") + } + /// Get available zksync solc versions pub fn solc_available_versions() -> Vec { let mut ret = vec![]; - let min_max_patch_by_minor_versions = - vec![(4, 12, 26), (5, 0, 17), (6, 0, 12), (7, 0, 6), (8, 0, 28)]; - for (minor, min_patch, max_patch) in min_max_patch_by_minor_versions { - for i in min_patch..=max_patch { - ret.push(Version::new(0, minor, i)); + let version_ranges = + vec![(0, 4, 12..=26), (0, 5, 0..=17), (0, 6, 0..=12), (0, 7, 0..=6), (0, 8, 0..=28)]; + for (major, minor, patch_range) in version_ranges { + for patch in patch_range { + ret.push(Version::new(major, minor, patch)); } } @@ -752,7 +764,8 @@ mod tests { use super::*; fn zksolc() -> ZkSolc { - let zksolc_path = ZkSolc::get_path_for_version(&ZKSOLC_VERSION).unwrap(); + let zksolc_path = + ZkSolc::get_path_for_version(&ZkSolc::zksolc_latest_supported_version()).unwrap(); let solc_version = "0.8.27"; take_solc_installer_lock!(_lock); diff --git a/crates/zksync/compilers/src/compilers/zksolc/settings.rs b/crates/zksync/compilers/src/compilers/zksolc/settings.rs index 5928dedd21..8be44fd97e 100644 --- a/crates/zksync/compilers/src/compilers/zksolc/settings.rs +++ b/crates/zksync/compilers/src/compilers/zksolc/settings.rs @@ -6,6 +6,7 @@ use foundry_compilers::{ output_selection::OutputSelection, serde_helpers, EvmVersion, Libraries, Remapping, }, compilers::CompilerSettings, + error::Result, solc, CompilerSettingsRestrictions, }; use semver::Version; @@ -16,6 +17,8 @@ use std::{ path::{Path, PathBuf}, str::FromStr, }; + +use super::ZkSolc; /// /// The Solidity compiler codegen. #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -41,8 +44,6 @@ pub struct ZkSettings { /// The Solidity codegen. #[serde(default)] pub codegen: Codegen, - // TODO: era-compiler-solidity uses a BTreeSet of strings. In theory the serialization - // should be the same but maybe we should double check /// Solidity remappings #[serde(default, skip_serializing_if = "Vec::is_empty")] pub remappings: Vec, @@ -91,7 +92,7 @@ pub struct ZkSettings { } /// Analogous to SolcSettings for zksolc compiler -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ZkSolcSettings { /// JSON settings expected by Solc @@ -100,6 +101,54 @@ pub struct ZkSolcSettings { /// Additional CLI args configuration #[serde(flatten)] pub cli_settings: solc::CliSettings, + /// The version of the zksolc compiler to use. Retrieved from `zksolc_path` + zksolc_version: Version, + /// zksolc path + zksolc_path: PathBuf, +} + +impl Default for ZkSolcSettings { + fn default() -> Self { + let version = ZkSolc::zksolc_latest_supported_version(); + let zksolc_path = ZkSolc::get_path_for_version(&version) + .expect("failed getting default zksolc version path"); + Self { + settings: Default::default(), + cli_settings: Default::default(), + zksolc_version: version, + zksolc_path, + } + } +} + +impl ZkSolcSettings { + /// Initialize settings for a given zksolc path + pub fn new_from_path( + settings: ZkSettings, + cli_settings: solc::CliSettings, + zksolc_path: PathBuf, + ) -> Result { + let zksolc_version = ZkSolc::get_version_for_path(&zksolc_path)?; + Ok(Self { settings, cli_settings, zksolc_path, zksolc_version }) + } + + /// Get zksolc path + pub fn zksolc_path(&self) -> PathBuf { + self.zksolc_path.clone() + } + + /// Get zksolc version + pub fn zksolc_version_ref(&self) -> &Version { + &self.zksolc_version + } + + /// Set a specific zksolc version + pub fn set_zksolc_version(&mut self, zksolc_version: Version) -> Result<()> { + let zksolc_path = ZkSolc::get_path_for_version(&zksolc_version)?; + self.zksolc_version = zksolc_version; + self.zksolc_path = zksolc_path; + Ok(()) + } } impl ZkSettings { @@ -223,7 +272,8 @@ impl CompilerSettings for ZkSolcSettings { *force_evmla == other.settings.force_evmla && *codegen == other.settings.codegen && *suppressed_warnings == other.settings.suppressed_warnings && - *suppressed_errors == other.settings.suppressed_errors + *suppressed_errors == other.settings.suppressed_errors && + self.zksolc_version == other.zksolc_version } fn with_remappings(mut self, remappings: &[Remapping]) -> Self { @@ -350,29 +400,37 @@ impl OptimizerDetails { /// Settings metadata #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct SettingsMetadata { /// Use the given hash method for the metadata hash that is appended to the bytecode. /// The metadata hash can be removed from the bytecode via option "none". - /// `zksolc` only supports keccak256 #[serde( default, - rename = "bytecodeHash", skip_serializing_if = "Option::is_none", with = "serde_helpers::display_from_str_opt" )] - pub bytecode_hash: Option, + pub hash_type: Option, + /// hash_type field name for zksolc v1.5.6 and older + #[serde( + default, + skip_serializing_if = "Option::is_none", + with = "serde_helpers::display_from_str_opt" + )] + bytecode_hash: Option, } impl SettingsMetadata { - /// New SettingsMetadata - pub fn new(hash: BytecodeHash) -> Self { - Self { bytecode_hash: Some(hash) } + /// Creates new SettingsMettadata + pub fn new(hash_type: Option) -> Self { + Self { hash_type, bytecode_hash: None } } -} -impl From for SettingsMetadata { - fn from(hash: BytecodeHash) -> Self { - Self { bytecode_hash: Some(hash) } + /// Makes SettingsMettadata version compatible + pub fn sanitize(&mut self, zksolc_version: &Version) { + // zksolc <= 1.5.6 uses "bytecode_hash" field for "hash_type" + if zksolc_version <= &Version::new(1, 5, 6) { + self.bytecode_hash = self.hash_type.take(); + } } } @@ -387,6 +445,9 @@ pub enum BytecodeHash { /// The default keccak256 hash. #[serde(rename = "keccak256")] Keccak256, + /// The `ipfs` hash. + #[serde(rename = "ipfs")] + Ipfs, } impl FromStr for BytecodeHash { @@ -395,6 +456,7 @@ impl FromStr for BytecodeHash { fn from_str(s: &str) -> Result { match s { "none" => Ok(Self::None), + "ipfs" => Ok(Self::Ipfs), "keccak256" => Ok(Self::Keccak256), s => Err(format!("Unknown bytecode hash: {s}")), } @@ -405,6 +467,7 @@ impl fmt::Display for BytecodeHash { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let s = match self { Self::Keccak256 => "keccak256", + Self::Ipfs => "ipfs", Self::None => "none", }; f.write_str(s) diff --git a/crates/zksync/compilers/src/link.rs b/crates/zksync/compilers/src/link.rs index 05d84c5e7a..b9a97c507e 100644 --- a/crates/zksync/compilers/src/link.rs +++ b/crates/zksync/compilers/src/link.rs @@ -12,8 +12,6 @@ use alloy_primitives::{ use foundry_compilers::error::SolcError; use serde::{Deserialize, Serialize}; -use crate::compilers::zksolc::ZkSolcCompiler; - type LinkId = String; /// A library that zksolc will link against @@ -108,12 +106,8 @@ fn map_io_err(zksolc_path: &Path) -> impl FnOnce(std::io::Error) -> SolcError + /// Invoke `zksolc link` given the `zksolc` binary and json input to use #[tracing::instrument(level = tracing::Level::TRACE, ret)] -pub fn zksolc_link( - zksolc: &ZkSolcCompiler, - input: LinkJsonInput, -) -> Result { - let zksolc = &zksolc.zksolc; - let mut cmd = Command::new(zksolc); +pub fn zksolc_link(zksolc_path: &Path, input: LinkJsonInput) -> Result { + let mut cmd = Command::new(zksolc_path); cmd.arg("--standard-json") .arg("--link") @@ -121,12 +115,12 @@ pub fn zksolc_link( .stderr(Stdio::piped()) .stdout(Stdio::piped()); - let mut child = cmd.spawn().map_err(map_io_err(zksolc))?; + let mut child = cmd.spawn().map_err(map_io_err(zksolc_path))?; let stdin = child.stdin.as_mut().unwrap(); let _ = serde_json::to_writer(stdin, &input); - let output = child.wait_with_output().map_err(map_io_err(zksolc))?; + let output = child.wait_with_output().map_err(map_io_err(zksolc_path))?; tracing::trace!(?output); if output.status.success() { diff --git a/crates/zksync/compilers/tests/zksync_tests.rs b/crates/zksync/compilers/tests/zksync_tests.rs index bb3e4a2d1b..374f26633c 100644 --- a/crates/zksync/compilers/tests/zksync_tests.rs +++ b/crates/zksync/compilers/tests/zksync_tests.rs @@ -16,9 +16,14 @@ use foundry_zksync_compilers::{ artifacts::{contract::Contract, error::Error}, compilers::{ artifact_output::zk::ZkArtifactOutput, - zksolc::{input::ZkSolcInput, ZkSolc, ZkSolcCompiler, ZkSolcSettings}, + zksolc::{ + input::ZkSolcInput, + settings::{BytecodeHash, SettingsMetadata}, + ZkSolc, ZkSolcCompiler, ZkSolcSettings, + }, }, }; +use semver::Version; #[test] fn zksync_can_compile_dapp_sample() { @@ -51,13 +56,85 @@ fn zksync_can_compile_dapp_sample() { assert_eq!(cache, updated_cache); } -fn test_zksync_can_compile_contract_with_suppressed_errors(compiler: ZkSolcCompiler) { +#[test] +fn zksync_can_compile_dapp_sample_with_supported_zksolc_versions() { + for version in ZkSolc::zksolc_supported_versions() { + let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test-data/dapp-sample"); + let paths = ProjectPathsConfig::builder().sources(root.join("src")).lib(root.join("lib")); + let mut project = TempProject::::new(paths).unwrap(); + project.project_mut().settings.set_zksolc_version(version.clone()).unwrap(); + + let compiled = project.compile().unwrap(); + compiled.assert_success(); + assert_eq!(compiled.compiled_artifacts().len(), 3, "zksolc {version}"); + for (n, c) in compiled.artifacts() { + assert!( + c.bytecode + .as_ref() + .unwrap_or_else(|| panic!( + "zksolc {version}: {n} artifact bytecode field should not be empty" + )) + .object() + .bytes_len() > + 0, + "zksolc {version}", + ); + } + } +} + +#[test] +fn zksync_can_set_hash_type_with_supported_versions() { + for version in ZkSolc::zksolc_supported_versions() { + let mut project = TempProject::::dapptools().unwrap(); + project.project_mut().settings.set_zksolc_version(version.clone()).unwrap(); + project.project_mut().settings.settings.metadata = + Some(SettingsMetadata::new(Some(BytecodeHash::None))); + + project + .add_source( + "Contract", + r#" + // SPDX-License-Identifier: MIT OR Apache-2.0 + pragma solidity ^0.8.10; + contract Contract { + function call() public {} + } + "#, + ) + .unwrap(); + + let compiled = project.compile().unwrap(); + compiled.assert_success(); + let contract_none = compiled.find_first("Contract").unwrap(); + let bytecode_none = + contract_none.bytecode.as_ref().map(|b| b.object().into_bytes()).unwrap().unwrap(); + + project.project_mut().settings.settings.metadata = + Some(SettingsMetadata::new(Some(BytecodeHash::Keccak256))); + + let compiled = project.compile().unwrap(); + compiled.assert_success(); + let contract_keccak = compiled.find_first("Contract").unwrap(); + let bytecode_keccak = + contract_keccak.bytecode.as_ref().map(|b| b.object().into_bytes()).unwrap().unwrap(); + // NOTE: "none" value seems to pad 32 bytes of 0s at the end in this particular case + assert_eq!(bytecode_none.len(), bytecode_keccak.len(), "zksolc {version}"); + assert_ne!(bytecode_none, bytecode_keccak, "zksolc {version}"); + + let end = bytecode_keccak.len() - 32; + assert_eq!(bytecode_none.slice(..end), bytecode_keccak.slice(..end), "zksolc {version}"); + } +} + +fn test_zksync_can_compile_contract_with_suppressed_errors(zksolc_version: Version) { // let _ = tracing_subscriber::fmt() // .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) // .try_init() // .ok(); + let mut project = TempProject::::dapptools().unwrap(); - project.project_mut().compiler = compiler; + project.project_mut().settings.set_zksolc_version(zksolc_version).unwrap(); project .add_source( @@ -76,37 +153,37 @@ fn test_zksync_can_compile_contract_with_suppressed_errors(compiler: ZkSolcCompi .unwrap(); let compiled = project.compile().unwrap(); + assert!(compiled.has_compiler_errors()); project.project_mut().settings.settings.suppressed_errors = HashSet::from([ErrorType::SendTransfer]); let compiled = project.compile().unwrap(); + compiled.assert_success(); assert!(compiled.find_first("Erroneous").is_some()); } #[test] fn zksync_can_compile_contract_with_suppressed_errors() { - test_zksync_can_compile_contract_with_suppressed_errors(ZkSolcCompiler::default()); + test_zksync_can_compile_contract_with_suppressed_errors( + ZkSolc::zksolc_latest_supported_version(), + ); } #[test] fn zksync_pre_1_5_7_can_compile_contract_with_suppressed_errors() { - let compiler = ZkSolcCompiler { - zksolc: ZkSolc::get_path_for_version(&semver::Version::new(1, 5, 6)).unwrap(), - solc: Default::default(), - }; - test_zksync_can_compile_contract_with_suppressed_errors(compiler); + test_zksync_can_compile_contract_with_suppressed_errors(Version::new(1, 5, 6)); } -fn test_zksync_can_compile_contract_with_suppressed_warnings(compiler: ZkSolcCompiler) { +fn test_zksync_can_compile_contract_with_suppressed_warnings(zksolc_version: Version) { // let _ = tracing_subscriber::fmt() // .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) // .try_init() // .ok(); let mut project = TempProject::::dapptools().unwrap(); - project.project_mut().compiler = compiler; + project.project_mut().settings.set_zksolc_version(zksolc_version).unwrap(); project .add_source( @@ -154,23 +231,21 @@ fn test_zksync_can_compile_contract_with_suppressed_warnings(compiler: ZkSolcCom #[test] fn zksync_can_compile_contract_with_suppressed_warnings() { - test_zksync_can_compile_contract_with_suppressed_warnings(ZkSolcCompiler::default()); + test_zksync_can_compile_contract_with_suppressed_warnings( + ZkSolc::zksolc_latest_supported_version(), + ); } #[test] fn zksync_pre_1_5_7_can_compile_contract_with_suppressed_warnings() { - let compiler = ZkSolcCompiler { - zksolc: ZkSolc::get_path_for_version(&semver::Version::new(1, 5, 6)).unwrap(), - solc: Default::default(), - }; - test_zksync_can_compile_contract_with_suppressed_warnings(compiler); + test_zksync_can_compile_contract_with_suppressed_warnings(Version::new(1, 5, 6)); } fn test_zksync_can_compile_contract_with_assembly_create_suppressed_warnings( - compiler: ZkSolcCompiler, + zksolc_version: Version, ) { let mut project = TempProject::::dapptools().unwrap(); - project.project_mut().compiler = compiler; + project.project_mut().settings.set_zksolc_version(zksolc_version).unwrap(); project .add_source( @@ -222,11 +297,9 @@ fn test_zksync_can_compile_contract_with_assembly_create_suppressed_warnings( #[test] fn zksync_can_compile_contract_with_assembly_create_suppressed_warnings_1_5_10() { - let compiler = ZkSolcCompiler { - zksolc: ZkSolc::get_path_for_version(&semver::Version::new(1, 5, 10)).unwrap(), - solc: Default::default(), - }; - test_zksync_can_compile_contract_with_assembly_create_suppressed_warnings(compiler); + test_zksync_can_compile_contract_with_assembly_create_suppressed_warnings(Version::new( + 1, 5, 10, + )); } #[test] @@ -654,3 +727,57 @@ fn zksync_can_compile_yul_sample() { assert!(!yul_bytecode.is_empty(), "SimpleStore bytecode is empty"); } + +#[test] +fn zksync_detects_change_on_cache_if_zksolc_version_changes() { + let mut project = TempProject::::dapptools().unwrap(); + + project.project_mut().build_info = true; + + project + .add_source( + "A", + r#" +pragma solidity ^0.8.10; +import "./B.sol"; +contract A { } +"#, + ) + .unwrap(); + + project + .add_source( + "B", + r" +pragma solidity ^0.8.10; +contract B { } +", + ) + .unwrap(); + + project.project_mut().settings.set_zksolc_version(Version::new(1, 5, 6)).unwrap(); + + let compiled_1 = project.compile().unwrap(); + compiled_1.assert_success(); + + for bi in compiled_1.output().build_infos.iter() { + let zksolc_version = + bi.build_info.get("output").unwrap()["metadata"]["zksolcVersion"].to_string(); + assert_eq!(zksolc_version, "\"1.5.6\""); + } + + let compiled_2 = project.compile().unwrap(); + assert!(compiled_2.is_unchanged()); + + project.project_mut().settings.set_zksolc_version(Version::new(1, 5, 7)).unwrap(); + + let compiled_3 = project.compile().unwrap(); + compiled_3.assert_success(); + assert!(!compiled_3.is_unchanged()); + + for bi in compiled_3.output().build_infos.iter() { + let zksolc_version = + bi.build_info.get("output").unwrap()["metadata"]["zksolcVersion"].to_string(); + assert_eq!(zksolc_version, "\"1.5.7\""); + } +} diff --git a/foundryup-zksync/foundryup-zksync b/foundryup-zksync/foundryup-zksync index c1a2d2735b..2edb1f9ce9 100755 --- a/foundryup-zksync/foundryup-zksync +++ b/foundryup-zksync/foundryup-zksync @@ -162,8 +162,11 @@ main() { fi # Compute the URL of the release tarball in the Foundry repository. + ARCHIVE_TAG=$(echo "$FOUNDRYUP_TAG" | tr '-' '_') RELEASE_URL="https://github.com/${FOUNDRYUP_REPO}/releases/download/${FOUNDRYUP_TAG}/" - BIN_ARCHIVE_URL="${RELEASE_URL}foundry_nightly_${PLATFORM}_${ARCHITECTURE}.$EXT" + BIN_ARCHIVE_URL="${RELEASE_URL}${ARCHIVE_TAG}_${PLATFORM}_${ARCHITECTURE}.$EXT" + MAN_TAG=$(echo "$FOUNDRYUP_TAG" | sed 's/^foundry-zksync-//') + MAN_TARBALL_URL="${RELEASE_URL}foundry_zksync_man_${MAN_TAG}.tar.gz" # Download and extract the binaries archive say "downloading latest forge, and cast" @@ -173,41 +176,40 @@ main() { ensure unzip "$tmp" -d "$FOUNDRY_VERSIONS_DIR/$FOUNDRYUP_TAG" rm -f "$tmp" else - tmp="$(mktemp -d 2>/dev/null || echo ".")/foundry.tar.gz" - ensure download "$BIN_ARCHIVE_URL" "$tmp" - # Make sure it's a valid tar archive. - ensure tar tf $tmp 1> /dev/null - ensure mkdir -p $FOUNDRY_VERSIONS_DIR/$FOUNDRYUP_TAG - ensure tar -C "$FOUNDRY_VERSIONS_DIR/$FOUNDRYUP_TAG" -xvf $tmp - rm -f "$tmp" + ensure mkdir -p "$FOUNDRY_VERSIONS_DIR/$ARCHIVE_TAG" + ensure download "$BIN_ARCHIVE_URL" | ensure tar -xzC "$FOUNDRY_VERSIONS_DIR/$ARCHIVE_TAG" fi # Optionally download the manuals if check_cmd tar; then - say "attempting to download manpages from release assets" + say "downloading manpages" mkdir -p "$FOUNDRY_MAN_DIR" - - ASSET_DATA=$(curl -s "https://api.github.com/repos/${FOUNDRYUP_REPO}/releases/tags/${FOUNDRYUP_TAG}") - - # Parse out the man asset name: - # e.g. "foundry_man_nightly-ae913af65381734ad46c044a9495b67310bc77c4.tar.gz" - MAN_ASSET_NAME=$(echo "$ASSET_DATA" | grep -oE '"name":\s*"foundry_man_nightly[^"]+' \ - | sed 's/"name": "//') - - if [ -n "$MAN_ASSET_NAME" ]; then - MAN_TARBALL_URL="${RELEASE_URL}${MAN_ASSET_NAME}" - say "Found manpage tarball: $MAN_TARBALL_URL" - download "$MAN_TARBALL_URL" | tar -xzC "$FOUNDRY_MAN_DIR" - else - say "No manpage tarball found for this release." - fi + download "$MAN_TARBALL_URL" | tar -xzC "$FOUNDRY_MAN_DIR" else say 'skipping manpage download: missing "tar"' fi - # Use newly installed version. - FOUNDRYUP_VERSION=$FOUNDRYUP_TAG - use + for bin in "${BINS[@]}"; do + bin_path="$FOUNDRY_BIN_DIR/$bin" + cp $FOUNDRY_VERSIONS_DIR/$ARCHIVE_TAG/$bin $bin_path + + # Print installed msg + say "installed - $(ensure "$bin_path" --version)" + + # Check if the default path of the binary is not in FOUNDRY_BIN_DIR + which_path="$(command -v "$bin" || true)" + if [ -n "$which_path" ] && [ "$which_path" != "$bin_path" ]; then + warn "" + cat 1>&2 <