Skip to content

Commit

Permalink
Merge branch 'matter-labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulmalikGiwa authored Sep 2, 2024
2 parents 99218e1 + 6d18061 commit d49ed75
Show file tree
Hide file tree
Showing 990 changed files with 21,504 additions and 10,733 deletions.
6 changes: 3 additions & 3 deletions .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "24.16.0",
"prover": "16.3.0",
"zk_toolbox": "0.1.1"
"core": "24.23.0",
"prover": "16.5.0",
"zk_toolbox": "0.1.2"
}
5 changes: 3 additions & 2 deletions .github/workflows/build-contract-verifier-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: Build and Push Docker Images
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
runs-on: ${{ fromJSON('["matterlabs-ci-runner", "matterlabs-ci-runner-arm"]')[contains(matrix.platforms, 'arm')] }}
runs-on: ${{ fromJSON('["matterlabs-ci-runner-high-performance", "matterlabs-ci-runner-arm"]')[contains(matrix.platforms, 'arm')] }}
strategy:
matrix:
components:
Expand Down Expand Up @@ -149,7 +149,8 @@ jobs:
create_manifest:
name: Create release manifest
runs-on: matterlabs-ci-runner
# TODO: After migraton switch to CI
runs-on: matterlabs-default-infra-runners
needs: build-images
if: ${{ inputs.action == 'push' }}
strategy:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
name: Build and Push Docker Images
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}${{ (inputs.en_alpha_release && matrix.components == 'external-node') && '-alpha' || '' }}
runs-on: ${{ fromJSON('["matterlabs-ci-runner", "matterlabs-ci-runner-arm"]')[contains(matrix.platforms, 'arm')] }}
runs-on: ${{ fromJSON('["matterlabs-ci-runner-high-performance", "matterlabs-ci-runner-arm"]')[contains(matrix.platforms, 'arm')] }}
strategy:
matrix:
components:
Expand Down Expand Up @@ -158,7 +158,8 @@ jobs:
create_manifest:
name: Create release manifest
runs-on: matterlabs-ci-runner
# TODO: After migraton switch to CI
runs-on: matterlabs-default-infra-runners
needs: build-images
if: ${{ inputs.action == 'push' }}
strategy:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/build-docker-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ jobs:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build-push-witness-generator-image-avx512:
name: Build and push image
needs: [setup]
uses: ./.github/workflows/build-witness-generator-template.yml
if: contains(github.ref_name, 'prover')
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: "60;70;75;89"
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build-gar-prover-fri-gpu:
name: Build GAR prover FRI GPU
needs: [setup, build-push-prover-images]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-local-node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
build-images:
name: Local Node - Build and Push Docker Image
runs-on: [matterlabs-ci-runner]
runs-on: [matterlabs-ci-runner-high-performance]
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-prover-fri-gpu-gar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
build-gar-prover-fri-gpu:
name: Build prover FRI GPU GAR
runs-on: [matterlabs-ci-runner]
runs-on: [matterlabs-ci-runner-high-performance]
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ jobs:
RUNNER_COMPOSE_FILE: "docker-compose-runner-nightly.yml"
ERA_BELLMAN_CUDA_RELEASE: ${{ inputs.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: ${{ inputs.CUDA_ARCH }}
runs-on: [ matterlabs-ci-runner ]
runs-on: [ matterlabs-ci-runner-high-performance ]
strategy:
matrix:
component:
- witness-generator
- prover-gpu-fri
- witness-vector-generator
- prover-fri-gateway
- prover-job-monitor
- proof-fri-gpu-compressor
outputs:
protocol_version: ${{ steps.protocolversion.outputs.protocol_version }}
Expand Down Expand Up @@ -163,14 +164,15 @@ jobs:
run: |
ci_run sccache --show-stats || true
ci_run cat /tmp/sccache_log.txt || true
copy-images:
name: Copy images between docker registries
needs: build-images
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
PROTOCOL_VERSION: ${{ needs.build-images.outputs.protocol_version }}
runs-on: matterlabs-ci-runner
# TODO: After migraton switch to CI
runs-on: matterlabs-default-infra-runners
if: ${{ inputs.action == 'push' }}
strategy:
matrix:
Expand All @@ -197,4 +199,3 @@ jobs:
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ needs.build-images.outputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ needs.build-images.outputs.protocol_version }}-${{ inputs.image_tag_suffix }}
2 changes: 1 addition & 1 deletion .github/workflows/build-tee-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: Build and Push Docker Images
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
runs-on: [matterlabs-ci-runner]
runs-on: [matterlabs-ci-runner-high-performance]
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down
172 changes: 172 additions & 0 deletions .github/workflows/build-witness-generator-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: Build witness generator image with custom compiler flags
on:
workflow_call:
secrets:
DOCKERHUB_USER:
description: "DOCKERHUB_USER"
required: true
DOCKERHUB_TOKEN:
description: "DOCKERHUB_TOKEN"
required: true
inputs:
ERA_BELLMAN_CUDA_RELEASE:
description: "ERA_BELLMAN_CUDA_RELEASE"
type: string
required: true
image_tag_suffix:
description: "Optional suffix to override tag name generation"
type: string
required: false
action:
description: "Action with docker image"
type: string
default: "push"
required: false
is_pr_from_fork:
description: "Indicates whether the workflow is invoked from a PR created from fork"
type: boolean
default: false
required: false
CUDA_ARCH:
description: "CUDA Arch to build"
type: string
default: "89"
required: false
WITNESS_GENERATOR_RUST_FLAGS:
description: "Rust flags for witness_generator compilation"
type: string
default: ""
required: false
outputs:
protocol_version:
description: "Protocol version of the binary"
value: ${{ jobs.build-images.outputs.protocol_version }}

jobs:
build-images:
name: Build and Push Docker Images
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
RUNNER_COMPOSE_FILE: "docker-compose-runner-nightly.yml"
ERA_BELLMAN_CUDA_RELEASE: ${{ inputs.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: ${{ inputs.CUDA_ARCH }}
WITNESS_GENERATOR_RUST_FLAGS: ${{ inputs.WITNESS_GENERATOR_RUST_FLAGS }}
runs-on: [ matterlabs-ci-runner-c3d ]
strategy:
matrix:
component:
- witness-generator
outputs:
protocol_version: ${{ steps.protocolversion.outputs.protocol_version }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
submodules: "recursive"

- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo CI=1 >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo CI=1 >> .env
echo IN_DOCKER=1 >> .env
- name: start-services
run: |
echo "IMAGE_TAG_SUFFIX=${{ env.IMAGE_TAG_SUFFIX }}" >> .env
mkdir -p ./volumes/postgres
run_retried docker compose pull zk postgres
docker compose up -d zk postgres
ci_run sccache --start-server
- name: init
run: |
ci_run git config --global --add safe.directory /usr/src/zksync
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
ci_run zk
- name: download CRS for GPU compressor
if: matrix.component == 'proof-fri-gpu-compressor'
run: |
ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^24.key
- name: login to Docker registries
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
ci_run docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
ci_run gcloud auth configure-docker us-docker.pkg.dev -q
# We need to run this only when ERA_BELLMAN_CUDA_RELEASE is not available
# In our case it happens only when PR is created from fork
- name: Wait for runner IP to be not rate-limited against GH API
if: inputs.is_pr_from_fork == true
run: |
api_endpoint="https://api.github.com/users/zksync-era-bot"
wait_time=60
max_retries=60
retry_count=0
while [[ $retry_count -lt $max_retries ]]; do
response=$(run_retried curl -s -w "%{http_code}" -o temp.json "$api_endpoint")
http_code=$(echo "$response" | tail -n1)
if [[ "$http_code" == "200" ]]; then
echo "Request successful. Not rate-limited."
cat temp.json
rm temp.json
exit 0
elif [[ "$http_code" == "403" ]]; then
rate_limit_exceeded=$(jq -r '.message' temp.json | grep -i "API rate limit exceeded")
if [[ -n "$rate_limit_exceeded" ]]; then
retry_count=$((retry_count+1))
echo "API rate limit exceeded. Retry $retry_count of $max_retries. Retrying in $wait_time seconds..."
sleep $wait_time
else
echo "Request failed with HTTP status $http_code."
cat temp.json
rm temp.json
exit 1
fi
else
echo "Request failed with HTTP status $http_code."
cat temp.json
rm temp.json
exit 1
fi
done
echo "Reached the maximum number of retries ($max_retries). Exiting."
rm temp.json
exit 1
- name: protocol-version
id: protocolversion
# TODO: use -C flag, when it will become stable.
shell: bash
run: |
ci_run bash -c "cd prover && cargo build --release --bin prover_version"
PPV=$(ci_run prover/target/release/prover_version)
echo Protocol version is ${PPV}
echo "protocol_version=${PPV}" >> $GITHUB_OUTPUT
echo "PROTOCOL_VERSION=${PPV}" >> $GITHUB_ENV
- name: setup-rust-flags-env
if: matrix.component == 'witness-generator'
run: |
echo RUST_FLAGS="${{ env.WITNESS_GENERATOR_RUST_FLAGS }}" >> $GITHUB_ENV
- name: update-images
env:
DOCKER_ACTION: ${{ inputs.action }}
COMPONENT: ${{ matrix.component }}
run: |
PASSED_ENV_VARS="ERA_BELLMAN_CUDA_RELEASE,CUDA_ARCH,PROTOCOL_VERSION,RUST_FLAGS" \
ci_run zk docker $DOCKER_ACTION $COMPONENT
- name: Show sccache stats
if: always()
run: |
ci_run sccache --show-stats || true
ci_run cat /tmp/sccache_log.txt || true
4 changes: 2 additions & 2 deletions .github/workflows/cargo-license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- uses: EmbarkStudios/cargo-deny-action@68cd9c5e3e16328a430a37c743167572e3243e7e
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # v2.0.1
35 changes: 33 additions & 2 deletions .github/workflows/check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Check PR title
on:
pull_request_target:
pull_request:
types:
- opened
- reopened
Expand All @@ -12,7 +12,38 @@ jobs:
runs-on: ubuntu-latest
permissions:
statuses: write
pull-requests: write
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Examples of valid PR titles:
- feat(eth_sender): Support new transaction type
- fix(state_keeper): Correctly handle edge case
- ci: Add new workflow for linting
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2
with:
header: pr-title-lint-error
delete: true
2 changes: 1 addition & 1 deletion .github/workflows/ci-common-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
build:
runs-on: [matterlabs-ci-runner]
runs-on: matterlabs-ci-runner-highmem-long
env:
RUNNER_COMPOSE_FILE: "docker-compose-runner-nightly.yml"

Expand Down
Loading

0 comments on commit d49ed75

Please sign in to comment.