Documentation / @etherfold/core / GenesisHashMismatchError
Class: GenesisHashMismatchError ​
Defined in: packages/core/src/errors.ts:659
A provider serving a chain whose GENESIS BLOCK is not the one the source declares.
The stronger of the two identity checks the load path makes, and the reason it exists: two chains can share a chainId and cannot share a genesis block, so a node that passed eth_chainId can still be the wrong node. Indexing a fork's logs into a state that claims to be the canonical chain's is silent and permanent, so this refuses at LOAD, before a single log is fetched.
It carries both hashes, because "these two differ" is not actionable and the numbers are what an operator compares against their contracts file. This is the ONLY one of the three genesis-check refusals that is a claim about WHICH CHAIN the node is on; the other two (GenesisBlockNotServedError, GenesisCheckUnavailableError) mean the check could not be MADE, and saying so in this one's wording is what used to send operators hunting for a misconfiguration that was not there.
Extends ​
Error
Constructors ​
Constructor ​
new GenesisHashMismatchError(
expectedGenesisHash,receivedGenesisHash):GenesisHashMismatchError
Defined in: packages/core/src/errors.ts:664
Parameters ​
expectedGenesisHash ​
string
The genesisHash the source declares.
receivedGenesisHash ​
string
The hash the node answered for block 0x0.
Returns ​
GenesisHashMismatchError
Overrides ​
Error.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 ​
Error.cause
expectedGenesisHash ​
readonlyexpectedGenesisHash:string
Defined in: packages/core/src/errors.ts:666
The genesisHash the source declares.
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 ​
readonlyname:"GenesisHashMismatchError"='GenesisHashMismatchError'
Defined in: packages/core/src/errors.ts:660
Overrides ​
Error.name
receivedGenesisHash ​
readonlyreceivedGenesisHash:string
Defined in: packages/core/src/errors.ts:668
The hash the node answered for block 0x0.
retryable ​
readonlyretryable:false=false
Defined in: packages/core/src/errors.ts:662
A node does not wander onto another chain's genesis while a caller waits.
stack? ​
optionalstack?: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() ​
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 ​
Error.isError