From 5270d6698e65790eddb922b242ad6075b40fcbc4 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 16 Oct 2023 16:00:40 +0400 Subject: [PATCH 1/5] add workflow in main to be able to run in v1.4.0 --- .../workflows/geometry-config-generator.yml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/geometry-config-generator.yml diff --git a/.github/workflows/geometry-config-generator.yml b/.github/workflows/geometry-config-generator.yml new file mode 100644 index 00000000..4b0cce71 --- /dev/null +++ b/.github/workflows/geometry-config-generator.yml @@ -0,0 +1,80 @@ +name: Geometry config generator + +on: + workflow_dispatch: + inputs: + target_branch: + description: "Target branch to generate geometry config against" + type: string + required: true + default: "v1.4.0" + push: + branches: + - add-geometry-config-generator-workflow + + permissions: + contents: write + pull-requests: write + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + estimate-circuit-limit: + runs-on: [ubuntu-latest] + strategy: + matrix: + key: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] + steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3 + - name: Setup Rust + run: | + curl https://sh.rustup.rs -sSf | bash -s -- -y + source "$HOME/.cargo/env" + sudo apt update && sudo apt install clang openssl libssl-dev gcc g++ pkg-config build-essential libclang-dev -y + - name: Estimate circuit limit + run: | + source "$HOME/.cargo/env" + cargo run --release --bin circuit_limit_estimator -- --numeric-circuit ${{ matrix.key }} + - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3 + with: + path: ./circuit_limit_${{ matrix.key }}.txt + + create-pr: + runs-on: [ubuntu-latest] + needs: ["estimate-circuit-limit"] + steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3 + - uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3 + with: + path: ./ + - name: Rename downloaded path + run: | + mv artifact/* ./ + - name: Setup Rust + run: | + curl https://sh.rustup.rs -sSf | bash -s -- -y + source "$HOME/.cargo/env" + sudo apt update && sudo apt install clang openssl libssl-dev gcc g++ pkg-config build-essential libclang-dev -y + - name: Generate commitment + run: | + source "$HOME/.cargo/env" + cargo run --release --bin geometry_config_generator -- --code-decommitter $(cat circuit_limit_5.txt) --code-decommitter-sorter $(cat circuit_limit_4.txt) --ecrecover $(cat circuit_limit_9.txt) --events-or-l1-messages-sorter $(cat circuit_limit_15.txt) --initial-writes $(cat circuit_limit_13.txt) --keccak256 $(cat circuit_limit_7.txt) --log-demuxer $(cat circuit_limit_6.txt) --ram-permutation $(cat circuit_limit_10.txt) --repeated-writes $(cat circuit_limit_14.txt) --sha256 $(cat circuit_limit_8.txt) --storage-application $(cat circuit_limit_12.txt) --storage-sorter $(cat circuit_limit_11.txt) --vm-snapshot $(cat circuit_limit_3.txt) --l1-messages-merklizer $(cat circuit_limit_18.txt) --l1-messages-pudata-hasher $(cat circuit_limit_17.txt) + rm -rf circuit_limit_* + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@d7db273d6c7206ba99224e659c982ae34a1025e3 # v4 + with: + base: ${{ github.event.inputs.target_branch }} + commit-message: update generated geometry config + committer: zksync-admin-bot2 + author: zksync-admin-bot2 + signoff: false + branch: update-geometry-config + branch-suffix: short-commit-hash + delete-branch: true + title: Update geometry config from branch ${{ github.event.inputs.target_branch }} + body: | + Update generated geometry config from branch ${{ github.event.inputs.target_branch }} + draft: false From 3933e6b9474dc0e1efa6b2f18bc751ef5c7e3518 Mon Sep 17 00:00:00 2001 From: Akash <112477155+akash-chandrakar@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:23:52 +0400 Subject: [PATCH 2/5] Update geometry-config-generator.yml --- .github/workflows/geometry-config-generator.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/geometry-config-generator.yml b/.github/workflows/geometry-config-generator.yml index 4b0cce71..ef9fdbb0 100644 --- a/.github/workflows/geometry-config-generator.yml +++ b/.github/workflows/geometry-config-generator.yml @@ -1,5 +1,9 @@ name: Geometry config generator +permissions: + contents: write + pull-requests: write + on: workflow_dispatch: inputs: @@ -12,9 +16,6 @@ on: branches: - add-geometry-config-generator-workflow - permissions: - contents: write - pull-requests: write concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 33465677d9b04723b08c7505f6abfa2e430be57e Mon Sep 17 00:00:00 2001 From: Akash <112477155+akash-chandrakar@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:25:07 +0400 Subject: [PATCH 3/5] Update geometry-config-generator.yml --- .github/workflows/geometry-config-generator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/geometry-config-generator.yml b/.github/workflows/geometry-config-generator.yml index ef9fdbb0..6b778334 100644 --- a/.github/workflows/geometry-config-generator.yml +++ b/.github/workflows/geometry-config-generator.yml @@ -14,7 +14,7 @@ on: default: "v1.4.0" push: branches: - - add-geometry-config-generator-workflow + - main concurrency: From 8350ad0b4b12678782af0f66c9086b42c04b47d0 Mon Sep 17 00:00:00 2001 From: Akash <112477155+akash-chandrakar@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:26:01 +0400 Subject: [PATCH 4/5] Update geometry-config-generator.yml --- .github/workflows/geometry-config-generator.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/geometry-config-generator.yml b/.github/workflows/geometry-config-generator.yml index 6b778334..fb6102a6 100644 --- a/.github/workflows/geometry-config-generator.yml +++ b/.github/workflows/geometry-config-generator.yml @@ -12,9 +12,7 @@ on: type: string required: true default: "v1.4.0" - push: - branches: - - main + pull_request: concurrency: From efca3618028efaea546fcdbba9f47a0aeafea7fc Mon Sep 17 00:00:00 2001 From: Akash <112477155+akash-chandrakar@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:59:59 +0400 Subject: [PATCH 5/5] Update geometry-config-generator.yml --- .github/workflows/geometry-config-generator.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/geometry-config-generator.yml b/.github/workflows/geometry-config-generator.yml index fb6102a6..9c5b42f6 100644 --- a/.github/workflows/geometry-config-generator.yml +++ b/.github/workflows/geometry-config-generator.yml @@ -59,8 +59,8 @@ jobs: - name: Generate commitment run: | source "$HOME/.cargo/env" - cargo run --release --bin geometry_config_generator -- --code-decommitter $(cat circuit_limit_5.txt) --code-decommitter-sorter $(cat circuit_limit_4.txt) --ecrecover $(cat circuit_limit_9.txt) --events-or-l1-messages-sorter $(cat circuit_limit_15.txt) --initial-writes $(cat circuit_limit_13.txt) --keccak256 $(cat circuit_limit_7.txt) --log-demuxer $(cat circuit_limit_6.txt) --ram-permutation $(cat circuit_limit_10.txt) --repeated-writes $(cat circuit_limit_14.txt) --sha256 $(cat circuit_limit_8.txt) --storage-application $(cat circuit_limit_12.txt) --storage-sorter $(cat circuit_limit_11.txt) --vm-snapshot $(cat circuit_limit_3.txt) --l1-messages-merklizer $(cat circuit_limit_18.txt) --l1-messages-pudata-hasher $(cat circuit_limit_17.txt) - rm -rf circuit_limit_* + # cargo run --release --bin geometry_config_generator -- --code-decommitter $(cat circuit_limit_5.txt) --code-decommitter-sorter $(cat circuit_limit_4.txt) --ecrecover $(cat circuit_limit_9.txt) --events-or-l1-messages-sorter $(cat circuit_limit_15.txt) --initial-writes $(cat circuit_limit_13.txt) --keccak256 $(cat circuit_limit_7.txt) --log-demuxer $(cat circuit_limit_6.txt) --ram-permutation $(cat circuit_limit_10.txt) --repeated-writes $(cat circuit_limit_14.txt) --sha256 $(cat circuit_limit_8.txt) --storage-application $(cat circuit_limit_12.txt) --storage-sorter $(cat circuit_limit_11.txt) --vm-snapshot $(cat circuit_limit_3.txt) --l1-messages-merklizer $(cat circuit_limit_18.txt) --l1-messages-pudata-hasher $(cat circuit_limit_17.txt) + # rm -rf circuit_limit_* - name: Create Pull Request id: cpr uses: peter-evans/create-pull-request@d7db273d6c7206ba99224e659c982ae34a1025e3 # v4