Skip to content

Documentation / @etherfold/processor-entities / RevertBeyondSnapshotError

Class: RevertBeyondSnapshotError ​

Defined in: packages/state-store/dist/snapshot.d.ts:66

A reorg that reaches below where a bootstrapped store's history begins.

Deliberately NOT a BlockUnavailableError, for the reason RevertBeyondPatchHistoryError records at the patch store: that family is about a READ this store cannot answer, and every member of it leaves the caller free to carry on with the tip. This is the write path -- the reorg was NOT undone, so the state is now known to be ahead of the canonical chain and there is nothing to carry on with.

Why this is a refusal and not something cleverer ​

There is nothing cleverer available. The snapshot IS the oldest state this store has; there are no superseded versions under it to reopen, so a revert below it cannot be performed at any cost. Reverting as far as the rows reach and reporting how far it got would leave a partly-undone reorg, which is a plausible state nothing downstream can tell apart from a correct one.

And why it should not happen to a well-behaved deployment ​

A snapshot taken at least the finality depth behind the chain tip cannot be reached by a reorg, which is what the finality depth is for. That is the PRODUCER's obligation and a consumer cannot verify it after the fact, so the consumer refuses: bootstrapFromSnapshot in @etherfold/processor-entities declines a candidate taken inside the reorg-eligible window when it is told the depth, and this error is what catches the case anyway.

What a host does with it is re-bootstrap from a newer snapshot, or index from the start block.

Extends ​

  • Error

Constructors ​

Constructor ​

new RevertBeyondSnapshotError(keepUpTo, snapshotOrigin): RevertBeyondSnapshotError

Defined in: packages/state-store/dist/snapshot.d.ts:72

Parameters ​

keepUpTo ​

number

The block the caller asked to keep up to.

snapshotOrigin ​

number

The block this store's contents came from: its oldest state.

Returns ​

RevertBeyondSnapshotError

Overrides ​

Error.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from ​

Error.cause


keepUpTo ​

readonly keepUpTo: number

Defined in: packages/state-store/dist/snapshot.d.ts:68

The block the caller asked to keep up to.


message ​

message: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from ​

Error.message


name ​

readonly name: "RevertBeyondSnapshotError" = "RevertBeyondSnapshotError"

Defined in: packages/state-store/dist/snapshot.d.ts:71

Overrides ​

Error.name


snapshotOrigin ​

readonly snapshotOrigin: number

Defined in: packages/state-store/dist/snapshot.d.ts:70

The block this store's contents came from: its oldest state.


stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.stack

Methods ​

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.error.d.ts:21

Indicates whether the argument provided is a built-in Error instance or not.

Parameters ​

error ​

unknown

Returns ​

error is Error

Inherited from ​

Error.isError