Skip to content

Documentation / @etherfold/processor-entities / Retention

Type Alias: Retention ​

Retention = { kind: "revert-only"; } | { blocks: number; kind: "window"; } | { kind: "unbounded"; }

Defined in: packages/state-store/dist/capabilities.d.ts:39

How far back superseded versions are kept.

The unit is BLOCK NUMBERS, and there is only one unit. Not updates: on the real measured stream event-bearing blocks are median 429 blocks apart, so a 64-block window holds exactly ONE event-bearing block, and reading a window of N blocks as N updates of history is wrong by orders of magnitude on any sparse contract. Not time either: wall-clock pruning would drop history a stalled indexer never finished writing, and would expire the whole window of a halted chain while its tip stands still. Retention keys on the thing that moves the tip.

Union Members ​

Type Literal ​

{ kind: "revert-only"; }

Superseded versions survive only as long as reorg revert needs them, which is the floor every store pays anyway. Historical reads are not available.


Type Literal ​

{ blocks: number; kind: "window"; }

Superseded versions are kept for blocks block numbers behind the tip, and prune is what drops the rest (retentionFloor is the one boundary both the refusal and the deletion are computed from).


Type Literal ​

{ kind: "unbounded"; }

Nothing is ever pruned: the whole history is readable.