Skip to content

Documentation / @etherfold/core / SuspectedTruncationError

Class: SuspectedTruncationError ​

Defined in: packages/core/src/errors.ts:325

A result set that MIGHT be everything in the range, and might be all the node felt like returning.

The dangerous case this exists for is a provider that caps eth_getLogs SILENTLY: no error, no marker, just exactly N logs back. That is indistinguishable from a range that genuinely holds N, and the difference matters more here than anywhere else in the system, because a short payload delivered as a complete range is read by the receiver as an ABSENCE, and an absence is a reorg, and a reorg DELETES state (ADR-0004; the same inference produced the bug fixed in d24872f).

So a fetch landing exactly on the cap is treated as suspect and the range is halved until the answer comes back under it. This is thrown only when there is nothing left to halve: a SINGLE block that still returns exactly the cap. At that point there is no honest answer available, and refusing to push is the only safe move -- delivering could destroy state, and lowering toBlock further is not possible.

The operator's fix is to raise the fetcher's maxEventsPerFetch above the node's real cap (so a full answer no longer LOOKS like a capped one) or to use a node that does not cap silently.

It names WHERE the count came from, because the fix depends on it: a count this deployment CONFIGURED is wrong and should be corrected, while a count the PROVIDER reported about itself is the node's own claim about its cap, and overriding that means configuring one (configuration wins over a report).

Extends ​

  • Error

Constructors ​

Constructor ​

new SuspectedTruncationError(blockNumber, logCount, source): SuspectedTruncationError

Defined in: packages/core/src/errors.ts:330

Parameters ​

blockNumber ​

number

logCount ​

number

source ​

SuspectResultCountSource

Returns ​

SuspectedTruncationError

Overrides ​

Error.constructor

Properties ​

blockNumber ​

readonly blockNumber: number

Defined in: packages/core/src/errors.ts:331


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


logCount ​

readonly logCount: number

Defined in: packages/core/src/errors.ts:332


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: "SuspectedTruncationError" = 'SuspectedTruncationError'

Defined in: packages/core/src/errors.ts:326

Overrides ​

Error.name


retryable ​

readonly retryable: false = false

Defined in: packages/core/src/errors.ts:328

The same block will return the same count next time. Waiting changes nothing.


source ​

readonly source: SuspectResultCountSource

Defined in: packages/core/src/errors.ts:333


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