Skip to content

Commit 79e8c3f

Browse files
committed
Merge branch 'main' into l1-recovery
2 parents 2a0e964 + 6ddd560 commit 79e8c3f

File tree

3,089 files changed

+182339
-91892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,089 files changed

+182339
-91892
lines changed

.dockerignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*
22
!docker/prover/prover-entry.sh
3-
!docker/local-node/entrypoint.sh
43
!docker/external-node/entrypoint.sh
54
!docker/contract-verifier/install-all-solc.sh
65
!etc/test_config
@@ -20,11 +19,13 @@ keys/setup
2019
!prover/
2120
!yarn.lock
2221
!package.json
23-
!Cargo.lock
24-
!Cargo.toml
22+
!core/Cargo.lock
23+
!core/Cargo.toml
2524
!contracts/
25+
!proof-manager-contracts/
2626
!setup_2\^26.key
2727
!setup_2\^24.key
28+
!setup_compact.key
2829
# It's required to remove .git from contracts,
2930
# otherwise yarn tries to use .git parent directory that
3031
# doesn't exist.

.githooks/pre-commit

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ check_fmt () {
1515
fi
1616
}
1717

18-
check_fmt
19-
20-
cd prover/
21-
22-
check_fmt
18+
( cd core/ && check_fmt )
19+
( cd prover/ && check_fmt )
20+
( cd zkstack_cli/ && check_fmt )
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Setup Environment
2+
3+
inputs:
4+
runner-compose-file:
5+
description: 'Path to the runner compose file'
6+
default: 'docker-compose.yml'
7+
8+
runs:
9+
using: composite
10+
steps:
11+
12+
- name: Setup misc environment variables
13+
shell: bash
14+
run: |
15+
echo CACHE_DIR=/usr/src/cache >> .env
16+
echo CACHE_DIR=/usr/src/cache >> $GITHUB_PATH
17+
echo $(pwd)/bin >> $GITHUB_PATH
18+
echo $HOME/.local/bin >> $GITHUB_PATH
19+
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
20+
echo CI=1 >> $GITHUB_ENV
21+
echo IN_DOCKER=1 >> .env
22+
echo CI=1 >> .env
23+
echo RUNNER_COMPOSE_FILE=${{ inputs.runner-compose-file }} >> $GITHUB_ENV
24+
25+
- name: Setup sccache for building rust code outside Docker
26+
shell: bash
27+
run: |
28+
echo SCCACHE_CACHE_SIZE=50G >> $GITHUB_ENV
29+
echo SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage >> $GITHUB_ENV
30+
echo SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com >> $GITHUB_ENV
31+
echo SCCACHE_ERROR_LOG=/tmp/sccache_log.txt >> $GITHUB_ENV
32+
echo SCCACHE_GCS_RW_MODE=READ_WRITE >> $GITHUB_ENV
33+
echo RUSTC_WRAPPER=sccache >> $GITHUB_ENV
34+
35+
# sccache outside docker will run it's own server
36+
echo SCCACHE_SERVER_PORT=4225 >> $GITHUB_ENV
37+
38+
- name: Setup sccache for building rust code inside Docker
39+
shell: bash
40+
run: |
41+
echo SCCACHE_CACHE_SIZE=50G >> .env
42+
echo SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage >> .env
43+
echo SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com >> .env
44+
echo SCCACHE_ERROR_LOG=/tmp/sccache_log.txt >> .env
45+
echo SCCACHE_GCS_RW_MODE=READ_WRITE >> .env
46+
echo RUSTC_WRAPPER=sccache >> .env
47+
echo DOCKER_PWD=$(pwd) >> .env
48+
49+
- name: Start localnet
50+
shell: bash
51+
run: |
52+
mkdir -p ./hardhat-nodejs
53+
ci_localnet_up
54+
55+
- name: Start sccache servers
56+
shell: bash
57+
run: |
58+
ci_run sccache --start-server
59+
sccache --start-server
60+
61+
- name: Init git safe directories
62+
shell: bash
63+
run: |
64+
ci_run git config --global --add safe.directory /usr/src/zksync
65+
ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen
66+
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
67+
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
68+
69+
- name: restore zkstack binary from cache
70+
id: zkstack_cache
71+
uses: actions/cache/restore@v4
72+
with:
73+
path: zkstack
74+
key: zkstack-${{ runner.os }}-${{ hashFiles('zkstack_cli/**') }}
75+
76+
- name: Copy cached zkstack binary to inside docker (on cache hit)
77+
if: steps.zkstack_cache.outputs.cache-hit == 'true'
78+
shell: bash
79+
run: |
80+
ci_run cp /usr/src/zksync/zkstack /usr/local/bin/zkstack
81+
82+
- name: Install zkstack inside docker (on cache miss)
83+
if: steps.zkstack_cache.outputs.cache-hit != 'true'
84+
shell: bash
85+
run: |
86+
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
87+
ci_run zkstackup -g --local
88+
ci_run cp /usr/local/bin/zkstack /usr/src/zksync/zkstack
89+
90+
- name: Save zkstack binary to cache (on cache miss)
91+
if: steps.zkstack_cache.outputs.cache-hit != 'true'
92+
uses: actions/cache/save@v4
93+
with:
94+
path: zkstack
95+
key: ${{ steps.zkstack_cache.outputs.cache-primary-key }}
96+
97+
- name: Install zkstack binary locally as well
98+
shell: bash
99+
run: |
100+
mv zkstack bin/zkstack

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@
77
## Why ❔
88

99
<!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? -->
10+
<!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain -->
1011
<!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. -->
1112

13+
## Is this a breaking change?
14+
- [ ] Yes
15+
- [ ] No
16+
17+
## Operational changes
18+
<!-- Any config changes? Any new flags? Any changes to any scripts? -->
19+
<!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know -->
20+
1221
## Checklist
1322

1423
<!-- Check your PR fulfills the following items. -->

.github/release-please/config.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@
55
"bump-minor-pre-major": true,
66
"bump-patch-for-minor-pre-major": true,
77
"include-component-in-tag": true,
8+
"release-type": "simple",
89
"packages": {
910
"core": {
10-
"release-type": "simple",
11-
"component": "core",
11+
"component": "core"
12+
},
13+
"prover": {
14+
"component": "prover",
1215
"extra-files": [
1316
{
1417
"type": "generic",
15-
"path": "bin/external_node/Cargo.toml"
18+
"path": "Cargo.toml"
1619
}
1720
]
1821
},
19-
"prover": {
20-
"release-type": "simple",
21-
"component": "prover"
22-
},
2322
"zkstack_cli": {
24-
"release-type": "simple",
2523
"component": "zkstack_cli",
26-
"plugins": [
27-
"cargo-workspace"
24+
"extra-files": [
25+
{
26+
"type": "generic",
27+
"path": "Cargo.toml"
28+
}
2829
]
2930
}
3031
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"core": "25.3.0",
3-
"prover": "17.1.1",
2+
"core": "29.4.1",
3+
"prover": "22.1.0",
44
"zkstack_cli": "0.1.2"
55
}

.github/workflows/build-base.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
arch: [ amd64, arm64 ]
2828

2929
steps:
30-
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3131
with:
3232
submodules: "recursive"
3333

@@ -36,13 +36,13 @@ jobs:
3636
gcloud auth configure-docker us-docker.pkg.dev -q
3737
3838
- name: Login to DockerHub
39-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
39+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
4040
with:
4141
username: ${{ secrets.DOCKERHUB_USER }}
4242
password: ${{ secrets.DOCKERHUB_TOKEN }}
4343

4444
- name: Login to GitHub Container Registry
45-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
45+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
4646
with:
4747
registry: ghcr.io
4848
username: ${{ github.actor }}
@@ -55,10 +55,10 @@ jobs:
5555
echo image_tag_sha=$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
5656
5757
- name: Set up Docker Buildx
58-
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
58+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
5959

6060
- name: Build and push
61-
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
61+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
6262
with:
6363
push: true
6464
context: .
@@ -82,20 +82,20 @@ jobs:
8282
runs-on: [ matterlabs-ci-runner-high-performance ]
8383
steps:
8484
- name: Set up Docker Buildx
85-
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
85+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
8686

8787
- name: Login to google container registry
8888
run: |
8989
gcloud auth configure-docker us-docker.pkg.dev -q
9090
9191
- name: Login to DockerHub
92-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
92+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
9393
with:
9494
username: ${{ secrets.DOCKERHUB_USER }}
9595
password: ${{ secrets.DOCKERHUB_TOKEN }}
9696

9797
- name: Login to GitHub Container Registry
98-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
98+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
9999
with:
100100
registry: ghcr.io
101101
username: ${{ github.actor }}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build Prover FRI GPU & Circuit Prover GPU with builtin setup data
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image_tag_suffix:
7+
description: "Commit sha or git tag for Docker tag"
8+
required: true
9+
type: string
10+
setup_keys_id:
11+
description: "Commit sha for downloading setup data from bucket dir"
12+
required: true
13+
type: string
14+
protocol_version:
15+
description: "Protocol version to be included in the images tag"
16+
required: true
17+
type: string
18+
19+
jobs:
20+
build:
21+
name: Build prover FRI GPU GAR
22+
runs-on: [matterlabs-ci-runner-high-performance]
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
25+
with:
26+
submodules: "recursive"
27+
28+
- name: Download Setup data
29+
run: |
30+
gsutil -m rsync -x "fflonk|plonk|setup_compression" -r gs://matterlabs-setup-data-us/${{ inputs.setup_keys_id }} docker/circuit-prover-gpu-gar
31+
32+
- name: Login to us-central1 GAR
33+
run: |
34+
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
41+
42+
- name: Login to Asia GAR
43+
run: |
44+
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://asia-docker.pkg.dev
45+
46+
- name: Login to Europe GAR
47+
run: |
48+
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://europe-docker.pkg.dev
49+
50+
- name: Build and push circuit-prover-gpu-gar
51+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
52+
with:
53+
context: docker/circuit-prover-gpu-gar
54+
build-args: |
55+
PROVER_IMAGE=${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
56+
push: true
57+
tags: |
58+
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/circuit-prover-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
59+
60+
- name: Build and push circuit-prover-gpu-gar to Asia GAR
61+
run: |
62+
docker buildx imagetools create \
63+
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/circuit-prover-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
64+
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/circuit-prover-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
65+
66+
- name: Build and push circuit-prover-gpu-gar to Europe GAR
67+
run: |
68+
docker buildx imagetools create \
69+
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/circuit-prover-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
70+
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/circuit-prover-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}

0 commit comments

Comments
 (0)