Skip to content

Commit

Permalink
Update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Jan 15, 2025
2 parents e09a928 + f06cb79 commit c23eac0
Show file tree
Hide file tree
Showing 183 changed files with 4,601 additions and 1,236 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/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/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
125 changes: 106 additions & 19 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,12 @@ jobs:
- name: Install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup
ci_run zkstackup -g --local
ci_run zkstackup -g --local --cargo-features gateway
- name: Build contracts
run: |
ci_run zkstack dev contracts
- 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 Down Expand Up @@ -131,7 +128,7 @@ jobs:
- name: Install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
ci_run zkstackup -g --local
ci_run zkstackup -g --local --cargo-features gateway

- name: Create and initialize legacy chain
Expand All @@ -150,7 +147,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 All @@ -174,13 +171,22 @@ jobs:
integration-tests:
runs-on: [ matterlabs-ci-runner-ultra-performance ]
strategy:
# ----------------------------------------------
# Note, that while the contracts do support gateway chain
# in reality it won't exist for quite some time and so
# we will test both cases here
# ----------------------------------------------
matrix:
use_gateway_chain: [ "WITH_GATEWAY", "WITHOUT_GATEWAY" ]
# In some cases it's useful to continue one job even if another fails.
fail-fast: false
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
submodules: "recursive"
fetch-depth: 0


- name: Setup environment
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
Expand All @@ -200,7 +206,7 @@ jobs:
- name: Install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
ci_run zkstackup -g --local
ci_run zkstackup -g --local --cargo-features gateway
- name: Create log directories
run: |
Expand Down Expand Up @@ -270,7 +276,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 +299,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 +322,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 +358,67 @@ 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
# ----------------------------------------------------------------
# Only create/initialize the gateway chain *if* use_gateway_chain=WITH_GATEWAY
# ----------------------------------------------------------------
- name: Initialize gateway chain
if: matrix.use_gateway_chain == 'WITH_GATEWAY'
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
if: matrix.use_gateway_chain == 'WITH_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
if: matrix.use_gateway_chain == 'WITH_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
if: matrix.use_gateway_chain == 'WITH_GATEWAY'
run: |
ci_run zkstack chain migrate-from-gateway --chain era --gateway-chain-name gateway
- name: Migrate to gateway again
if: matrix.use_gateway_chain == 'WITH_GATEWAY'
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 @@ -402,20 +464,22 @@ jobs:
- name: Init external nodes
run: |
GATEWAY_RPC_URL="${{ matrix.use_gateway_chain == 'WITH_GATEWAY' && '--gateway-rpc-url=http://localhost:3550' || '' }}"
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 --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 --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 --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 --chain consensus
ci_run zkstack external-node init --ignore-prerequisites --chain consensus
- name: Run recovery tests (from snapshot)
Expand All @@ -432,7 +496,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,26 +509,49 @@ jobs:
- name: Fee projection tests
run: |
ci_run killall -INT zksync_server || true
# Only start & wait for the gateway server if use_gateway_chain == WITH_GATEWAY
if [ "${{ matrix.use_gateway_chain }}" == "WITH_GATEWAY" ]; then
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
fi
# Always run the chain-specific fee tests
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
# Only start & wait for the gateway server if use_gateway_chain == WITH_GATEWAY
if [ "${{ matrix.use_gateway_chain }}" == "WITH_GATEWAY" ]; then
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
fi
# Always run the chain-specific revert tests
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 }}
# Upgrade tests should run last, because as soon as they
# finish the bootloader will be different
# TODO make upgrade tests safe to run multiple times
- name: Run upgrade test
run: |
ci_run zkstack dev test upgrade --no-deps --chain era
ci_run killall -INT zksync_server || true
# Only start & wait for the gateway server if use_gateway_chain == WITH_GATEWAY
if [ "${{ matrix.use_gateway_chain }}" == "WITH_GATEWAY" ]; then
ci_run zkstack server --ignore-prerequisites --chain gateway &> ${{ env.SERVER_LOGS_DIR }}/gateway.log &
ci_run zkstack server wait --ignore-prerequisites --verbose --chain gateway
fi
# Always run the upgrade test against era
ci_run zkstack dev test upgrade --no-deps --chain era
- name: Upload logs
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: always()
with:
name: logs
name: logs_${{matrix.use_gateway_chain}}
path: logs
23 changes: 16 additions & 7 deletions .github/workflows/ci-prover-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ jobs:
run: |
git fetch
# Checkout the commit with the DualVerifier contract to test FFLONK interface
git checkout b4d5b984
git checkout bcdd1cb05e8f4d9ec2dd41e2cc668cdfe30ee535
git submodule update --init --recursive
git rev-parse HEAD
- name: Set new genesis for fflonk
# Note, that while `Verifier` is not explicitly a part of the genensis state,
# it affects it indirectly as it is a part of the repo.
working-directory: ./etc/env/file_based
if: matrix.compressor-mode == 'fflonk'
run: |
sudo sed -i 's/^genesis_root: .*/genesis_root: 0xc3fa60b6769a0c2f222053d7cbd1d6f63be7777e3c8d029cbd61cc075526ab81/' genesis.yaml
sudo sed -i "s/^genesis_batch_commitment: .*/genesis_batch_commitment: 0x17689e705b5749ed0bbd53c845988d17c419697c2cb29eabab8785f1cb775b4a/" genesis.yaml
- name: Init
run: |
ci_run chmod -R +x ./bin
Expand Down Expand Up @@ -88,13 +97,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_${{matrix.compressor-mode}}/server.log &
- name: Run Gateway
- name: Run prover gateway
run: |
ci_run zkstack prover run --component=gateway --docker=false &>prover_logs_${{matrix.compressor-mode}}/gateway.log &
- name: Run Prover Job Monitor
run: |
ci_run zkstack prover run --component=prover-job-monitor --docker=false &>prover_logs_${{matrix.compressor-mode}}/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 @@ -126,10 +135,10 @@ jobs:
- 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: 1200
DATABASE_URL: postgres://postgres:notsecurepassword@localhost:5432/zksync_prover_localhost_proving_chain
BATCH_NUMBER: 1
INTERVAL: 30
TIMEOUT: 1200
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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
7 changes: 4 additions & 3 deletions .github/workflows/vm-perf-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,26 @@ 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
- name: checkout PR
run: |
git checkout --force FETCH_HEAD --recurse-submodules
git submodule update --init --recursive
- name: run benchmarks on PR
shell: bash
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts
Submodule contracts updated 644 files
Loading

0 comments on commit c23eac0

Please sign in to comment.