Skip to content

Commit

Permalink
Merge branch 'main' of github.com:matter-labs/zksync-era into kl/fact…
Browse files Browse the repository at this point in the history
…ory-migration-fix-4
  • Loading branch information
kelemeno committed May 8, 2024
2 parents 9c4c59d + a704bce commit 72cec66
Show file tree
Hide file tree
Showing 553 changed files with 14,557 additions and 9,082 deletions.
4 changes: 2 additions & 2 deletions .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"core": "23.1.0",
"prover": "13.0.0"
"core": "24.1.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.component.name == '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
59 changes: 44 additions & 15 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,17 @@ 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' || '' }}"
SERVER_COMPONENTS: "api,tree,eth,state_keeper,housekeeper,commitment_generator${{ matrix.consensus && ',consensus' || '' }}"

runs-on: [matterlabs-ci-runner]
steps:
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,16 +272,17 @@ 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:
SERVER_COMPONENTS: "api,tree,eth,state_keeper,housekeeper,basic_witness_input_producer,commitment_generator${{ matrix.consensus && ',consensus' || '' }}"
SERVER_COMPONENTS: "api,tree,eth,state_keeper,housekeeper,commitment_generator${{ matrix.consensus && ',consensus' || '' }}"
EXT_NODE_FLAGS: "${{ matrix.consensus && '-- --enable-consensus' || '' }}"

steps:
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
4 changes: 3 additions & 1 deletion .github/workflows/protobuf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,6 @@ jobs:
with:
github_token: ${{ github.token }}
- name: buf breaking
run: buf breaking './after.binpb' --against './before.binpb' --config '{"version":"v1","breaking":{"use":["WIRE_JSON","WIRE"]}}' --error-format 'github-actions'
run: >
buf breaking './after.binpb' --against './before.binpb' --exclude-path 'zksync/config/experimental.proto'
--config '{"version":"v1","breaking":{"use":["WIRE_JSON","WIRE"]}}' --error-format 'github-actions'
54 changes: 54 additions & 0 deletions .github/workflows/release-please-cargo-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
branches:
- release-please--branches--main--components--core

name: release-please-update-cargo-lock
jobs:
update_cargo_lock:
runs-on: [matterlabs-ci-runner]

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

- name: Check last commit
id: condition
run: |
COMMIT=$(git log -1 --pretty=%B)
if [[ "$COMMIT" == "Update Cargo.lock" ]]; then
echo "Cargo.lock is already updated"
echo "::set-output name=skip_steps::true"
else
echo "Cargo.lock should be updated"
echo "::set-output name=skip_steps::false"
fi
- name: Setup environment
if: steps.condition.outputs.skip_steps != 'true'
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo IN_DOCKER=1 >> .env
- name: Start services
if: steps.condition.outputs.skip_steps != 'true'
run: docker compose up -d zk

- name: Cargo check
if: steps.condition.outputs.skip_steps != 'true'
run: ci_run cargo check

- name: Push changes
if: steps.condition.outputs.skip_steps != 'true'
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 remote set-url origin 'https://${{ secrets.RELEASE_TOKEN }}@github.com/matter-labs/zksync-era.git'
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: Release stable EN image

on:
workflow_dispatch:
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 }}
7 changes: 6 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 Expand Up @@ -91,3 +93,6 @@ verified_sources
hyperchain-*.yml
/etc/hyperchains/prover-keys
/etc/hyperchains/artifacts

# Prover keys that should not be commited
prover/vk_setup_data_generator_server_fri/data/setup_*
3 changes: 2 additions & 1 deletion .solhintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
lib/
# Ignore contract submodules
contracts
contracts
Loading

0 comments on commit 72cec66

Please sign in to comment.