diff --git a/.github/workflows/e2e-sysgo-cluster-prover.yml b/.github/workflows/e2e-sysgo-cluster-prover.yml new file mode 100644 index 000000000..ecb031304 --- /dev/null +++ b/.github/workflows/e2e-sysgo-cluster-prover.yml @@ -0,0 +1,52 @@ +name: Sysgo E2E Tests with Cluster Prover + +on: + workflow_dispatch: + inputs: + test_target: + description: "Test target (e.g. ./e2e/validity/altda/...)" + required: false + default: "./e2e/validity/altda/..." + timeout: + description: "Go test timeout" + required: false + default: "240m" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + e2e-sysgo-cluster-prover: + name: Cluster (${{ github.event.inputs.test_target }}) + runs-on: + - runs-on + - runner=64cpu-linux-x64 + - run-id=${{ github.run_id }} + - spot=false + - disk=large + timeout-minutes: 300 + + steps: + - name: Checkout sources + uses: actions/checkout@v5 + with: + submodules: true + + - name: Setup E2E environment + uses: ./.github/actions/setup-e2e-sysgo + + - name: Run E2E Tests with Cluster Proving + working-directory: tests + env: + SP1_PROVER: cluster + CLI_CLUSTER_RPC: ${{ secrets.CLI_CLUSTER_RPC }} + CLI_S3_BUCKET: ${{ secrets.CLI_S3_BUCKET }} + CLI_S3_REGION: ${{ secrets.CLI_S3_REGION }} + AWS_ACCESS_KEY_ID: ${{ secrets.CLUSTER_AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.CLUSTER_AWS_SECRET_ACCESS_KEY }} + OP_SUCCINCT_MOCK: "false" + PROVING_TIMEOUT: "21600" + run: | + echo "Running e2e tests with cluster proving..." + just test-e2e-sysgo-altda "${{ github.event.inputs.test_target }}" "${{ github.event.inputs.timeout }}" diff --git a/book/advanced/self-hosted-cluster.md b/book/advanced/self-hosted-cluster.md index eb63c4951..1b081f902 100644 --- a/book/advanced/self-hosted-cluster.md +++ b/book/advanced/self-hosted-cluster.md @@ -256,3 +256,47 @@ kubectl patch deploy cpu-node -n sp1-cluster --type='json' \ ``` Always keep `WORKER_MAX_WEIGHT_OVERRIDE` at 48 regardless of memory size — this prevents co-scheduling of two PlonkWraps. See [Cluster Resource Requirements](#cluster-resource-requirements). + +## E2E Testing with Cluster Proving + +The repository includes an E2E test that validates the full AltDA pipeline with real cluster proving: +`batcher → DA server → L1 commitment → witness gen → SP1 cluster proof → L2OO submission` + +### Running Locally + +```bash +cd tests + +SP1_PROVER=cluster \ +CLI_CLUSTER_RPC="http://:50051" \ +CLI_S3_BUCKET="" \ +CLI_S3_REGION="" \ +OP_SUCCINCT_MOCK=false \ +PROVING_TIMEOUT=21600 \ +just test-e2e-sysgo-altda "" "240m" +``` + +Key env vars: +- `SP1_PROVER=cluster` — routes proofs to the self-hosted cluster instead of mock or network +- `OP_SUCCINCT_MOCK=false` — required to avoid mock/cluster conflict panic +- `PROVING_TIMEOUT=21600` — 6h timeout per proof request (cluster proving is slower than network) +- Timeout arg `240m` — Go test timeout (cluster range + aggregation proofs take ~15–20 min with cached programs) + +### Running via CI + +The `e2e-sysgo-cluster-prover` workflow is **workflow_dispatch only** (not triggered by PRs or pushes) since it requires cluster infrastructure and takes significantly longer than mock-proving tests. + +Trigger it from the Actions tab or via CLI: +```bash +gh workflow run e2e-sysgo-cluster-prover.yml --ref +``` + +### Expected Timing (cached programs) + +| Phase | Duration | +|-------|----------| +| Range proof (10 blocks) | ~2–4 min | +| Aggregation proof (Plonk) | ~8–10 min | +| Total test | ~15–20 min | + +First run on a new ELF takes longer (2–4 hours) due to program compilation on the cluster. diff --git a/tests/utils/artifacts.go b/tests/utils/artifacts.go index 3383945d6..a481deb2b 100644 --- a/tests/utils/artifacts.go +++ b/tests/utils/artifacts.go @@ -12,6 +12,11 @@ func UseNetworkProver() bool { return os.Getenv("NETWORK_PRIVATE_KEY") != "" } +// UseClusterProver returns true if cluster proving is enabled (SP1_PROVER=cluster). +func UseClusterProver() bool { + return os.Getenv("SP1_PROVER") == "cluster" +} + // RepoRoot returns the op-succinct repo root. // Assumes this file is at tests/utils/artifacts.go func RepoRoot() string { diff --git a/tests/utils/runners.go b/tests/utils/runners.go index 387b4013f..dfa2c8470 100644 --- a/tests/utils/runners.go +++ b/tests/utils/runners.go @@ -10,6 +10,7 @@ import ( // Test timeouts. func ShortTimeout() time.Duration { return 20 * time.Minute } func LongTimeout() time.Duration { return 40 * time.Minute } +func ClusterTimeout() time.Duration { return 180 * time.Minute } // MaxProposerLag returns the maximum allowed lag between L2 finalized and proposer submissions. func MaxProposerLag() uint64 {