@pwngh/economy-lab
    Preparing search index...

    Interface CheckpointStore

    Stores signed ledger snapshots. Written only by the background worker.

    interface CheckpointStore {
        archiveHeads?(options?: CallOptions): Promise<readonly ArchiveHead[]>;
        archiveState?(options?: CallOptions): Promise<ArchiveState | null>;
        latest(options?: CallOptions): Promise<Checkpoint | null>;
        put(checkpoint: Checkpoint, options?: CallOptions): Promise<void>;
        putArchiveBoundary?(
            state: ArchiveState,
            heads: readonly ArchiveHead[],
            options?: CallOptions,
        ): Promise<void>;
        putReproof?(state: Reproof, options?: CallOptions): Promise<void>;
        putSealHeads?(
            leaves: readonly SealHead[],
            options?: CallOptions & { replaceAll?: boolean },
        ): Promise<void>;
        reproof?(options?: CallOptions): Promise<Reproof | null>;
        sealHeads?(options?: CallOptions): Promise<readonly SealHead[]>;
    }
    Index
    • Every per-account archive head (see ArchiveHead); empty before the first archival. The prover authenticates these rows against ArchiveState's signed root before trusting any pruned boundary — an unauthenticated boundary row would be an anchor the attacker can move.

      Parameters

      Returns Promise<readonly ArchiveHead[]>

    • The archival watermark (see ArchiveState): how much of the oldest history the mover has moved to cold storage, under a root and signature over the per-account archive heads. Null before the first archival. Absent (with the other archive surfaces), the mover refuses to run — a mover that cannot record its progress durably and signed must not delete anything.

      Parameters

      Returns Promise<ArchiveState | null>

    • Replaces the signed state and upserts the advanced heads in one atomic write. The state's root and signature authenticate the head set, so a partial write would read as a tampered boundary on the next resume.

      Parameters

      Returns Promise<void>

    • Optional incremental-seal snapshot: upserts leaves into the one-row-per-account sealed-head table. The seal writes only the accounts that changed, so the table always mirrors the latest checkpoint's full leaf set at O(dirty) cost. With replaceAll, rows absent from leaves are removed first — the full-replay seal's rewrite, which purges any stray row a corruption left behind so the fast path can return. Absent (with sealHeads), every seal re-proves the whole chain.

      Parameters

      Returns Promise<void>

    • Optional rolling re-proof state (src/worker/reproof.ts): where the link walk stands and when the last full rotation completed — the verified-through watermark that makes "how much of stored history has been re-hashed, and how recently" a queryable fact instead of an assumption. Null before the first sweep. Absent (with putReproof), the sweep is a no-op.

      Parameters

      Returns Promise<Reproof | null>