Rollup CI
Rollup CI is a CLI and a GitHub Action that replay your rollup on every push and fail the job when a settled state root does not reproduce from the L1 inbox. A red build on a divergent batch is a challenge you can still file, if the schedule runs inside your challenge window.
The CLI
npm run qorva:cli:build # bundles packages/qorva-cli/dist/cli.js
node packages/qorva-cli/dist/cli.js replay setoff-1 vigil-pay-1
node packages/qorva-cli/dist/cli.js receipt setoff-1 113 --out receipt.json
node packages/qorva-cli/dist/cli.js verify-receipt receipt.jsonNode.js 20 or newer. packages/qorva-cli/build.mjs bundles src/cli.ts together with the app's own src/lib/replay-engine.ts using esbuild, so the CLI, the action and the console run the same replay code; @qorechain/rdk stays external as the only runtime dependency.
| Command | What it does |
|---|---|
| replay <id...> | Re-executes every batch from genesis and prints one row per batch. Several ids (space or comma separated) run in turn. |
| receipt <id> <batch> | Builds a settlement receipt, verifies it against the chain, and checks that a copy with one flipped state-root digit is rejected. |
| verify-receipt <file> | Verifies a receipt file (bare or { receipt }). Every field is re-read from the chain. |
| Flag | Meaning |
|---|---|
| --max N | Replay at most N batches per rollup (default: all). |
| --from-batch N | Only list batches from N on. Replay still starts at genesis, and a failure before N still fails. |
| --json | Machine-readable result on stdout; annotations go to stderr. |
| --report FILE | Also write the JSON result to FILE. |
| --allow-skip | Do not fail when batches cannot be replayed because their inbox is no longer indexed. |
| --out FILE | receipt: write the receipt JSON. |
| --github / --no-github | GitHub annotations and job summary; on automatically when GITHUB_ACTIONS=true. |
| --rest URL | REST endpoint (default https://api-testnet.qore.host, or $QORVA_REST_URL). Must serve qorechain-diana. |
| --timeout SEC | Per-request timeout, default 90. GET requests retry twice on network errors, 429 and 5xx. |
Exit codes
CI depends on these; the source says not to renumber them.
| Code | replay | receipt / verify-receipt |
|---|---|---|
| 0 | Every replayed state root matches | Receipt is valid |
| 1 | A state root diverges: the batch is challengeable | Receipt is not valid |
| 2 | An inbox range does not hash to the committed dataHash, or batches were skipped (see --allow-skip) | not used |
| 3 | Usage or network error, unknown rollup, or not a qledger-v1 rollup | Usage or network error, missing batch, no anchor yet; 3 also when the file is not a receipt |
With several rollups, divergence (1) outranks inbox problems (2), which outrank errors (3).
The GitHub Action
packages/qorva-cli/action/action.yml is a composite action. By default it builds the CLI from its own checkout, so it runs the replay core at the ref you pinned; with qorva-version it would run the npm package instead. A ready-to-copy workflow is in docs/ci/qorva-replay.yml (push, a */20 * * * * schedule, and manual dispatch).
- uses: OWNER/qorva/packages/qorva-cli/action@main
with:
rollup-id: my-rollup-1 # several: "a-1 b-2" or "a-1,b-2"
fail-on-skip: "true"| Input | Default | Meaning |
|---|---|---|
| rollup-id | required | One or more rollup ids, separated by spaces, commas or newlines. |
| max-batches | empty (all) | Replay at most this many batches per rollup. |
| fail-on-skip | true | Fail (exit 2) when batches cannot be replayed. Mismatches and divergences always fail. |
| from-batch | empty | Only list batches from this index on. |
| rest-url | empty (public testnet) | REST endpoint serving qorechain-diana. |
| node-version | 22 | Node.js version for the CLI. |
| qorva-version | empty | Run this published npm version instead of building from source. |
Outputs: exit-code and report (path to the JSON report, for actions/upload-artifact). Inside GitHub Actions the CLI adds ::error:: annotations naming the batch and both roots, a ::notice:: when everything reproduces, per-rollup log groups and a Markdown job summary.
Qorva runs it on itself
.github/workflows/qorva-self-check.yml runs on every push to main, every pull request and every six hours: it replays setoff-1 and vigil-pay-1 through the local action, builds and verifies the setoff-1 #113 receipt, verifies the saved file again with verify-receipt, and runs the Vitest suite.
Evidence
- 2026-11-30, every qledger-v1 rollup listed by the testnet (17): all pass, 890 of 890 replayed batches reproduce (sealed-scouts-1 capped at 400 in that run).
- 2026-11-30,
sealed-scouts-1in full: 2,950/2,950 in 550.9 s, exit 0. - Failure paths, from
docs/ROLLUP_CI.md: a test-only fetch hook that flips one settled root gives exit 1, a flippeddataHashgives exit 2, a dropped deposit gives exit 2 as a skip (0 with--allow-skip), and a custom-VM rollup, an unknown id or bad arguments give exit 3.