Skip to content

Documentation / @etherfold/processor-entities / BootstrapOptions

Type Alias: BootstrapOptions ​

BootstrapOptions = object

Defined in: packages/processor-entities/src/snapshot.ts:84

Properties ​

fetch? ​

readonly optional fetch?: typeof globalThis.fetch

Defined in: packages/processor-entities/src/snapshot.ts:133

Injectable for tests and for a host with its own retry/timeout policy.


finalityDepth? ​

readonly optional finalityDepth?: number

Defined in: packages/processor-entities/src/snapshot.ts:111

The reorg depth this deployment protects against, in block numbers.

When given, a snapshot taken INSIDE the reorg-eligible window (fewer than this many blocks behind the chain tip its producer had observed) is declined. A snapshot carries no history below its own block, so a reorg reaching under it cannot be undone at any cost, and the cheapest place to avoid that is to not adopt such a snapshot in the first place. The store still refuses the revert loudly if one arrives anyway (RevertBeyondSnapshotError); this is the half that stops it happening.

Omitted means "trust the publisher took it far enough back", which is what the free-form path does implicitly.


processor ​

readonly processor: string

Defined in: packages/processor-entities/src/snapshot.ts:96

WHICH FOLD is about to index: the identity of the generation this store will belong to, as the deployment's ARRIVAL derived it (ADR-0086) -- the hash of the bundle's bytes where there are bytes.

A snapshot from another processor is not a candidate: entity rows are the output of the processor that wrote them, so adopting them under different logic is adopting another program's conclusions. The value is COMPARED for equality and never parsed, so how either side derived one is nothing this module has an opinion about.


replaceLocal? ​

readonly optional replaceLocal?: boolean

Defined in: packages/processor-entities/src/snapshot.ts:131

Whether openAndBootstrap may install over a store that has ALREADY SYNCED.

Off by default, and that default is the common case on every run after the first: a store with a cursor is left alone without a single request, and the tab catches up from its own cursor. true is what a host hands over when it has decided that catching up is not worth it or not possible (ADR-0096: the node refused the catch-up as an archive refusal, or the catch-up would take longer than the app's budget), and it is what PublicationSnapshot.replaceLocal (@etherfold/browser) carries to createState for exactly that reason. Forward it.

It does not make a snapshot BEHIND the store win: the choice is still bootstrapFromSnapshot's, so a store at or ahead of every candidate is kept (kept-local), and one behind the best candidate is REPLACED whole, through the one install (SnapshotAwareStateStore.bootstrap, which wipes first). Only openAndBootstrap reads it; bootstrapFromSnapshot already installs over a store that is behind.