Skip to content

Commit

Permalink
Update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 31, 2024
2 parents c653bc7 + e95f50a commit f0872bf
Show file tree
Hide file tree
Showing 384 changed files with 14,484 additions and 3,539 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "25.0.0",
"prover": "16.5.0",
"prover": "16.6.0",
"zkstack_cli": "0.1.2"
}
1 change: 0 additions & 1 deletion .github/workflows/build-contract-verifier-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ jobs:
- 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 pre_download_compilers.sh
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ jobs:
- 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 pre_download_compilers.sh
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-local-node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
- name: start-services
run: |
mkdir -p ./volumes/postgres
run_retried docker compose pull zk postgres
docker compose up -d zk postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ jobs:
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
- name: Remove prover-gpu-fri-gar image to free space
run: |
docker image rm us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
- name: Move Setup data from prover-gpu-fri-gar to circuit-prover-gpu-gar
run: |
mv -v docker/prover-gpu-fri-gar/*.bin docker/circuit-prover-gpu-gar/
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
- 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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-witness-generator-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
- 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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-common-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- name: Start services
run: |
run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull
mkdir -p ./volumes/postgres
docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres
- name: Install zkstack
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
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"] }]'

env:
RUST_BACKTRACE: 1
PASSED_ENV_VARS: RUST_BACKTRACE

jobs:
lint:
name: lint
Expand Down Expand Up @@ -101,7 +105,7 @@ jobs:
- name: Loadtest configuration
run: |
echo EXPECTED_TX_COUNT=${{ matrix.vm_mode == 'NEW' && 21000 || 16000 }} >> .env
echo EXPECTED_TX_COUNT=${{ matrix.vm_mode == 'NEW' && 30000 || 16000 }} >> .env
echo ACCOUNTS_AMOUNT="100" >> .env
echo MAX_INFLIGHT_TXS="10" >> .env
echo SYNC_API_REQUESTS_LIMIT="15" >> .env
Expand Down Expand Up @@ -272,8 +276,8 @@ jobs:
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode rollup \
--base-token-address ${{ env.CUSTOM_TOKEN_ADDRESS }} \
--base-token-price-nominator 3 \
--base-token-price-denominator 2 \
--base-token-price-nominator 314 \
--base-token-price-denominator 1000 \
--set-as-default false \
--ignore-prerequisites
Expand Down Expand Up @@ -328,8 +332,8 @@ jobs:
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode validium \
--base-token-address ${{ env.CUSTOM_TOKEN_ADDRESS }} \
--base-token-price-nominator 3 \
--base-token-price-denominator 2 \
--base-token-price-nominator 314 \
--base-token-price-denominator 1000 \
--set-as-default false \
--ignore-prerequisites
Expand All @@ -356,12 +360,16 @@ jobs:
- name: Run servers
run: |
# Override config for part of chains to test the default config as well
ci_run zkstack dev config-writer --path etc/env/file_based/overrides/tests/integration.yaml --chain era
ci_run zkstack dev config-writer --path etc/env/file_based/overrides/tests/integration.yaml --chain validium
ci_run zkstack server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log &
ci_run zkstack server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log &
ci_run zkstack server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log &
ci_run zkstack server --ignore-prerequisites --chain consensus \
--components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \
&> ${{ env.SERVER_LOGS_DIR }}/consensus.log &
--components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \
&> ${{ env.SERVER_LOGS_DIR }}/consensus.log &
ci_run sleep 5
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-prover-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- name: Start services
run: |
run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull
mkdir -p ./volumes/postgres ./volumes/reth/data
docker-compose -f ${RUNNER_COMPOSE_FILE} --profile runner up -d --wait
ci_run sccache --start-server
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-prover-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- name: Start services
run: |
run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull
mkdir -p ./volumes/postgres
docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres
- name: Install zkstack
Expand All @@ -40,7 +39,9 @@ jobs:
ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}
- name: Formatting
run: ci_run bash -c "cd prover && cargo fmt --check"
run: |
ci_run git config --global --add safe.directory /usr/src/zksync
ci_run zkstack dev fmt --check rustfmt
unit-tests:
runs-on: [ matterlabs-ci-runner-highmem-long ]
Expand All @@ -66,7 +67,6 @@ jobs:
- name: Start services
run: |
run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull
mkdir -p ./volumes/postgres
docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres
- name: Install zkstack
Expand Down
33 changes: 25 additions & 8 deletions .github/workflows/vm-perf-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
echo "SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com" >> .env
echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> .env
echo "RUSTC_WRAPPER=sccache" >> .env
# Set the minimum reported instruction count difference to reduce noise
echo "BENCHMARK_DIFF_THRESHOLD_PERCENT=2" >> .env
- name: init
run: |
Expand All @@ -51,33 +53,48 @@ jobs:
run: |
ci_run zkstackup -g --local
ci_run zkstack dev contracts --system-contracts
ci_run cargo bench --package vm-benchmark --bench iai | tee base-iai
ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee base-opcodes || touch base-opcodes
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
- name: run benchmarks on PR
shell: bash
id: comparison
run: |
ci_run zkstackup -g --local
ci_run zkstack dev contracts --system-contracts
ci_run cargo bench --package vm-benchmark --bench iai | tee pr-iai
ci_run cargo run --package vm-benchmark --release --bin instruction_counts | tee pr-opcodes || touch pr-opcodes
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
# Output all lines from the benchmark result starting from the "## ..." comparison header.
# Since the output spans multiple lines, we use a heredoc declaration.
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "speedup<<$EOF" >> $GITHUB_OUTPUT
ci_run cargo run --package vm-benchmark --release --bin compare_iai_results base-iai pr-iai base-opcodes pr-opcodes >> $GITHUB_OUTPUT
sed -n '/^## /,$p' instructions.log >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
ci_run cargo run --package vm-benchmark --release --bin instruction_counts -- --diff base-opcodes > opcodes.log
echo "opcodes<<$EOF" >> $GITHUB_OUTPUT
sed -n '/^## /,$p' opcodes.log >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
id: comparison
- name: Comment on PR
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
if: steps.comparison.outputs.speedup != '' || steps.comparison.outputs.opcodes != ''
with:
message: |
${{ steps.comparison.outputs.speedup == '' && '## No performance difference detected (anymore)' || '## Detected VM performance changes' }}
${{ steps.comparison.outputs.speedup }}
${{ steps.comparison.outputs.opcodes }}
comment_tag: vm-performance-changes
mode: recreate
create_if_not_exists: ${{ steps.comparison.outputs.speedup != '' }}
create_if_not_exists: true
- name: Remove PR comment
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
if: steps.comparison.outputs.speedup == '' && steps.comparison.outputs.opcodes == ''
with:
comment_tag: vm-performance-changes
message: 'No performance difference detected (anymore)'
mode: delete
4 changes: 2 additions & 2 deletions .github/workflows/vm-perf-to-prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ jobs:
ci_run cargo bench --package vm-benchmark --bench oneshot
# Run only benches with 1,000 transactions per batch to not spend too much time
ci_run cargo bench --package vm-benchmark --bench batch '/1000$'
ci_run cargo bench --package vm-benchmark --bench iai | tee iai-result
ci_run cargo run --package vm-benchmark --bin iai_results_to_prometheus --release < iai-result
ci_run cargo bench --package vm-benchmark --bench instructions -- --verbose
ci_run cargo bench --package vm-benchmark --bench instructions -- --print
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ prover/data/keys/setup_*
# ZK Stack CLI
chains/era/configs/*
chains/gateway/*
chains/avail/*
configs/*
era-observability/
core/tests/ts-integration/deployments-zk
Expand Down
Loading

0 comments on commit f0872bf

Please sign in to comment.