Skip to content

Commit

Permalink
merge sync-layer-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
juan518munoz committed Dec 27, 2024
2 parents 4a997fc + 69ea2c6 commit f57fde0
Show file tree
Hide file tree
Showing 315 changed files with 11,478 additions and 1,986 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build Prover FRI GPU & Circuit Prover GPU with builtin setup data

on:
workflow_call:
secrets:
inputs:
image_tag_suffix:
description: "Commit sha or git tag for Docker tag"
Expand Down
82 changes: 68 additions & 14 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
run: |
ci_run zkstack dev contracts
- name: Contracts unit tests
run: ci_run yarn l1-contracts test
# - name: Contracts unit tests
# run: ci_run yarn l1-contracts test

- name: Download compilers for contract verifier tests
run: ci_run zkstack contract-verifier init --zksolc-version=v1.5.3 --zkvyper-version=v1.5.4 --solc-version=0.8.26 --vyper-version=v0.3.10 --era-vm-solc-version=0.8.26-1.0.1 --only --chain era
Expand All @@ -82,7 +82,7 @@ jobs:
ci_run zkstack dev test rust
# Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible
# with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually.
ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch
# ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch

loadtest:
runs-on: [ matterlabs-ci-runner-high-performance ]
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
--legacy-bridge \
--evm-emulator false
ci_run zkstack ecosystem init --dev --verbose
ci_run zkstack ecosystem init --dev --support-l2-legacy-shared-bridge-test true --verbose
# `sleep 60` because we need to wait until server added all the tokens
- name: Run server
Expand Down Expand Up @@ -270,7 +270,8 @@ jobs:
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_validium \
--chain validium
--chain validium \
--validium-type no-da
- name: Create and initialize chain with Custom Token
run: |
Expand All @@ -292,7 +293,8 @@ jobs:
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_custom_token \
--chain custom_token
--chain custom_token \
--validium-type no-da
- name: Create and register chain with transactions signed "offline"
run: |
Expand All @@ -314,7 +316,7 @@ jobs:
governor_pk=$(awk '/governor:/ {flag=1} flag && /private_key:/ {print $2; exit}' ./configs/wallets.yaml)
ci_run zkstack dev send-transactions \
--file ./transactions/chain/offline_chain/register-hyperchain-txns.json \
--file ./transactions/chain/offline_chain/register-zk-chain-txns.json \
--l1-rpc-url http://127.0.0.1:8545 \
--private-key $governor_pk
Expand Down Expand Up @@ -350,13 +352,59 @@ jobs:
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_consensus \
--chain consensus
--chain consensus \
--validium-type no-da
- name: Export chain list to environment variable
run: |
CHAINS="era,validium,custom_token,consensus"
echo "CHAINS=$CHAINS" >> $GITHUB_ENV
- name: Initialize gateway chain
run: |
ci_run zkstack chain create \
--chain-name gateway \
--chain-id 505 \
--prover-mode no-proofs \
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode rollup \
--base-token-address 0x0000000000000000000000000000000000000001 \
--base-token-price-nominator 1 \
--base-token-price-denominator 1 \
--set-as-default false \
--ignore-prerequisites \
--evm-emulator false
ci_run zkstack chain init \
--deploy-paymaster \
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_gateway \
--chain gateway \
--validium-type no-da
ci_run zkstack chain convert-to-gateway --chain gateway --ignore-prerequisites
- name: Run gateway
run: |
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
- name: Migrate chains to gateway
run: |
ci_run zkstack chain migrate-to-gateway --chain era --gateway-chain-name gateway
ci_run zkstack chain migrate-to-gateway --chain validium --gateway-chain-name gateway
ci_run zkstack chain migrate-to-gateway --chain custom_token --gateway-chain-name gateway
ci_run zkstack chain migrate-to-gateway --chain consensus --gateway-chain-name gateway
- name: Migrate back era
run: |
ci_run zkstack chain migrate-from-gateway --chain era --gateway-chain-name gateway
- name: Migrate to gateway again
run: |
ci_run zkstack chain migrate-to-gateway --chain era --gateway-chain-name gateway
- name: Build test dependencies
run: |
ci_run zkstack dev test build
Expand Down Expand Up @@ -403,19 +451,19 @@ jobs:
- name: Init external nodes
run: |
ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --chain era
--db-name=zksync_en_localhost_era_rollup --l1-rpc-url=http://localhost:8545 --gateway-rpc-url=http://localhost:3550 --chain era
ci_run zkstack external-node init --ignore-prerequisites --chain era
ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --chain validium
--db-name=zksync_en_localhost_era_validium1 --l1-rpc-url=http://localhost:8545 --gateway-rpc-url=http://localhost:3550 --chain validium
ci_run zkstack external-node init --ignore-prerequisites --chain validium
ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token
--db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --gateway-rpc-url=http://localhost:3550 --chain custom_token
ci_run zkstack external-node init --ignore-prerequisites --chain custom_token
ci_run zkstack external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus
--db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --gateway-rpc-url=http://localhost:3550 --chain consensus
ci_run zkstack external-node init --ignore-prerequisites --chain consensus
- name: Run recovery tests (from snapshot)
Expand All @@ -432,7 +480,7 @@ jobs:
ci_run zkstack external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log &
ci_run zkstack external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log &
ci_run zkstack external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log &
ci_run zkstack external-node wait --ignore-prerequisites --verbose --chain era
ci_run zkstack external-node wait --ignore-prerequisites --verbose --chain validium
ci_run zkstack external-node wait --ignore-prerequisites --verbose --chain custom_token
Expand All @@ -445,12 +493,16 @@ jobs:
- name: Fee projection tests
run: |
ci_run killall -INT zksync_server || true
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
ci_run ./bin/run_on_all_chains.sh "zkstack dev test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.FEES_LOGS_DIR }}
- name: Run revert tests
run: |
ci_run killall -INT zksync_server || true
ci_run killall -INT zksync_external_node || true
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
ci_run ./bin/run_on_all_chains.sh "zkstack dev test revert --no-deps --external-node --no-kill --ignore-prerequisites" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }}
Expand All @@ -459,9 +511,11 @@ jobs:
# TODO make upgrade tests safe to run multiple times
- name: Run upgrade test
run: |
ci_run killall -INT zksync_server || true
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
ci_run zkstack dev test upgrade --no-deps --chain era
- name: Upload logs
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: always()
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-prover-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ jobs:
- name: Run server
run: |
ci_run zkstack server --uring --chain=proving_chain --components=api,tree,eth,state_keeper,commitment_generator,proof_data_handler,vm_runner_protective_reads,vm_runner_bwip &>prover_logs/server.log &
- name: Run Gateway
- name: Run prover gateway
run: |
ci_run zkstack prover run --component=gateway --docker=false &>prover_logs/gateway.log &
- name: Run Prover Job Monitor
run: |
ci_run zkstack prover run --component=prover-job-monitor --docker=false &>prover_logs/prover-job-monitor.log &
- name: Wait for batch to be passed through gateway
- name: Wait for batch to be passed through prover gateway
env:
DATABASE_URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_proving_chain
BATCH_NUMBER: 1
Expand Down Expand Up @@ -105,10 +105,10 @@ jobs:
ci_run zkstack prover run --component=compressor --docker=false &>prover_logs/compressor.log &
- name: Wait for batch to be executed on L1
env:
DATABASE_URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_proving_chain
BATCH_NUMBER: 1
INTERVAL: 30
TIMEOUT: 600
DATABASE_URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_proving_chain
BATCH_NUMBER: 1
INTERVAL: 30
TIMEOUT: 600
run: |
PASSED_ENV_VARS="BATCH_NUMBER,DATABASE_URL,URL,INTERVAL,TIMEOUT" \
ci_run ./bin/prover_checkers/batch_l1_status_checker
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-prover-reusable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Workflow template for CI jobs for Prover Components
on:
workflow_call:

jobs:
lint:
runs-on: [ matterlabs-ci-runner-highmem-long ]
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- staging
- trying
- sync-layer-stable # adding this branch here to run CI on it regardless of the conflicts
- '!release-please--branches--**'

concurrency:
Expand All @@ -23,6 +24,7 @@ jobs:
docs: ${{ steps.changed-files.outputs.docs_any_changed }}
all: ${{ steps.changed-files.outputs.all_any_changed }}
steps:

- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
fetch-depth: 2
Expand Down Expand Up @@ -98,11 +100,11 @@ jobs:
name: CI for Prover Components
uses: ./.github/workflows/ci-prover-reusable.yml

e2e-for-prover:
name: E2E Test for Prover Components
needs: changed_files
if: ${{(needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
uses: ./.github/workflows/ci-prover-e2e.yml
# e2e-for-prover:
# name: E2E Test for Prover Components
# needs: changed_files
# if: ${{(needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
# uses: ./.github/workflows/ci-prover-e2e.yml

ci-for-docs:
needs: changed_files
Expand Down Expand Up @@ -186,7 +188,7 @@ jobs:
name: Github Status Check
runs-on: ubuntu-latest
if: always() && !cancelled()
needs: [ ci-for-core-lint, ci-for-common, ci-for-core, ci-for-prover, ci-for-docs, build-core-images, build-contract-verifier, build-prover-images, e2e-for-prover ]
needs: [ ci-for-core-lint, ci-for-common, ci-for-core, ci-for-prover, ci-for-docs, build-core-images, build-contract-verifier, build-prover-images ]
steps:
- name: Status
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-build-contract-verifier-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
if: env.BUILD_CONTRACTS == 'true'
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-15bec2f861b3b4c71e58f85e2b2c9dd722585aa8/foundry_nightly_linux_amd64.tar.gz
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
if: env.BUILD_CONTRACTS == 'true'
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-15bec2f861b3b4c71e58f85e2b2c9dd722585aa8/foundry_nightly_linux_amd64.tar.gz
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/vm-perf-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
run: |
run_retried docker compose pull zk
docker compose up -d zk
- name: run benchmarks on base branch
shell: bash
run: |
ci_run zkstackup -g --local
ci_run zkstack dev contracts --system-contracts
ci_run zkstack dev contracts
ci_run cargo bench --package vm-benchmark --bench instructions -- --verbose || echo "Instructions benchmark is missing"
ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes
Expand All @@ -65,7 +65,7 @@ jobs:
id: comparison
run: |
ci_run zkstackup -g --local
ci_run zkstack dev contracts --system-contracts
ci_run zkstack dev contracts
ci_run cargo bench --package vm-benchmark --bench instructions -- --verbose
ci_run cargo bench --package vm-benchmark --bench instructions -- --print > instructions.log 2>/dev/null
Expand Down
Loading

0 comments on commit f57fde0

Please sign in to comment.