-
Notifications
You must be signed in to change notification settings - Fork 620
morty/permissionless batches recovery #1639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jt/permissionless-batches-recovery
Are you sure you want to change the base?
Changes from all commits
af38122
2cc9f65
eacdc78
7ec6d47
893bf18
b3c1df7
110083c
fcbaa67
2d40f0f
c743efd
1ea9aca
88da493
b8c7ec2
f288179
64368f9
be88ef6
fe6451b
bcc6b0f
5cf8cda
8db4e5c
a6ed321
7486236
b984341
8cf087c
9996af6
0e82c63
2846ecf
ad2e94e
0fc28cb
ef9e25f
e3b17a0
86e6555
87e1235
5f8bb53
7d5b77a
12a262a
5869bfd
7d4ff80
9f480e5
459941d
b4546af
3a3db5f
cb87c7a
4822d38
8befb84
2d620dd
bab0e4f
135073c
77d6322
cf41048
11afeb1
07d1621
60877d3
9b5c42e
ae212a9
09790c4
0bb5314
901693a
3454c6c
c6f0299
4b21c79
3ee2d2b
e333288
2fb27ce
b3e4667
ed05728
d0cb8b9
77dceae
b73acca
1bec964
8994767
b59db73
5cfb8b6
01d0e48
78a458d
83c0a08
42bfcb8
d82e109
2a8330c
4c2a755
2b318ec
886af07
9033471
9bb768e
0023934
c484925
917b143
8f4fc9a
1572680
d113865
de9a397
0df9ede
4c4cff0
e04eaa9
80af426
c65622b
38af170
87fc179
445b6bf
db65d8d
f045984
c3c733c
a808f4b
8b52ad5
ec4b1bf
6356c79
bc05b87
52c9eab
20a4c38
eb04383
83ba892
dced0c6
8b7f280
9d43e97
8d76b47
e7597b3
69a71ec
e3bab24
e011f6a
0d95f6a
a5e911e
4046579
ecc3926
17214d4
e3a1e5d
50d5e65
3be65c1
912726d
e1fa955
28b8a23
af5f1e0
ee3b49b
9d46ed1
7fcbe39
794bc0a
21d8d9f
0d5571c
f314228
a1300bd
c0aa3bd
287fa33
c26446e
12031b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
conf/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.PHONY: batch-production-submission launch_local_prover launch_cloud_prover psql check_proving_status | ||
|
||
export SCROLL_ZKVM_VERSION=0.3.0 | ||
PG_URL=postgres://postgres@localhost:5432/scroll | ||
|
||
batch_production_submission: | ||
docker compose --profile batch-production-submission up | ||
|
||
local_prover: | ||
docker compose --profile local-prover up | ||
|
||
cloud_prover: | ||
docker compose --profile cloud-prover up | ||
|
||
psql: | ||
psql 'postgres://postgres@localhost:5432/scroll' | ||
|
||
check_proving_status: | ||
@echo "Checking proving status..." | ||
@result=$$(psql "${PG_URL}" -t -c "SELECT proving_status = 4 AS is_status_success FROM batch ORDER BY index LIMIT 1;" | tr -d '[:space:]'); \ | ||
if [ "$$result" = "t" ]; then \ | ||
echo "✅ Prove succeeded! You're ready to submit permissionless batch and proof!"; \ | ||
else \ | ||
echo "Proof is not ready..."; \ | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
{ | ||
"prover_manager": { | ||
"provers_per_session": 1, | ||
"session_attempts": 5, | ||
"bundle_collection_time_sec": 3600, | ||
"batch_collection_time_sec": 3600, | ||
"chunk_collection_time_sec": 3600, | ||
"session_attempts": 100, | ||
"chunk_collection_time_sec": 36000, | ||
"batch_collection_time_sec": 2700, | ||
"bundle_collection_time_sec": 2700, | ||
"verifier": { | ||
"mock_mode": false, | ||
"low_version_circuit": { | ||
"params_path": "./conf/params", | ||
"assets_path": "./conf/assets", | ||
"fork_name": "darwinV2", | ||
"min_prover_version": "v4.4.55" | ||
}, | ||
"high_version_circuit": { | ||
"params_path": "./conf/params", | ||
"assets_path": "./conf/assets", | ||
"low_version_circuit" : { | ||
"fork_name": "darwinV2", | ||
"params_path": "/verifier/params", | ||
"assets_path": "/verifier/assets", | ||
"min_prover_version": "v4.4.56" | ||
}, | ||
"high_version_circuit" : { | ||
"fork_name": "euclid", | ||
jonastheis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"assets_path": "/verifier/openvm/verifier", | ||
"min_prover_version": "v4.5.7" | ||
} | ||
} | ||
}, | ||
|
@@ -28,11 +27,11 @@ | |
"maxIdleNum": 20 | ||
}, | ||
"l2": { | ||
"chain_id": 111 | ||
"chain_id": 333333 | ||
}, | ||
"auth": { | ||
"secret": "prover secret key", | ||
"challenge_expire_duration_sec": 3600, | ||
"secret": "e788b62d39254928a821ac1c76b274a8c835aa1e20ecfb6f50eb10e87847de44", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this value static or does the user need to fill it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For convenience of users, we can make this value static. It won't bring any security issue from my perspective. |
||
"challenge_expire_duration_sec": 10, | ||
"login_expire_duration_sec": 3600 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#!/usr/bin/bash | ||
|
||
apt update | ||
apt install -y wget libdigest-sha-perl | ||
|
||
# release version | ||
if [ -z "${SCROLL_ZKVM_VERSION}" ]; then | ||
echo "SCROLL_ZKVM_VERSION not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${HTTP_PORT}" ]; then | ||
echo "HTTP_PORT not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${METRICS_PORT}" ]; then | ||
echo "METRICS_PORT not set" | ||
exit 1 | ||
fi | ||
|
||
case $CHAIN_ID in | ||
"5343532222") # staging network | ||
echo "staging network not supported" | ||
exit 1 | ||
;; | ||
"534353") # alpha network | ||
echo "alpha network not supported" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
BASE_DOWNLOAD_DIR="/verifier" | ||
# Ensure the base directory exists | ||
mkdir -p "$BASE_DOWNLOAD_DIR" | ||
|
||
# Set subdirectories | ||
ASSETS_DIR="$BASE_DOWNLOAD_DIR/assets" | ||
OPENVM_DIR="$BASE_DOWNLOAD_DIR/openvm" | ||
|
||
# Create necessary directories | ||
mkdir -p "$ASSETS_DIR" | ||
mkdir -p "$OPENVM_DIR/verifier" | ||
|
||
# Define URLs for asset files | ||
ASSETS_CHECKSUM_URL="https://circuit-release.s3.us-west-2.amazonaws.com/release-v0.13.1/sha256sum" | ||
ASSETS_CHECKSUM_FILE="$ASSETS_DIR/sha256sum" | ||
|
||
ASSETS_URLS=( | ||
"https://circuit-release.s3.us-west-2.amazonaws.com/release-v0.13.1/vk_batch.vkey" | ||
"https://circuit-release.s3.us-west-2.amazonaws.com/release-v0.13.1/vk_bundle.vkey" | ||
"https://circuit-release.s3.us-west-2.amazonaws.com/release-v0.13.1/vk_chunk.vkey" | ||
) | ||
|
||
# Define URLs for OpenVM files (No checksum verification) | ||
OPENVM_URLS=( | ||
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/verifier.bin" | ||
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/root-verifier-vm-config" | ||
"https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/root-verifier-committed-exe" | ||
) | ||
|
||
# Function to download and verify files (skips existing valid files) | ||
download_and_verify() { | ||
local url="$1" | ||
local dest_dir="$2" | ||
local checksum_file="$3" | ||
|
||
local filename=$(basename "$url") | ||
local filepath="$dest_dir/$filename" | ||
|
||
if [[ -f "$filepath" ]]; then | ||
echo "Checking existing file: $filename..." | ||
if grep "$filename" "$checksum_file" | sed "s|$filename|$filepath|" | sha256sum --check --status; then | ||
echo "File is already present and valid ✅ - Skipping download." | ||
return | ||
else | ||
echo "File exists but checksum mismatch ❌ - Re-downloading." | ||
rm -f "$filepath" | ||
fi | ||
fi | ||
|
||
echo "Downloading $filename..." | ||
curl -o "$filepath" -L "$url" | ||
|
||
if [[ ! -f "$filepath" ]]; then | ||
echo "Download failed for $filename ❌" | ||
exit 1 | ||
fi | ||
|
||
echo "Verifying checksum for $filename..." | ||
grep "$filename" "$checksum_file" | sed "s|$filename|$filepath|" | sha256sum --check --status || exit 1 | ||
echo "Checksum verification passed for $filename ✅" | ||
} | ||
|
||
# Download and verify asset files | ||
curl -o "$ASSETS_CHECKSUM_FILE" -L "$ASSETS_CHECKSUM_URL" | ||
for url in "${ASSETS_URLS[@]}"; do | ||
download_and_verify "$url" "$ASSETS_DIR" "$ASSETS_CHECKSUM_FILE" | ||
done | ||
|
||
# Download OpenVM files (No checksum verification, but skips if file exists) | ||
for url in "${OPENVM_URLS[@]}"; do | ||
dest_subdir="$OPENVM_DIR/$(basename $(dirname "$url"))" | ||
mkdir -p "$dest_subdir" | ||
|
||
filepath="$dest_subdir/$(basename "$url")" | ||
echo "Downloading $filepath..." | ||
curl -o "$filepath" -L "$url" | ||
done | ||
|
||
mkdir -p "$HOME/.openvm" | ||
ln -s "$OPENVM_DIR/params" "$HOME/.openvm/params" | ||
|
||
echo "All files downloaded successfully! 🎉" | ||
|
||
mkdir -p /usr/local/bin | ||
wget https://github.com/ethereum/solidity/releases/download/v0.8.19/solc-static-linux -O /usr/local/bin/solc | ||
chmod +x /usr/local/bin/solc | ||
|
||
# Start coordinator | ||
echo "Starting coordinator api" | ||
|
||
RUST_BACKTRACE=1 exec coordinator_api --config /coordinator/config.json \ | ||
--genesis /coordinator/genesis.json \ | ||
--http --http.addr "0.0.0.0" --http.port ${HTTP_PORT} \ | ||
--metrics --metrics.addr "0.0.0.0" --metrics.port ${METRICS_PORT} \ | ||
--log.debug |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"prover_name_prefix": "prover", | ||
"keys_dir": "keys", | ||
"coordinator": { | ||
"base_url": "http://coordinator:8390", | ||
"retry_count": 10, | ||
"retry_wait_time_sec": 10, | ||
"connection_timeout_sec": 30 | ||
}, | ||
"l2geth": { | ||
"endpoint": "<L2 RPC with generated blocks reachable from Docker network>" | ||
}, | ||
"prover": { | ||
"circuit_type": 2, | ||
"supported_proof_types": [ | ||
1, | ||
2, | ||
3 | ||
], | ||
"circuit_version": "v0.13.1" | ||
}, | ||
"db_path": "db" | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"sdk_config": { | ||
"prover_name_prefix": "local_prover", | ||
"keys_dir": "/keys", | ||
"db_path": "/db", | ||
"coordinator": { | ||
"base_url": "http://172.17.0.1:8556", | ||
"retry_count": 10, | ||
"retry_wait_time_sec": 10, | ||
"connection_timeout_sec": 30 | ||
}, | ||
"l2geth": { | ||
"endpoint": "<L2 RPC with generated blocks reachable from Docker network>" | ||
}, | ||
"prover": { | ||
"circuit_type": 2, | ||
"supported_proof_types": [1,2,3], | ||
"circuit_version": "v0.13.1" | ||
}, | ||
"health_listener_addr": "0.0.0.0:89" | ||
}, | ||
"circuits": { | ||
"euclidV2": { | ||
"hard_fork_name": "euclidV2", | ||
"workspace_path": "/openvm" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not related to this PR, but do we have some docs for the next step? e.g., withdraw the funds in L1. If any, it's nice to have it placed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah there should be some more extended docs on how to do this from beginning to end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, @jonastheis Do you want me to add those steps? Or you will do it later.