Lifecycles
The RDK tracks two state machines: the rollup lifecycle (the rollup itself) and the settlement-batch lifecycle (each anchored batch). It exposes helpers to check which transitions are legal before you submit.
Rollup lifecycle
A rollup moves through four states. The creator drives the transitions.
PENDING ──▶ ACTIVE ──▶ PAUSED ──▶ STOPPED
▲ │
└───────────┘
(resume)
| State | Meaning |
|---|---|
pending | Created and registered, not yet producing batches |
active | Operating normally; accepting settlement batches |
paused | Temporarily halted by the creator; resumable |
stopped | Permanently halted |
Creator-driven transitions:
- pause —
active→paused - resume —
paused→active - stop —
activeorpaused→stopped(terminal)
The RDK guards these transitions so you do not submit an illegal one:
import { canPerformRollupAction, assertRollupAction } from "@qorechain/rdk";
canPerformRollupAction("pause", "active"); // true
canPerformRollupAction("resume", "active"); // false
// Throws if the action is not legal from the current status.
assertRollupAction("stop", "paused"); // ok
// The tx client exposes the matching operations:
// await tx.pauseRollup({ rollupId });
// await tx.resumeRollup({ rollupId });
// await tx.stopRollup({ rollupId });
Settlement-batch lifecycle
Each settlement batch has its own states. The happy path is
SUBMITTED → FINALIZED. Under optimistic settlement, a batch can additionally be
challenged.
SUBMITTED ──▶ FINALIZED
│
└──▶ CHALLENGED ──▶ REJECTED (optimistic only)
| State | Meaning |
|---|---|
submitted | Anchored, awaiting finalization |
challenged | Disputed during the optimistic challenge window |
finalized | Final and irreversible |
rejected | Found invalid and discarded |
- Optimistic: a batch is
submitted, and if it survives the challenge window it becomesfinalized. A challenger can move it tochallenged; an upheld challenge ends inrejected. - ZK: a batch is
submittedwith a validity proof andfinalizedonce the on-chain verifier accepts it. - Based / sovereign: a batch is
submittedand finalizes per the paradigm.
Challenge-window math
For optimistic rollups, the RDK helps you reason about the challenge window:
import {
challengeWindowDeadline,
isChallengeWindowClosed,
isBatchFinal,
} from "@qorechain/rdk";
// Read the live window from rdk.params().defaultChallengeWindow (seconds).
const deadline = challengeWindowDeadline(submittedAtSecs, windowSecs);
const closed = isChallengeWindowClosed(submittedAtSecs, windowSecs, nowSecs);
isBatchFinal("finalized"); // true
isBatchFinal("submitted"); // false
See Settlement paradigms and Proof systems for how each paradigm drives finalization.