From b65fedd6894497a4c9fbf38d558ccfaca535d1d2 Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:06:24 +0200 Subject: [PATCH] feat(contract-verifier): Support verification for zksolc v1.3.17 (#606) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Adds support for zksolc v1.3.17 to contract-verifier. ## Why ❔ Contract-verifier should support latest version ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [x] Spellcheck has been run via `cargo spellcheck --cfg=./spellcheck/era.cfg --code 1`. --- .github/workflows/ci-core-reusable.yml | 48 +++++++++---------- core/tests/ts-integration/hardhat.config.ts | 6 +-- .../ts-integration/scripts/compile-yul.ts | 2 +- .../tests/api/contract-verification.test.ts | 6 +-- docker/contract-verifier/Dockerfile | 6 ++- 5 files changed, 36 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 7ad0e54074cb..341a37a2c8c4 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -113,20 +113,20 @@ jobs: run: | sudo apt update && sudo apt install wget -y - mkdir -p $(pwd)/etc/solc-bin/0.8.21 - wget https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/solc-linux-amd64-v0.8.21%2Bcommit.d9974bed - mv solc-linux-amd64-v0.8.21+commit.d9974bed $(pwd)/etc/solc-bin/0.8.21/solc - chmod +x $(pwd)/etc/solc-bin/0.8.21/solc + mkdir -p $(pwd)/etc/solc-bin/0.8.23 + wget https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/solc-linux-amd64-v0.8.23%2Bcommit.f704f362 + mv solc-linux-amd64-v0.8.23+commit.f704f362 $(pwd)/etc/solc-bin/0.8.23/solc + chmod +x $(pwd)/etc/solc-bin/0.8.23/solc - mkdir -p $(pwd)/etc/zksolc-bin/v1.3.16 - wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.16 - mv zksolc-linux-amd64-musl-v1.3.16 $(pwd)/etc/zksolc-bin/v1.3.16/zksolc - chmod +x $(pwd)/etc/zksolc-bin/v1.3.16/zksolc + mkdir -p $(pwd)/etc/zksolc-bin/v1.3.17 + wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.17 + mv zksolc-linux-amd64-musl-v1.3.17 $(pwd)/etc/zksolc-bin/v1.3.17/zksolc + chmod +x $(pwd)/etc/zksolc-bin/v1.3.17/zksolc - mkdir -p $(pwd)/etc/vyper-bin/0.3.3 - wget -O vyper0.3.3 https://github.com/vyperlang/vyper/releases/download/v0.3.3/vyper.0.3.3%2Bcommit.48e326f0.linux - mv vyper0.3.3 $(pwd)/etc/vyper-bin/0.3.3/vyper - chmod +x $(pwd)/etc/vyper-bin/0.3.3/vyper + mkdir -p $(pwd)/etc/vyper-bin/0.3.10 + wget -O vyper0.3.10 https://github.com/vyperlang/vyper/releases/download/v0.3.10/vyper.0.3.10%2Bcommit.91361694.linux + mv vyper0.3.10 $(pwd)/etc/vyper-bin/0.3.10/vyper + chmod +x $(pwd)/etc/vyper-bin/0.3.10/vyper mkdir -p $(pwd)/etc/zkvyper-bin/v1.3.13 wget https://github.com/matter-labs/zkvyper-bin/raw/main/linux-amd64/zkvyper-linux-amd64-musl-v1.3.13 @@ -211,20 +211,20 @@ jobs: run: | sudo apt update && sudo apt install wget -y - mkdir -p $(pwd)/etc/solc-bin/0.8.21 - wget https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/solc-linux-amd64-v0.8.21%2Bcommit.d9974bed - mv solc-linux-amd64-v0.8.21+commit.d9974bed $(pwd)/etc/solc-bin/0.8.21/solc - chmod +x $(pwd)/etc/solc-bin/0.8.21/solc + mkdir -p $(pwd)/etc/solc-bin/0.8.23 + wget https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/solc-linux-amd64-v0.8.23%2Bcommit.f704f362 + mv solc-linux-amd64-v0.8.23+commit.f704f362 $(pwd)/etc/solc-bin/0.8.23/solc + chmod +x $(pwd)/etc/solc-bin/0.8.23/solc - mkdir -p $(pwd)/etc/zksolc-bin/v1.3.16 - wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.16 - mv zksolc-linux-amd64-musl-v1.3.16 $(pwd)/etc/zksolc-bin/v1.3.16/zksolc - chmod +x $(pwd)/etc/zksolc-bin/v1.3.16/zksolc + mkdir -p $(pwd)/etc/zksolc-bin/v1.3.17 + wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.17 + mv zksolc-linux-amd64-musl-v1.3.17 $(pwd)/etc/zksolc-bin/v1.3.17/zksolc + chmod +x $(pwd)/etc/zksolc-bin/v1.3.17/zksolc - mkdir -p $(pwd)/etc/vyper-bin/0.3.3 - wget -O vyper0.3.3 https://github.com/vyperlang/vyper/releases/download/v0.3.3/vyper.0.3.3%2Bcommit.48e326f0.linux - mv vyper0.3.3 $(pwd)/etc/vyper-bin/0.3.3/vyper - chmod +x $(pwd)/etc/vyper-bin/0.3.3/vyper + mkdir -p $(pwd)/etc/vyper-bin/0.3.10 + wget -O vyper0.3.10 https://github.com/vyperlang/vyper/releases/download/v0.3.10/vyper.0.3.10%2Bcommit.91361694.linux + mv vyper0.3.10 $(pwd)/etc/vyper-bin/0.3.10/vyper + chmod +x $(pwd)/etc/vyper-bin/0.3.10/vyper mkdir -p $(pwd)/etc/zkvyper-bin/v1.3.11 wget https://github.com/matter-labs/zkvyper-bin/raw/main/linux-amd64/zkvyper-linux-amd64-musl-v1.3.11 diff --git a/core/tests/ts-integration/hardhat.config.ts b/core/tests/ts-integration/hardhat.config.ts index 166feea91d9a..4840e46e82b0 100644 --- a/core/tests/ts-integration/hardhat.config.ts +++ b/core/tests/ts-integration/hardhat.config.ts @@ -4,7 +4,7 @@ import '@matterlabs/hardhat-zksync-vyper'; export default { zksolc: { - version: '1.3.16', + version: '1.3.17', compilerSource: 'binary', settings: { isSystem: true @@ -20,9 +20,9 @@ export default { } }, solidity: { - version: '0.8.21' + version: '0.8.23' }, vyper: { - version: '0.3.3' + version: '0.3.10' } }; diff --git a/core/tests/ts-integration/scripts/compile-yul.ts b/core/tests/ts-integration/scripts/compile-yul.ts index 26f779878ae2..f92c259723c5 100644 --- a/core/tests/ts-integration/scripts/compile-yul.ts +++ b/core/tests/ts-integration/scripts/compile-yul.ts @@ -7,7 +7,7 @@ import { getZksolcUrl, saltFromUrl } from '@matterlabs/hardhat-zksync-solc'; import { getCompilersDir } from 'hardhat/internal/util/global-dir'; import path from 'path'; -const COMPILER_VERSION = '1.3.16'; +const COMPILER_VERSION = '1.3.17'; const IS_COMPILER_PRE_RELEASE = false; async function compilerLocation(): Promise { diff --git a/core/tests/ts-integration/tests/api/contract-verification.test.ts b/core/tests/ts-integration/tests/api/contract-verification.test.ts index cfda8a810740..984361fb7b31 100644 --- a/core/tests/ts-integration/tests/api/contract-verification.test.ts +++ b/core/tests/ts-integration/tests/api/contract-verification.test.ts @@ -9,11 +9,11 @@ import { sleep } from 'zksync-web3/build/src/utils'; // Regular expression to match ISO dates. const DATE_REGEX = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{6})?/; -const ZKSOLC_VERSION = 'v1.3.16'; -const SOLC_VERSION = '0.8.21'; +const ZKSOLC_VERSION = 'v1.3.17'; +const SOLC_VERSION = '0.8.23'; const ZKVYPER_VERSION = 'v1.3.13'; -const VYPER_VERSION = '0.3.3'; +const VYPER_VERSION = '0.3.10'; type HttpMethod = 'POST' | 'GET'; diff --git a/docker/contract-verifier/Dockerfile b/docker/contract-verifier/Dockerfile index 1f244b389066..21ce6946489b 100644 --- a/docker/contract-verifier/Dockerfile +++ b/docker/contract-verifier/Dockerfile @@ -24,7 +24,7 @@ RUN apt-get update && apt-get install -y curl libpq5 ca-certificates wget python # install zksolc 1.3.x RUN skip_versions="v1.3.12 v1.3.15" && \ - for VERSION in $(seq -f "v1.3.%g" 0 16); do \ + for VERSION in $(seq -f "v1.3.%g" 0 17); do \ if echo " $skip_versions " | grep -q -w " $VERSION "; then \ continue; \ fi; \ @@ -53,6 +53,10 @@ RUN mkdir -p /etc/vyper-bin/0.3.9 \ && wget -O vyper0.3.9 https://github.com/vyperlang/vyper/releases/download/v0.3.9/vyper.0.3.9%2Bcommit.66b96705.linux \ && mv vyper0.3.9 /etc/vyper-bin/0.3.9/vyper \ && chmod +x /etc/vyper-bin/0.3.9/vyper +RUN mkdir -p /etc/vyper-bin/0.3.10 \ + && wget -O vyper0.3.10 https://github.com/vyperlang/vyper/releases/download/v0.3.10/vyper.0.3.10%2Bcommit.91361694.linux \ + && mv vyper0.3.10 /etc/vyper-bin/0.3.10/vyper \ + && chmod +x /etc/vyper-bin/0.3.10/vyper COPY --from=builder /usr/src/zksync/target/release/zksync_contract_verifier /usr/bin/ COPY etc/system-contracts/bootloader/build/artifacts/ /etc/system-contracts/bootloader/build/artifacts/