Skip to content

Commit 4046579

Browse files
committed
docs: update readme
1 parent a5e911e commit 4046579

File tree

7 files changed

+73
-32
lines changed

7 files changed

+73
-32
lines changed

permissionless-batches/Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.PHONY: batch-production-submission launch_local_prover launch_cloud_prover
1+
.PHONY: batch-production-submission launch_local_prover launch_cloud_prover psql check_proving_status
22

3-
IMAGE_VERSION=latest
4-
REPO_ROOT_DIR=./..
3+
export SCROLL_ZKVM_VERSION=0.2.0 # set SCROLL_ZKVM_VERSION to the correct version
4+
PG_URL=postgres://postgres@localhost:5432/scroll
55

66
batch_production_submission:
77
docker compose --profile batch-production-submission up
@@ -10,4 +10,16 @@ launch_local_prover:
1010
docker compose --profile cloud-prover up
1111

1212
launch_cloud_prover:
13-
docker compose --profile local-prover up
13+
docker compose --profile local-prover up
14+
15+
psql:
16+
psql 'postgres://postgres@localhost:5432/scroll'
17+
18+
check_proving_status:
19+
@echo "Checking proving status..."
20+
@result=$$(psql "${PG_URL}" -t -c "SELECT proving_status = 4 AS is_status_success FROM batch ORDER BY index LIMIT 1;" | tr -d '[:space:]'); \
21+
if [ "$$result" = "t" ]; then \
22+
echo "✅ Prove succeeded! You're ready to submit permissionless batch and proof!"; \
23+
else \
24+
echo "Proof is not ready..."; \
25+
fi

permissionless-batches/README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,42 @@ To produce a batch you need to run the `batch-production-submission` profile in
9090
3. Fill in required fields in `conf/relayer/config.json`
9191

9292

93-
Run with `docker compose --profile batch-production-submission up`.
93+
Run with `make batch_production_submission`.
9494
This will produce chunks, a batch and bundle which will be proven in the next step.
9595
`Success! You're ready to generate proofs!` indicates that everything is working correctly and the batch is ready to be proven.
9696

9797
#### Proving a batch
98-
To prove the chunk, batch and bundle you just generated you need to run the `proving` profile in `docker-compose.yml`.
98+
To prove the chunk, batch and bundle you just generated you need to run the `local-prover` or `cloud-prover` profile in `docker-compose.yml`.
99+
100+
Local Proving:
101+
102+
1. Hardware spec for local prover: CPU: 36+ core, 128G memory GPU: 24G memory (eg. Rtx 3090/3090Ti/4090/A10/L4)
103+
2. Make sure `verifier` `low_version_circuit` and `high_version_circuit` in `conf/coordinator/config.json` are correct for the latest fork: [TODO link list with versions](#batch-production-toolkit)
104+
2. Set the `SCROLL_ZKVM_VERSION` environment variable on `Makefile` to the correct version. [TODO link list with versions](#batch-production-toolkit)
105+
4. Fill in the required fields in `conf/proving-service/local-prover/config.json`
106+
107+
Run with `make local_prover`.
108+
109+
Cloud Proving:
99110

100111
1. Make sure `verifier` `low_version_circuit` and `high_version_circuit` in `conf/coordinator/config.json` are correct for the latest fork: [TODO link list with versions](#batch-production-toolkit)
101-
2. Download the latest `assets` and `params` for the circuit from [TODO link list with versions](#batch-production-toolkit) into `conf/coordinator/assets` and `conf/coordinator/params` respectively.
102-
3. Fill in the required fields in `conf/proving-service/config.json`. It is recommended to use Sindri. You'll need to obtain credits and an API key from their [website](https://sindri.app/).
103-
4. Alternatively, you can run your own prover: https://github.com/scroll-tech/scroll-prover. However, this requires more configuration.
112+
2. Set the `SCROLL_ZKVM_VERSION` environment variable on `Makefile` to the correct version. [TODO link list with versions](#batch-production-toolkit)
113+
3. Fill in the required fields in `conf/proving-service/cloud-prover/config.json`. It is recommended to use Sindri. You'll need to obtain credits and an API key from their [website](https://sindri.app/).
114+
115+
Run with `make cloud_prover`.
116+
117+
This will prove chunks, the batch and bundle.
118+
Run `make check_proving_status`
119+
`Success! You're ready to submit permissionless batch and proof!` indicates that everything is working correctly and the batch is ready to be submit.
104120

105-
Run with `docker compose --profile proving up`.
106121

107122

108123
#### Batch submission
109124
To submit the batch you need to run the `batch-production-submission` profile in `docker-compose.yml`.
110125

111126
1. Fill in required fields in `conf/relayer/config.json` for the sender config.
112127

113-
Run with `docker compose --profile batch-production-submission up`.
128+
Run with `make batch_production_submission`.
114129
This will submit the batch to L1 and finalize it. The transaction will be retried in case of failure.
115130

116131
**Troubleshooting**

permissionless-batches/conf/coordinator/coordinator_run.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
apt update
44
apt install -y wget libdigest-sha-perl
55

6+
# release version
7+
if [ -z "${SCROLL_ZKVM_VERSION}" ]; then
8+
echo "SCROLL_ZKVM_VERSION not set"
9+
exit 1
10+
fi
11+
612
if [ -z "${HTTP_PORT}" ]; then
713
echo "HTTP_PORT not set"
814
exit 1
@@ -48,9 +54,9 @@ ASSETS_URLS=(
4854

4955
# Define URLs for OpenVM files (No checksum verification)
5056
OPENVM_URLS=(
51-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/verifier/verifier.bin"
52-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/verifier/root-verifier-vm-config"
53-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/verifier/root-verifier-committed-exe"
57+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/verifier.bin"
58+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/root-verifier-vm-config"
59+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/root-verifier-committed-exe"
5460
)
5561

5662
# Function to download and verify files (skips existing valid files)

permissionless-batches/conf/proving-service/local-prover/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"connection_timeout_sec": 30
1111
},
1212
"l2geth": {
13-
"endpoint": "http://172.17.0.1:9999"
13+
"endpoint": "<L2 RPC with generated blocks reachable from Docker network>"
1414
},
1515
"prover": {
1616
"circuit_type": 2,

permissionless-batches/conf/proving-service/local-prover/prover_run.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,31 @@
33
apt update
44
apt install -y wget curl
55

6+
# release version
7+
if [ -z "${SCROLL_ZKVM_VERSION}" ]; then
8+
echo "SCROLL_ZKVM_VERSION not set"
9+
exit 1
10+
fi
11+
612
BASE_DOWNLOAD_DIR="/openvm"
713
# Ensure the base directory exists
814
mkdir -p "$BASE_DOWNLOAD_DIR"
915

1016
# Define URLs for OpenVM files (No checksum verification)
1117
OPENVM_URLS=(
12-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/chunk/app.vmexe"
13-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/chunk/openvm.toml"
14-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/batch/app.vmexe"
15-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/batch/openvm.toml"
16-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/app.vmexe"
17-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/app_euclidv1.vmexe"
18-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/openvm.toml"
19-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/verifier.bin"
20-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/verifier.sol"
21-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/digest_1.hex"
22-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/digest_2.hex"
23-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/digest_1_euclidv1.hex"
24-
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/0.2.0/bundle/digest_2_euclidv1.hex"
18+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/chunk/app.vmexe"
19+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/chunk/openvm.toml"
20+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/batch/app.vmexe"
21+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/batch/openvm.toml"
22+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/app.vmexe"
23+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/app_euclidv1.vmexe"
24+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/openvm.toml"
25+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/verifier.bin"
26+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/verifier.sol"
27+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/digest_1.hex"
28+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/digest_2.hex"
29+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/digest_1_euclidv1.hex"
30+
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/bundle/digest_2_euclidv1.hex"
2531
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/params/kzg_bn254_22.srs"
2632
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/params/kzg_bn254_24.srs"
2733
)

permissionless-batches/conf/relayer/config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"commit_sender_signer_config": {
1010
"signer_type": "PrivateKey",
1111
"private_key_signer_config": {
12-
"private_key": "1414141414141414141414141414141414141414141414141414141414141414"
12+
"private_key": "<the private key of L1 address to submit permissionless batch, please fund it in advance>"
1313
}
1414
},
1515
"l1_commit_gas_limit_multiplier": 1.2
@@ -46,9 +46,9 @@
4646
},
4747
"recovery_config": {
4848
"enable": true,
49-
"l1_block_height": <commit tx of last finalized batch on L1>,
50-
"latest_finalized_batch": <last finalized batch on L1>,
51-
"l2_block_height_limit": <L2 block up to which to produce batch>,
49+
"l1_block_height": "<commit tx of last finalized batch on L1>",
50+
"latest_finalized_batch": "<last finalized batch on L1>",
51+
"l2_block_height_limit": "<L2 block up to which to produce batch>",
5252
"force_latest_finalized_batch": false,
5353
"force_l1_message_count": 0,
5454
"submit_without_proof": false

permissionless-batches/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ services:
4747
- cloud-prover
4848
ports: [8556:8555]
4949
environment:
50+
- SCROLL_ZKVM_VERSION=${SCROLL_ZKVM_VERSION}
5051
- SCROLL_PROVER_ASSETS_DIR=/verifier/assets/
5152
- HTTP_PORT=8555
5253
- METRICS_PORT=8390
@@ -83,6 +84,7 @@ services:
8384
profiles:
8485
- local-prover
8586
environment:
87+
- SCROLL_ZKVM_VERSION=${SCROLL_ZKVM_VERSION}
8688
- LD_LIBRARY_PATH=/prover:/usr/local/cuda/lib64
8789
- RUST_MIN_STACK=16777216
8890
- RUST_BACKTRACE=1

0 commit comments

Comments
 (0)