Build

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

from this repository
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.json

Node.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.

CommandWhat 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.
FlagMeaning
--max NReplay at most N batches per rollup (default: all).
--from-batch NOnly list batches from N on. Replay still starts at genesis, and a failure before N still fails.
--jsonMachine-readable result on stdout; annotations go to stderr.
--report FILEAlso write the JSON result to FILE.
--allow-skipDo not fail when batches cannot be replayed because their inbox is no longer indexed.
--out FILEreceipt: write the receipt JSON.
--github / --no-githubGitHub annotations and job summary; on automatically when GITHUB_ACTIONS=true.
--rest URLREST endpoint (default https://api-testnet.qore.host, or $QORVA_REST_URL). Must serve qorechain-diana.
--timeout SECPer-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.

Codereplayreceipt / verify-receipt
0Every replayed state root matchesReceipt is valid
1A state root diverges: the batch is challengeableReceipt is not valid
2An inbox range does not hash to the committed dataHash, or batches were skipped (see --allow-skip)not used
3Usage or network error, unknown rollup, or not a qledger-v1 rollupUsage 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).

workflow step
- 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"
InputDefaultMeaning
rollup-idrequiredOne or more rollup ids, separated by spaces, commas or newlines.
max-batchesempty (all)Replay at most this many batches per rollup.
fail-on-skiptrueFail (exit 2) when batches cannot be replayed. Mismatches and divergences always fail.
from-batchemptyOnly list batches from this index on.
rest-urlempty (public testnet)REST endpoint serving qorechain-diana.
node-version22Node.js version for the CLI.
qorva-versionemptyRun 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-1 in 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 flipped dataHash gives 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.