Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
ColoCarletti committed May 7, 2024
2 parents 32d781f + bb5f129 commit a45ba48
Show file tree
Hide file tree
Showing 179 changed files with 2,053 additions and 1,258 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"core": "24.0.0",
"prover": "13.0.0"
"prover": "14.0.0"
}
9 changes: 7 additions & 2 deletions .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ on:
type: string
required: false
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19", "1.3.21"] } , { "zkvyper": ["1.3.13"] }]'
en_alpha_release:
description: 'Flag that determins if EN release should be marked as alpha'
type: boolean
required: false
default: false
jobs:
build-images:
name: Build and Push Docker Images
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
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')] }}
strategy:
matrix:
Expand Down Expand Up @@ -164,7 +169,7 @@ jobs:
- name: snapshots-creator
platform: linux/amd64
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}${{ (inputs.en_alpha_release && matrix.components == 'external-node') && '-alpha' || '' }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-docker-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
en_alpha_release: true

build-push-contract-verifier:
name: Build and push image
Expand Down
55 changes: 42 additions & 13 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,15 @@ jobs:
ci_run cat /tmp/sccache_log.txt
integration:
name: Integration (consensus=${{ matrix.consensus }}, base_token=${{ matrix.base_token }})
name: Integration (consensus=${{ matrix.consensus }}, base_token=${{ matrix.base_token }}, deployment_mode=${{ matrix.deployment_mode }})
strategy:
# In matrix jobs, fail-fast is true by default.
# To be consistent with the rest of the workflow we disable it explicitly.
fail-fast: false
matrix:
consensus: [false, true]
base_token: ["Eth", "Custom"]
deployment_mode: ["Rollup", "Validium"]
env:
SERVER_COMPONENTS: "api,tree,eth,state_keeper,housekeeper,basic_witness_input_producer,commitment_generator${{ matrix.consensus && ',consensus' || '' }}"

Expand Down Expand Up @@ -190,8 +191,13 @@ jobs:
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
ci_run zk config compile
ci_run zk init ${{ matrix.base_token == 'Custom' && '--base-token-name BAT' || ''}}
if [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ci_run zk env dev_validium_docker
ci_run zk config compile dev_validium_docker
else
ci_run zk config compile
fi
ci_run zk init ${{ matrix.base_token == 'Custom' && '--base-token-name BAT' || ''}} ${{ matrix.deployment_mode == 'Validium' && '--validium-mode' || ''}}
# `sleep 5` because we need to wait until server started properly
- name: Run server
Expand All @@ -212,7 +218,11 @@ jobs:
# An empty topmost environment helps avoid a mess when redefining env vars shared between both envs
# (e.g., DATABASE_URL).
run: |
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=Rollup PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run yarn snapshot-recovery-test snapshot-recovery-test
if [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ci_run zk config compile ext-node-validium
ci_run zk config compile ext-node-validium-docker
fi
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=${{ matrix.deployment_mode }} PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run yarn snapshot-recovery-test snapshot-recovery-test
- name: Fee projection tests
run: ci_run zk test i fees
Expand All @@ -221,7 +231,7 @@ jobs:
run: |
ci_run pkill zksync_server || true
ci_run sleep 2
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=Rollup PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run zk test i revert
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=${{ matrix.deployment_mode }} PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run zk test i revert
# This test should be the last one as soon as it
Expand Down Expand Up @@ -262,12 +272,13 @@ jobs:
ci_run cat /tmp/sccache_log.txt
external-node:
name: External node (consensus=${{ matrix.consensus }}, base_token=${{ matrix.base_token }})
name: External node (consensus=${{ matrix.consensus }}, base_token=${{ matrix.base_token }}, deployment_mode=${{ matrix.deployment_mode }})
strategy:
fail-fast: false
matrix:
consensus: [false, true]
base_token: ["Eth", "Custom"]
deployment_mode: ["Rollup", "Validium"]
runs-on: [matterlabs-ci-runner]

env:
Expand Down Expand Up @@ -301,8 +312,13 @@ jobs:
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
ci_run zk config compile
ci_run zk init ${{ matrix.base_token == 'Custom' && '--base-token-name BAT' || ''}}
if [[ "${{ matrix.deployment_mode }}" == "Rollup" ]]; then
ci_run zk config compile
elif [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ci_run zk env dev_validium_docker
ci_run zk config compile dev_validium_docker
fi
ci_run zk init ${{ matrix.base_token == 'Custom' && '--base-token-name BAT' || ''}} ${{ matrix.deployment_mode == 'Validium' && '--validium-mode' || ''}}
# `sleep 30` because we need to wait until server started properly
- name: Run server
Expand All @@ -312,7 +328,11 @@ jobs:
- name: Run external node
run: |
ci_run zk env ext-node-docker
if [[ "${{ matrix.deployment_mode }}" == "Rollup" ]]; then
ci_run zk env ext-node-docker
elif [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ci_run zk env ext-node-validium-docker
fi
ci_run zk db setup
ci_run zk external-node $EXT_NODE_FLAGS &>>ext-node.log &
ci_run sleep 30
Expand All @@ -322,15 +342,24 @@ jobs:

- name: Run revert test
run: |
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=Rollup PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run zk test i revert-en
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=${{ matrix.deployment_mode }} PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run zk test i revert-en
# test terminates the nodes, so we restart them.
ZKSYNC_ENV=docker ci_run zk server --components=$SERVER_COMPONENTS &>>server.log &
ZKSYNC_ENV=ext-node-docker ci_run zk external-node $EXT_NODE_FLAGS &>>ext-node.log &
if [[ "${{ matrix.deployment_mode }}" == "Rollup" ]]; then
ZKSYNC_ENV=docker ci_run zk server --components=$SERVER_COMPONENTS &>>server.log &
ZKSYNC_ENV=ext-node-docker ci_run zk external-node $EXT_NODE_FLAGS &>>ext-node.log &
elif [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ZKSYNC_ENV=dev_validium_docker ci_run zk server --components=$SERVER_COMPONENTS &>>server.log &
ZKSYNC_ENV=ext-node-validium-docker ci_run zk external-node $EXT_NODE_FLAGS &>>ext-node.log &
fi
ci_run sleep 30
- name: Run upgrade test
run: |
ci_run zk env docker
if [[ "${{ matrix.deployment_mode }}" == "Rollup" ]]; then
ci_run zk env docker
elif [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ci_run zk env dev_validium_docker
fi
CHECK_EN_URL="http://0.0.0.0:3060" ci_run zk test i upgrade
- name: Show server.log logs
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/release-please-cargo-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
push:
branches:
- release-please--branches--main--components--core

name: release-please-update-cargo-lock
jobs:
update_cargo_lock:
runs-on: [matterlabs-default-infra-runners]

steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
submodules: "recursive"

- name: Setup environment
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo IN_DOCKER=1 >> .env
- name: Start services
run: |
docker compose up -d zk
- name: Cargo check
run: ci_run cargo check

- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
git config --global user.email "zksync-era-bot@users.noreply.github.com"
git config --global user.name "zksync-era-bot"
git add ./Cargo.lock
git commit -m "Update Cargo.lock"
git push
34 changes: 34 additions & 0 deletions .github/workflows/release-stable-en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Workflow to push stable EN image

on:
workflow_call:
inputs:
tag_name:
description: "Tag of an image"
type: string
required: true

jobs:
release:
runs-on: [matterlabs-ci-runner]
steps:
- name: Login to Docker registries
run: docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Check if alpha image exists
run: |
set +e
docker manifest inspect matterlabs/external-node:${{ inputs.tag_name }}-alpha >/dev/null 2>&1
exitcode=$?
set -e
if [[ "$exitcode" -eq "1" ]]; then
echo "Image matterlabs/external-node:${{ inputs.tag_name }} doesn't exist"
exit 1
fi
- name: Push stable image
run: |
docker pull matterlabs/external-node:${{ inputs.tag_name }}-alpha
docker tag matterlabs/external-node:${{ inputs.tag_name }}-alpha \
matterlabs/external-node:${{ inputs.tag_name }}
docker push matterlabs/external-node:${{ inputs.tag_name }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ Cargo.lock

/etc/env/target/*
/etc/env/.current
/etc/env/configs
/etc/env/configs/*
!/etc/env/configs/dev.toml
!/etc/env/configs/dev_validium.toml
!/etc/env/configs/dev_validium_docker.toml
!/etc/env/configs/ext-node.toml
!/etc/env/configs/ext-node-validium.toml
!/etc/env/configs/ext-node-docker.toml
!/etc/env/configs/ext-node-validium-docker.toml
/etc/env/l1-inits
/etc/env/l2-inits
!/etc/env/base
Expand Down
Loading

0 comments on commit a45ba48

Please sign in to comment.