Skip to content

Documentation / @etherfold/browser / StoredLastSync

Type Alias: StoredLastSync ​

StoredLastSync = object

Defined in: packages/core/dist/types.d.ts:115

THE CURSOR AS THE STREAM SEAM SPEAKS IT: the same three block numbers and the same context as a LastSync, with the reorg window's events narrowed to what the node said.

It exists so that the compile-time refusal covers BOTH halves of what a keeper is handed. Core strips the window on the way into saveNewEvents exactly as it strips the batch (storedLastSyncOf), so a seam that still declared LastSync<ABI> there would be promising an implementor a decoded half that is undefined at runtime -- a type that lies about the value, which is a worse hole than the one this spec set out to close.

Deliberately a SEPARATE type and NOT a narrowing of LastSync, which the processor seam, the load path, the state keepers and the wire all speak. What a stream keeper is handed is the one place the window is raw; re-meaning the shared cursor for everybody else would be a far larger claim than this one, and this type is used by StreamFetcher and StreamSaver and by nothing else.

The RETURN side costs a keeper nothing: no keeper stores a window at all (ADR-0035, as amended -- the stream's copy is read by nobody and generateStreamFromReplay rebuilds it by walking the events), so every shipped implementation returns an empty one.

The choice between this and leaving the window typed LastSync<ABI>, and what each costs, is ADR-0060.

Properties ​

context ​

context: ContextIdentifier

Defined in: packages/core/dist/types.d.ts:116


lastFromBlock ​

lastFromBlock: number

Defined in: packages/core/dist/types.d.ts:118


lastToBlock ​

lastToBlock: number

Defined in: packages/core/dist/types.d.ts:119


latestBlock ​

latestBlock: number

Defined in: packages/core/dist/types.d.ts:117


unconfirmedBlocks ​

unconfirmedBlocks: StoredEventBlock[]

Defined in: packages/core/dist/types.d.ts:120