Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
221599b
update dep and renaming modules
noel2004 Aug 6, 2025
8970299
refactor for dynamic loading
noel2004 Aug 8, 2025
8e8da95
dynamic asset loading
noel2004 Aug 8, 2025
8607162
fmt
noel2004 Aug 8, 2025
52db8ad
fix base64 issue for url safe
noel2004 Aug 9, 2025
6fc583f
Merge remote-tracking branch 'origin/develop' into feat/dyn_asset_loa…
noel2004 Aug 18, 2025
617271a
update zkvm-prover dep and fix
noel2004 Aug 18, 2025
e4bd639
remove "dump" util, fmt and clippy
noel2004 Aug 18, 2025
47bcca3
purge deprecated entry
noel2004 Aug 18, 2025
072475a
update gpu build lock
noel2004 Aug 18, 2025
e325b82
fixings for updating vk to hexstring
noel2004 Aug 19, 2025
c681446
lint
noel2004 Aug 19, 2025
8ef21f0
update according to reviews
noel2004 Aug 22, 2025
a75f857
purge out-dated comment
noel2004 Aug 22, 2025
7999f0d
update gpu for 0.5.6
noel2004 Aug 22, 2025
77d8b5b
fix issue in config template
noel2004 Aug 22, 2025
ab86d33
Merge remote-tracking branch 'origin/develop' into feat/dyn_asset_loa…
noel2004 Aug 25, 2025
65fa249
bump dep of zkvm-prover
noel2004 Aug 25, 2025
2afa27d
new metrics for proof stat
noel2004 Aug 25, 2025
6a9a34b
update metrics
noel2004 Aug 26, 2025
710e38e
Merge remote-tracking branch 'origin/develop' into feat/dyn_asset_loa…
noel2004 Aug 26, 2025
3cbd07c
one line command to setup coordinator configurations
noel2004 Aug 26, 2025
8593bb2
Merge branch 'feat/prover_metric' into feat/dyn_asset_loading
noel2004 Aug 27, 2025
ce7dcaf
Fix hardfork min version check
noel2004 Aug 27, 2025
6f60a8d
fix according to AI review
noel2004 Aug 27, 2025
e1286da
Revert config.json
noel2004 Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
411 changes: 215 additions & 196 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ repository = "https://github.com/scroll-tech/scroll"
version = "4.5.8"

[workspace.dependencies]
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", branch = "feat/0.5.1", package = "scroll-zkvm-prover" }
scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", branch = "feat/0.5.1", package = "scroll-zkvm-verifier" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", branch = "feat/0.5.1" }
scroll-zkvm-prover = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "89a2dc1" }
scroll-zkvm-verifier = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "89a2dc1" }
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "89a2dc1" }

sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3", features = ["scroll"] }
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3" }
Expand Down
7 changes: 7 additions & 0 deletions coordinator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ coordinator_cron:
coordinator_tool:
go build -ldflags "-X scroll-tech/common/version.ZkVersion=${ZK_VERSION}" -o $(PWD)/build/bin/coordinator_tool ./cmd/tool

localsetup: coordinator_api ## Local setup: build coordinator_api, copy config, and setup releases
@echo "Copying configuration files..."
cp -r $(PWD)/conf $(PWD)/build/bin/
@echo "Setting up releases..."
cd $(PWD)/build && bash setup_releases.sh


#coordinator_api_skip_libzkp:
# go build -ldflags "-X scroll-tech/common/version.ZkVersion=${ZK_VERSION}" -o $(PWD)/build/bin/coordinator_api ./cmd/api

Expand Down
62 changes: 62 additions & 0 deletions coordinator/build/setup_releases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash

# release version
if [ -z "${SCROLL_ZKVM_VERSION}" ]; then
echo "SCROLL_ZKVM_VERSION not set"
exit 1
fi

# set ASSET_DIR by reading from config.json
CONFIG_FILE="bin/conf/config.json"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Config file $CONFIG_FILE not found"
exit 1
fi

# get the number of verifiers in the array
VERIFIER_COUNT=$(jq -r '.prover_manager.verifier.verifiers | length' "$CONFIG_FILE")

if [ "$VERIFIER_COUNT" = "null" ] || [ "$VERIFIER_COUNT" -eq 0 ]; then
echo "No verifiers found in config file"
exit 1
fi

echo "Found $VERIFIER_COUNT verifier(s) in config"

# iterate through each verifier entry
for ((i=0; i<$VERIFIER_COUNT; i++)); do
# extract assets_path for current verifier
ASSETS_PATH=$(jq -r ".prover_manager.verifier.verifiers[$i].assets_path" "$CONFIG_FILE")
FORK_NAME=$(jq -r ".prover_manager.verifier.verifiers[$i].fork_name" "$CONFIG_FILE")

if [ "$ASSETS_PATH" = "null" ]; then
echo "Warning: Could not find assets_path for verifier $i, skipping..."
continue
fi

echo "Processing verifier $i ($FORK_NAME): assets_path=$ASSETS_PATH"

# check if it's an absolute path (starts with /)
if [[ "$ASSETS_PATH" = /* ]]; then
# absolute path, use as is
ASSET_DIR="$ASSETS_PATH"
else
# relative path, prefix with "bin/"
ASSET_DIR="bin/$ASSETS_PATH"
fi

echo "Using ASSET_DIR: $ASSET_DIR"

# create directory if it doesn't exist
mkdir -p "$ASSET_DIR"

# assets for verifier-only mode
echo "Downloading assets for $FORK_NAME to $ASSET_DIR..."
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/verifier.bin -O ${ASSET_DIR}/verifier.bin
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/openVmVk.json -O ${ASSET_DIR}/openVmVk.json

echo "Completed downloading assets for $FORK_NAME"
echo "---"
done

echo "All verifier assets downloaded successfully"
4 changes: 0 additions & 4 deletions coordinator/conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
"verifier": {
"min_prover_version": "v4.4.45",
"verifiers": [
{
"assets_path": "assets",
"fork_name": "euclidV2"
},
{
"assets_path": "assets",
"fork_name": "feynman"
Expand Down
24 changes: 21 additions & 3 deletions coordinator/internal/logic/verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package verifier

import (
"encoding/base64"
"encoding/hex"
"encoding/json"
"fmt"
"io"
Expand Down Expand Up @@ -129,6 +130,23 @@ const blocked_vks = `
D6YFHwTLZF/U2zpYJPQ3LwJZRm85yA5Vq2iFBqd3Mk4iwOUpS8sbOp3vg2+NDxhhKphgYpuUlykpdsoRhEt+cw==,
`

// tries to decode s as hex, and if that fails, as base64.
func decodeVkString(s string) ([]byte, error) {
// Try hex decoding first
if b, err := hex.DecodeString(s); err == nil {
return b, nil
}
// Fallback to base64 decoding
b, err := base64.StdEncoding.DecodeString(s)
if err != nil {
return nil, err
}
if len(b) == 0 {
return nil, fmt.Errorf("decode vk string %s fail (empty bytes)", s)
}
return b, nil
}

func (v *Verifier) loadOpenVMVks(cfg config.AssetConfig) error {

vkFileName := cfg.Vkfile
Expand Down Expand Up @@ -165,17 +183,17 @@ func (v *Verifier) loadOpenVMVks(cfg config.AssetConfig) error {
v.OpenVMVkMap[dump.Bundle] = struct{}{}
log.Info("Load vks", "from", cfg.AssetsPath, "chunk", dump.Chunk, "batch", dump.Batch, "bundle", dump.Bundle)

decodedBytes, err := base64.StdEncoding.DecodeString(dump.Chunk)
decodedBytes, err := decodeVkString(dump.Chunk)
if err != nil {
return err
}
v.ChunkVk[cfg.ForkName] = decodedBytes
decodedBytes, err = base64.StdEncoding.DecodeString(dump.Batch)
decodedBytes, err = decodeVkString(dump.Batch)
if err != nil {
return err
}
v.BatchVk[cfg.ForkName] = decodedBytes
decodedBytes, err = base64.StdEncoding.DecodeString(dump.Bundle)
decodedBytes, err = decodeVkString(dump.Bundle)
if err != nil {
return err
}
Expand Down
24 changes: 12 additions & 12 deletions crates/gpu_override/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

[patch."https://github.com/openvm-org/openvm.git"]
openvm-build = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-circuit = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-continuations = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-instructions ={ git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-native-circuit = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-native-compiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-native-recursion = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-native-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-rv32im-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-sdk = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false, features = ["parallel", "bench-metrics", "evm-prove"] }
openvm-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.2.1-rc.1-pipe", default-features = false }
openvm-build = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-circuit = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-continuations = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-instructions ={ git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-native-circuit = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-native-compiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-native-recursion = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-native-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-rv32im-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }
openvm-sdk = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false, features = ["parallel", "bench-metrics", "evm-prove"] }
openvm-transpiler = { git = "ssh://[email protected]/scroll-tech/openvm-gpu.git", branch = "patch-v1.3.0-pipe", default-features = false }

[patch."https://github.com/openvm-org/stark-backend.git"]
openvm-stark-backend = { git = "ssh://[email protected]/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] }
Expand Down Expand Up @@ -42,4 +42,4 @@ p3-poseidon2-air = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", t
p3-symmetric = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.1" }
p3-uni-stark = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.1" }
p3-maybe-rayon = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.1" } # the "parallel" feature is NOT on by default to allow single-threaded benchmarking
p3-bn254-fr = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.1" }
p3-bn254-fr = { git = "ssh://[email protected]/scroll-tech/plonky3-gpu.git", tag = "v0.2.1" }
Loading
Loading