Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into gprusak-consensus-pla…
Browse files Browse the repository at this point in the history
…ybook
  • Loading branch information
pompon0 committed Nov 15, 2024
2 parents 03caeb5 + 64e77ce commit 0a6a07f
Show file tree
Hide file tree
Showing 211 changed files with 743 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
outputs:
core: ${{ steps.changed-files.outputs.core_any_changed }}
prover: ${{ steps.changed-files.outputs.prover_any_changed }}
zkstack_cli: ${{ steps.changed-files.outputs.zkstack_cli_any_changed }}
docs: ${{ steps.changed-files.outputs.docs_any_changed }}
all: ${{ steps.changed-files.outputs.all_any_changed }}
steps:
Expand Down Expand Up @@ -178,6 +177,7 @@ jobs:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
action: "build"
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl"
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/deploy-core-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy core docs

on:
push:
branches:
- "main"
tags:
- "core-v*.*.*"
paths:
- 'docs/**'
- '.github/workflows/deploy-core-docs.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/deploy-core-docs.yml'
workflow_dispatch:
inputs:
ref:
description: "Branch, tag or commit to deploy the core docs. If empty, use the ref that triggered the workflow."
required: false
default: ""
version:
type: string
description: "Version of the documentation to deploy"
required: false
default: "latest"

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:

deploy-core-docs:
runs-on: ubuntu-latest
permissions:
contents: write
env:
DOCS_DIR: 'docs'
PROJECT: 'core'
ENABLE_TESTS: false
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ inputs.ref || '' }}

- name: Extract version from tag
if: startsWith(github.ref, 'refs/tags/')
id: extract-version
shell: 'bash -ex {0}'
run: |
TAG="${{ github.ref_name }}"
VERSION="${TAG#*-}"
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
- name: Deploy core docs
uses: matter-labs/deploy-mdbooks@77856145362bf23834f2e54a44a928790c4bee7c # v1
with:
version: ${{ inputs.version || steps.extract-version.outputs.version || github.ref_name }}
docs-dir: ${{ env.DOCS_DIR }}
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-tests: ${{ env.ENABLE_TESTS }}
project: ${{ env.PROJECT }}
deploy: ${{ github.event_name != 'pull_request' }}
67 changes: 67 additions & 0 deletions .github/workflows/deploy-prover-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy prover docs

on:
push:
branches:
- "main"
tags:
- "prover-v*.*.*"
paths:
- 'prover/docs/**'
- '.github/workflows/deploy-prover-docs.yml'
pull_request:
paths:
- 'prover/docs/**'
- '.github/workflows/deploy-prover-docs.yml'
workflow_dispatch:
inputs:
ref:
description: "Branch, tag or commit to deploy the prover docs. If empty, use the ref that triggered the workflow."
required: false
default: ""
version:
type: string
description: "Version of the documentation to deploy"
required: false
default: "latest"

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:

deploy-prover-docs:
runs-on: ubuntu-latest
permissions:
contents: write
env:
DOCS_DIR: 'prover/docs'
PROJECT: 'prover'
ENABLE_TESTS: false
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ inputs.ref || '' }}

- name: Extract version from tag
if: startsWith(github.ref, 'refs/tags/')
id: extract-version
shell: 'bash -ex {0}'
run: |
TAG="${{ github.ref_name }}"
VERSION="${TAG#*-}"
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
- name: Deploy prover docs
uses: matter-labs/deploy-mdbooks@77856145362bf23834f2e54a44a928790c4bee7c # v1
with:
version: ${{ inputs.version || steps.extract-version.outputs.version || github.ref_name }}
docs-dir: ${{ env.DOCS_DIR }}
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-tests: ${{ env.ENABLE_TESTS }}
project: ${{ env.PROJECT }}
deploy: ${{ github.event_name != 'pull_request' }}
26 changes: 10 additions & 16 deletions .github/workflows/new-build-contract-verifier-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,31 +212,25 @@ jobs:
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
push: ${{ inputs.action == 'push' }}
load: true
platforms: ${{ matrix.platforms }}
file: docker/${{ matrix.components }}/Dockerfile
build-args: |
SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage
SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com
SCCACHE_GCS_RW_MODE=READ_WRITE
RUSTC_WRAPPER=sccache
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:latest
matterlabs/${{ matrix.components }}:latest
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:latest2.0
matterlabs/${{ matrix.components }}:latest2.0
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA }}
matterlabs/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA }}
matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
- name: Push docker image
if: ${{ inputs.action == 'push' }}
run: |
docker push us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
docker push matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
create_manifest:
name: Create release manifest
runs-on: matterlabs-ci-runner
Expand Down
31 changes: 11 additions & 20 deletions .github/workflows/new-build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,35 +219,28 @@ jobs:
docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
gcloud auth configure-docker us-docker.pkg.dev -q
- name: Build and push
- name: Build docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
push: ${{ inputs.action == 'push' }}
load: true
platforms: ${{ matrix.platforms }}
file: docker/${{ matrix.components }}/Dockerfile
build-args: |
SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage
SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com
SCCACHE_GCS_RW_MODE=READ_WRITE
RUSTC_WRAPPER=sccache
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:latest
matterlabs/${{ matrix.components }}:latest
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:latest2.0
matterlabs/${{ matrix.components }}:latest2.0
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA }}
matterlabs/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA }}
matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:2.0-${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
- name: Push docker image
if: ${{ inputs.action == 'push' }}
run: |
docker push us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
docker push matterlabs/${{ matrix.components }}:${{ env.IMAGE_TAG_SHA_TS }}-${{ env.PLATFORM }}
create_manifest:
name: Create release manifest
runs-on: matterlabs-ci-runner
Expand All @@ -269,13 +262,11 @@ jobs:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: login to Docker registries
shell: bash
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
gcloud auth configure-docker us-docker.pkg.dev -q
- name: Create Docker manifest
shell: bash
run: |
docker_repositories=("matterlabs/${{ matrix.component.name }}" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component.name }}")
platforms=${{ matrix.component.platform }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/new-build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,26 @@ jobs:
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
push: ${{ inputs.action == 'push' }}
load: true
build-args: |
CUDA_ARCH=${{ inputs.CUDA_ARCH }}
SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage
SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com
SCCACHE_GCS_RW_MODE=READ_WRITE
RUSTC_WRAPPER=sccache
PROTOCOL_VERSION=${{ env.PROTOCOL_VERSION }}
ERA_BELLMAN_CUDA_RELEASE=${{ inputs.ERA_BELLMAN_CUDA_RELEASE }}
file: docker/${{ matrix.components }}/Dockerfile
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.PROTOCOL_VERSION }}-${{ env.IMAGE_TAG_SHA_TS }}
matterlabs/${{ matrix.components }}:2.0-${{ env.PROTOCOL_VERSION }}-${{ env.IMAGE_TAG_SHA_TS }}
- name: Push docker image
if: ${{ inputs.action == 'push' }}
run: |
docker push us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.PROTOCOL_VERSION }}-${{ env.IMAGE_TAG_SHA_TS }}
docker push matterlabs/${{ matrix.components }}:2.0-${{ env.PROTOCOL_VERSION }}-${{ env.IMAGE_TAG_SHA_TS }}
copy-images:
name: Copy images between docker registries
needs: [build-images, get-protocol-version]
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/new-build-witness-generator-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: "DOCKERHUB_TOKEN"
required: true
inputs:
ERA_BELLMAN_CUDA_RELEASE:
description: "ERA_BELLMAN_CUDA_RELEASE"
type: string
required: true
image_tag_suffix:
description: "Optional suffix to override tag name generation"
type: string
Expand Down Expand Up @@ -127,6 +131,9 @@ jobs:
SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com
SCCACHE_GCS_RW_MODE=READ_WRITE
RUSTC_WRAPPER=sccache
PROTOCOL_VERSION=${{ env.PROTOCOL_VERSION }}
ERA_BELLMAN_CUDA_RELEASE=${{ inputs.ERA_BELLMAN_CUDA_RELEASE }}
RUST_FLAGS=${{ inputs.WITNESS_GENERATOR_RUST_FLAGS }}
file: docker/${{ matrix.components }}/Dockerfile
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.PROTOCOL_VERSION }}-${{ env.IMAGE_TAG_SHA_TS }}
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/release-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ jobs:
build-push-core-images:
name: Build and push images
needs: [setup, changed_files]
uses: ./.github/workflows/build-core-template.yml
uses: ./.github/workflows/new-build-core-template.yml
if: needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true'
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "push"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -84,37 +85,40 @@ jobs:
build-push-contract-verifier:
name: Build and push images
needs: [setup, changed_files]
uses: ./.github/workflows/build-contract-verifier-template.yml
uses: ./.github/workflows/new-build-contract-verifier-template.yml
if: needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true'
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "push"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build-push-prover-images:
name: Build and push images
needs: [setup, changed_files]
uses: ./.github/workflows/build-prover-template.yml
uses: ./.github/workflows/new-build-prover-template.yml
if: needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true'
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: "60;70;75;80;89"
action: "push"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build-push-witness-generator-image-avx512:
name: Build and push prover images with avx512 instructions
needs: [setup, changed_files]
uses: ./.github/workflows/build-witness-generator-template.yml
uses: ./.github/workflows/new-build-witness-generator-template.yml
if: needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true'
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: "60;70;75;80;89"
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl "
action: "push"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
32 changes: 32 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[book]
authors = ["ZKsync team"]
language = "en"
multilingual = false
src = "src"
title = "ZKsync Era Documentation"

[output.html]
smart-punctuation = true
mathjax-support = true
git-repository-url = "https://github.com/matter-labs/zksync-era/tree/main/docs"
edit-url-template = "https://github.com/matter-labs/zksync-era/tree/main/docs/{path}"
additional-js = ["js/version-box.js", "js/mermaid-init.js"]
additional-css = ["css/version-box.css"]

[output.html.playground]
editable = true
line-numbers = true

[output.html.search]
limit-results = 20
use-boolean-and = true
boost-title = 2
boost-hierarchy = 2
boost-paragraph = 1
expand = true
heading-split-level = 2

[preprocessor]

[preprocessor.mermaid]
command = "mdbook-mermaid"
Loading

0 comments on commit 0a6a07f

Please sign in to comment.