From 1921a7841752c96b450d0ac5cf298e3366afb412 Mon Sep 17 00:00:00 2001 From: andrussal Date: Mon, 8 Dec 2025 07:19:08 +0100 Subject: [PATCH] Centralize compose KZG setup in run-demo --- .github/workflows/lint.yml | 46 -------------------------------------- scripts/run-demo.sh | 12 +++++++++- 2 files changed, 11 insertions(+), 47 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c7657fa..b69ada5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -263,45 +263,6 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - - name: Install circuits for host build - env: - NOMOS_CIRCUITS_PLATFORM: linux-x86_64 - NOMOS_CIRCUITS_REBUILD_RAPIDSNARK: "0" - RAPIDSNARK_FORCE_REBUILD: "0" - RAPIDSNARK_BUILD_GMP: "0" - RAPIDSNARK_USE_ASM: "OFF" - run: | - CIRCUITS_DIR="${NOMOS_CIRCUITS}" - chmod +x scripts/setup-nomos-circuits.sh - scripts/setup-nomos-circuits.sh v0.3.1 "$CIRCUITS_DIR" - # Copy into build context so Docker doesn't need network - rm -rf testing-framework/assets/stack/kzgrs_test_params - mkdir -p testing-framework/assets/stack/kzgrs_test_params - if command -v rsync >/dev/null 2>&1; then - rsync -a --delete "$CIRCUITS_DIR"/ testing-framework/assets/stack/kzgrs_test_params/ - else - rm -rf testing-framework/assets/stack/kzgrs_test_params/* - cp -a "$CIRCUITS_DIR"/. testing-framework/assets/stack/kzgrs_test_params/ - fi - # Backward compatibility: some images/tools still look for a top-level proving key. - if [ -f testing-framework/assets/stack/kzgrs_test_params/pol/proving_key.zkey ]; then - cp testing-framework/assets/stack/kzgrs_test_params/pol/proving_key.zkey \ - testing-framework/assets/stack/kzgrs_test_params/proving_key.zkey - fi - echo "NOMOS_CIRCUITS=$CIRCUITS_DIR" >> "$GITHUB_ENV" - echo "CIRCUITS_OVERRIDE=testing-framework/assets/stack/kzgrs_test_params" >> "$GITHUB_ENV" - # Ensure we do not pick up incompatible host-built binaries - rm -rf testing-framework/assets/stack/bin - - - name: Build compose test image - env: - DOCKER_CLI_HINTS: "false" - IMAGE_TAG: ${{ env.NOMOS_TESTNET_IMAGE }} - CIRCUITS_OVERRIDE: ${{ env.CIRCUITS_OVERRIDE }} - run: | - chmod +x testing-framework/assets/stack/scripts/build_test_image.sh - testing-framework/assets/stack/scripts/build_test_image.sh - - name: Run compose mixed workload binary env: POL_PROOF_DEV_MODE: "true" @@ -317,13 +278,6 @@ jobs: NOMOS_LOG_DIR: "${{ github.workspace }}/.tmp/compose-logs" run: | mkdir -p "$TMPDIR" - # Pre-flight: ensure KZG params exist where compose will mount them. - KZG_FILE=testing-framework/assets/stack/kzgrs_test_params/kzgrs_test_params - if [ ! -f "$KZG_FILE" ]; then - echo "KZG params missing at $KZG_FILE" >&2 - ls -l testing-framework/assets/stack/kzgrs_test_params || true - exit 1 - fi scripts/run-demo.sh compose 60 - name: Collect compose logs diff --git a/scripts/run-demo.sh b/scripts/run-demo.sh index f83fc19..e70f0b8 100755 --- a/scripts/run-demo.sh +++ b/scripts/run-demo.sh @@ -92,6 +92,11 @@ if [ ! -x "${HOST_BUNDLE_PATH}/zksign/witness_generator" ]; then echo "Host circuits missing zksign/witness_generator; repairing..." "${ROOT_DIR}/scripts/setup-circuits-stack.sh" "${VERSION}" fi +KZG_HOST_PATH="${HOST_BUNDLE_PATH}/kzgrs_test_params" +if [ ! -f "${KZG_HOST_PATH}" ]; then + echo "KZG params missing at ${KZG_HOST_PATH}; rebuilding circuits bundle" + "${ROOT_DIR}/scripts/setup-circuits-stack.sh" "${VERSION}" +fi if [ "$MODE" != "local" ]; then if [ "${NOMOS_SKIP_IMAGE_BUILD:-0}" = "1" ]; then @@ -108,10 +113,15 @@ fi echo "==> Running ${BIN} for ${RUN_SECS}s" cd "${ROOT_DIR}" +if [ "$MODE" = "compose" ] || [ "$MODE" = "k8s" ]; then + KZG_PATH="/kzgrs_test_params/kzgrs_test_params" +else + KZG_PATH="${KZG_HOST_PATH}" +fi POL_PROOF_DEV_MODE=true \ NOMOS_TESTNET_IMAGE="${IMAGE}" \ NOMOS_CIRCUITS="${HOST_BUNDLE_PATH}" \ -NOMOS_KZGRS_PARAMS_PATH="${HOST_BUNDLE_PATH}/kzgrs_test_params" \ +NOMOS_KZGRS_PARAMS_PATH="${KZG_PATH}" \ COMPOSE_DEMO_RUN_SECS="${RUN_SECS}" \ LOCAL_DEMO_RUN_SECS="${RUN_SECS}" \ K8S_DEMO_RUN_SECS="${RUN_SECS}" \