diff --git a/coordinator/Makefile b/coordinator/Makefile index a5e10e23c..e25df0db0 100644 --- a/coordinator/Makefile +++ b/coordinator/Makefile @@ -37,7 +37,12 @@ coordinator_tool: localsetup: coordinator_api ## Local setup: build coordinator_api, copy config, and setup releases mkdir -p build/bin/conf @echo "Copying configuration files..." - cp -fL $(CURDIR)/conf/config.json $(CURDIR)/build/bin/conf/config.template.json + @if [ -f "$(PWD)/conf/config.template.json" ]; then \ + SRC="$(PWD)/conf/config.template.json"; \ + else \ + SRC="$(CURDIR)/conf/config.json"; \ + fi; \ + cp -fL "$$SRC" "$(CURDIR)/build/bin/conf/config.template.json" @echo "Setting up releases..." cd $(CURDIR)/build && bash setup_releases.sh diff --git a/coordinator/build/setup_releases.sh b/coordinator/build/setup_releases.sh index b170ec38e..be030a2fe 100644 --- a/coordinator/build/setup_releases.sh +++ b/coordinator/build/setup_releases.sh @@ -6,6 +6,9 @@ if [ -z "${SCROLL_ZKVM_VERSION}" ]; then exit 1 fi +# default fork name from env or "galileo" +SCROLL_FORK_NAME="${SCROLL_FORK_NAME:-galileo}" + # set ASSET_DIR by reading from config.json CONFIG_FILE="bin/conf/config.template.json" if [ ! -f "$CONFIG_FILE" ]; then @@ -28,7 +31,13 @@ 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") - + + # skip if this verifier's fork doesn't match the target fork + if [ "$FORK_NAME" != "$SCROLL_FORK_NAME" ]; then + echo "Expect $SCROLL_FORK_NAME, skip current fork ($FORK_NAME)" + continue + fi + if [ "$ASSETS_PATH" = "null" ]; then echo "Warning: Could not find assets_path for verifier $i, skipping..." continue diff --git a/coordinator/conf/config.json b/coordinator/conf/config.json index 50c9e6f01..72855ffe2 100644 --- a/coordinator/conf/config.json +++ b/coordinator/conf/config.json @@ -11,7 +11,7 @@ "verifiers": [ { "features": "legacy_witness:openvm_13", - "assets_path": "assets", + "assets_path": "assets_feynman", "fork_name": "feynman" }, { diff --git a/tests/prover-e2e/Makefile b/tests/prover-e2e/Makefile index b6cd216b4..e2459e566 100644 --- a/tests/prover-e2e/Makefile +++ b/tests/prover-e2e/Makefile @@ -9,7 +9,7 @@ ifndef END_BLOCK $(error END_BLOCK is not set. Define it in .make.env or pass END_BLOCK=) endif -all: setup_db test_tool prepare_db import_data +all: setup_db test_tool import_data clean: docker compose down @@ -42,9 +42,12 @@ setup_db: clean fi; \ done ${GOOSE_CMD} up + GOOSE_MIGRATION_DIR=conf ${GOOSE_CMD} up-to 100 -prepare_db: +reset_db: GOOSE_MIGRATION_DIR=conf ${GOOSE_CMD} down + ${GOOSE_CMD} down-to 0 + ${GOOSE_CMD} up GOOSE_MIGRATION_DIR=conf ${GOOSE_CMD} up-to 100 test_tool: @@ -64,8 +67,8 @@ import_data_galileo: build/bin/e2e_tool check_vars import_data: build/bin/e2e_tool check_vars build/bin/e2e_tool --config conf/config.json --codec ${CODEC_VERSION} ${BEGIN_BLOCK} ${END_BLOCK} -reimport_data: prepare_db import_data +reimport_data: reset_db import_data coordinator_setup: - $(MAKE) -C ../../coordinator localsetup + SCROLL_FORK_NAME=${SCROLL_FORK_NAME} $(MAKE) -C ../../coordinator localsetup cp -f conf/genesis.json ../../coordinator/build/bin/conf \ No newline at end of file diff --git a/tests/prover-e2e/cloak-xen/.make.env b/tests/prover-e2e/cloak-xen/.make.env index 0ec024ddd..944cca83d 100644 --- a/tests/prover-e2e/cloak-xen/.make.env +++ b/tests/prover-e2e/cloak-xen/.make.env @@ -1,3 +1,4 @@ BEGIN_BLOCK?=35 END_BLOCK?=49 -CODEC_VERSION?=8 \ No newline at end of file +CODEC_VERSION?=8 +SCROLL_FORK_NAME=feynman \ No newline at end of file diff --git a/tests/prover-e2e/cloak-xen/config.template.json b/tests/prover-e2e/cloak-xen/config.template.json new file mode 100644 index 000000000..b12ed1e92 --- /dev/null +++ b/tests/prover-e2e/cloak-xen/config.template.json @@ -0,0 +1,40 @@ +{ + "prover_manager": { + "provers_per_session": 1, + "session_attempts": 5, + "external_prover_threshold": 32, + "bundle_collection_time_sec": 180, + "batch_collection_time_sec": 180, + "chunk_collection_time_sec": 180, + "verifier": { + "min_prover_version": "v4.4.45", + "verifiers": [ + { + "assets_path": "assets", + "fork_name": "feynman" + } + ] + } + }, + "db": { + "driver_name": "postgres", + "dsn": "postgres://dev:dev@localhost/scroll?sslmode=disable", + "maxOpenNum": 200, + "maxIdleNum": 20 + }, + "l2": { + "validium_mode": true, + "chain_id": 5343513301, + "l2geth": { + "endpoint": "http://cloak-xen-sequencer.sepolia.scroll.tech:8545/" + } + }, + "auth": { + "secret": "prover secret key", + "challenge_expire_duration_sec": 3600, + "login_expire_duration_sec": 3600 + }, + "sequencer": { + "decryption_key": "ad25ba5de9f03fd9e3c81a1ad731c5c7e94ae2641f75ed7d3275312053b40f75" + } +} diff --git a/tests/prover-e2e/sepolia-feynman/.make.env b/tests/prover-e2e/sepolia-feynman/.make.env index c8f8a5c18..5ee66610b 100644 --- a/tests/prover-e2e/sepolia-feynman/.make.env +++ b/tests/prover-e2e/sepolia-feynman/.make.env @@ -1,3 +1,4 @@ BEGIN_BLOCK?=10973711 END_BLOCK?=10973721 -CODEC_VERSION?=8 \ No newline at end of file +CODEC_VERSION?=8 +SCROLL_FORK_NAME=feynman \ No newline at end of file diff --git a/tests/prover-e2e/sepolia-feynman/config.template.json b/tests/prover-e2e/sepolia-feynman/config.template.json new file mode 100644 index 000000000..3b86d579c --- /dev/null +++ b/tests/prover-e2e/sepolia-feynman/config.template.json @@ -0,0 +1,41 @@ +{ + "prover_manager": { + "provers_per_session": 1, + "session_attempts": 5, + "external_prover_threshold": 32, + "bundle_collection_time_sec": 180, + "batch_collection_time_sec": 180, + "chunk_collection_time_sec": 180, + "verifier": { + "min_prover_version": "v4.4.33", + "verifiers": [ + { + "features": "legacy_witness:openvm_13", + "assets_path": "assets_feynman", + "fork_name": "feynman" + } + ] + } + }, + "db": { + "driver_name": "postgres", + "dsn": "postgres://dev:dev@localhost/scroll?sslmode=disable", + "maxOpenNum": 200, + "maxIdleNum": 20 + }, + "l2": { + "validium_mode": false, + "chain_id": 534351, + "l2geth": { + "endpoint": "" + } + }, + "auth": { + "secret": "prover secret key", + "challenge_expire_duration_sec": 3600, + "login_expire_duration_sec": 3600 + }, + "sequencer": { + "decryption_key": "not need" + } +} diff --git a/tests/prover-e2e/sepolia-galileo/.make.env b/tests/prover-e2e/sepolia-galileo/.make.env index 59ee47dff..70025d04e 100644 --- a/tests/prover-e2e/sepolia-galileo/.make.env +++ b/tests/prover-e2e/sepolia-galileo/.make.env @@ -1,3 +1,4 @@ BEGIN_BLOCK?=20278022 END_BLOCK?=20278025 CODEC_VERSION?=9 +SCROLL_FORK_NAME=galileo \ No newline at end of file diff --git a/tests/prover-e2e/sepolia-galileo/config.template.json b/tests/prover-e2e/sepolia-galileo/config.template.json new file mode 100644 index 000000000..2999301b3 --- /dev/null +++ b/tests/prover-e2e/sepolia-galileo/config.template.json @@ -0,0 +1,40 @@ +{ + "prover_manager": { + "provers_per_session": 1, + "session_attempts": 5, + "external_prover_threshold": 32, + "bundle_collection_time_sec": 180, + "batch_collection_time_sec": 180, + "chunk_collection_time_sec": 180, + "verifier": { + "min_prover_version": "v4.4.33", + "verifiers": [ + { + "assets_path": "assets", + "fork_name": "galileo" + } + ] + } + }, + "db": { + "driver_name": "postgres", + "dsn": "postgres://dev:dev@localhost/scroll?sslmode=disable", + "maxOpenNum": 200, + "maxIdleNum": 20 + }, + "l2": { + "validium_mode": false, + "chain_id": 534351, + "l2geth": { + "endpoint": "" + } + }, + "auth": { + "secret": "prover secret key", + "challenge_expire_duration_sec": 3600, + "login_expire_duration_sec": 3600 + }, + "sequencer": { + "decryption_key": "not need" + } +}