Documentation / @etherfold/core / FetchRangeBelowFinalityError
Class: FetchRangeBelowFinalityError ​
Defined in: packages/core/src/errors.ts:515
A fetch width that can never reach the tip, so the cursor would never move.
Every cycle rewinds by the unconfirmed window before it fetches (getFromBlock: min(lastToBlock + 1, latestBlock - finality)), so a range CEILING at or below stream.finality re-asks for blocks that are already folded and stops short of the ones that are not. With finality: 3 and maxBlocksPerFetch: 2, a cursor at 103 asks for 102..103, applies nothing new, and asks for 102..103 again, for ever.
Why this is a refusal rather than a clamp ​
Both numbers are deliberate statements about a deployment -- how deep a reorg it will tolerate, and how wide a range its node will serve -- so silently raising one to satisfy the other would overrule an operator on exactly the axis they were being explicit about. It is refused at CONSTRUCTION, where both values are in hand, because the alternative is a process that starts cleanly, reports catching-up truthfully, and never indexes a block: a fold that makes no progress and says nothing is the worst shape a defect can take, and it was measured at 50+ identical eth_getLogs ranges in three seconds.
Only the CEILING is checked. numBlocksToFetchAtStart may legitimately sit below the finality depth, because the fetcher adapts it upwards towards maxBlocksPerFetch; the ceiling is the one it can never grow past.
Extends ​
TypeError
Constructors ​
Constructor ​
new FetchRangeBelowFinalityError(
maxBlocksPerFetch,finality):FetchRangeBelowFinalityError
Defined in: packages/core/src/errors.ts:518
Parameters ​
maxBlocksPerFetch ​
number
The configured fetch.maxBlocksPerFetch.
finality ​
number
The resolved stream.finality it has to clear.
Returns ​
FetchRangeBelowFinalityError
Overrides ​
TypeError.constructor
Properties ​
cause? ​
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24
Inherited from ​
TypeError.cause
finality ​
readonlyfinality:number
Defined in: packages/core/src/errors.ts:522
The resolved stream.finality it has to clear.
maxBlocksPerFetch ​
readonlymaxBlocksPerFetch:number
Defined in: packages/core/src/errors.ts:520
The configured fetch.maxBlocksPerFetch.
message ​
message:
string
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from ​
TypeError.message
name ​
readonlyname:"FetchRangeBelowFinalityError"='FetchRangeBelowFinalityError'
Defined in: packages/core/src/errors.ts:516
Overrides ​
TypeError.name
stack? ​
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from ​
TypeError.stack
Methods ​
isError() ​
staticisError(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 ​
TypeError.isError