Skip to content

Commit

Permalink
feat(hyperchain): Adding prover related commands to zk stack (#440)
Browse files Browse the repository at this point in the history
## What ❔

Add commands to zk stack to setup a prover (for now only CPU, it blocks
the GPU option), and adds the necessary components to the compose file

## Why ❔

"Without a prover, a hyperchain is nothing more than a even worst OP
rollup" - Canales, Ramon

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
githubdoramon authored Nov 13, 2023
1 parent 664ce33 commit 580cada
Show file tree
Hide file tree
Showing 8 changed files with 648 additions and 162 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ cache-zk/
zksolc
verified_sources

# Hyperchain related
hyperchain-*.yml
/etc/hyperchains/prover-keys
/etc/hyperchains/artifacts
116 changes: 53 additions & 63 deletions etc/hyperchains/docker-compose-hyperchain-template
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@ networks:
zkstack:
driver: bridge
volumes:
prover_artifacts:
server_artifacts:
artifacts:
services:
zkstack_core:
zkstack-core:
networks:
- zkstack
image: {{orgName}}/server-v2:latest
command: ["--components", "tree_new,eth,data_fetcher,state_keeper,housekeeper"]
command: ["--components", "tree_new,eth,data_fetcher,state_keeper,housekeeper,proof_data_handler"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3071/health"]
interval: 10s
timeout: 5s
retries: 10
env_file:
- {{envFilePath}}
environment:
ZKSYNC_HOME: /
ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics # we need a separate metrics port for each component
- "3075:3075" # proof_data_handler api
#- "3312:3312" # prometheus metrics # we need a separate metrics port for each component
- "3320:3320" # proof_data_handler api
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
zkstack-apis:
networks:
- zkstack
Expand All @@ -44,101 +47,88 @@ services:
zkstack-prover-fri-gateway:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/prover-fri-gateway/Dockerfile
image: matterlabs/prover-fri-gateway:latest
depends_on:
zkstack-core:
condition: "service_healthy"
env_file:
- ./common.env
env:
FRI_PROVER_GATEWAY_API_URL: http://zkstack-core:3075
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
- {{envFilePath}}
environment:
FRI_PROVER_GATEWAY_API_URL: http://zkstack-core:3320
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
zkstack-witness-generator-basic-circuits:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/witness-generator/Dockerfile
image: matterlabs/witness-generator:latest
command: ["--round", "basic_circuits"]
env_file:
- {{envFilePath}}
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
zkstack-witness-generator-leaf-aggregation:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/witness-generator/Dockerfile
image: matterlabs/witness-generator:latest
command: ["--round", "leaf_aggregation"]
env_file:
- {{envFilePath}}
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
zkstack-witness-generator-node-aggregation:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/witness-generator/Dockerfile
image: matterlabs/witness-generator:latest
command: ["--round", "node_aggregation"]
env_file:
- {{envFilePath}}
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
zkstack-witness-generator-scheduler:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/witness-generator/Dockerfile
image: matterlabs/witness-generator:latest
command: ["--round", "scheduler"]
env_file:
- {{envFilePath}}
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
zkstack-prover-fri:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/prover-fri/Dockerfile
image: matterlabs/prover-fri:latest
env_file:
- {{envFilePath}}
env:
FRI_PROVER_SETUP_DATA_PATH: /etc/prover_setup_data
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- ./prover_setup-data:/etc/prover_setup_data
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
zkstack-proof-fri-compressor:
networks:
- zkstack
build:
context: .
dockerfile: ./docker/proof-fri-compressor/Dockerfile
image: matterlabs/proof-fri-compressor:latest
env_file:
- {{envFilePath}}
ports: # assumes default ports in .env
- "3312:3312" # prometheus metrics
# ports: # assumes default ports in .env
# - "3312:3312" # prometheus metrics
volumes:
- prover_artifacts:/etc_prover_artifacts
- server_artifacts:/etc_server_artifacts
- artifacts:{{artifactsPath}}
- {{proverSetupArtifacts}}:{{proverSetupArtifacts}}
{{/if}}

Loading

0 comments on commit 580cada

Please sign in to comment.