Package forkid implements EIP-2124 (https://eips.ethereum.org/EIPS/eip-2124).
var ( // ErrRemoteStale is returned by the validator if a remote fork checksum is a // subset of our already applied forks, but the announced next fork block is // not on our already passed chain. ErrRemoteStale = errors.New("remote needs update") // ErrLocalIncompatibleOrStale is returned by the validator if a remote fork // checksum does not match any local checksum variation, signalling that the // two chains have diverged in the past at some point (possibly at genesis). ErrLocalIncompatibleOrStale = errors.New("local incompatible or needs update") )
Blockchain defines all necessary method to build a forkID.
Filter is a fork id filter to validate a remotely advertised ID.
NewFilter creates a filter that returns if a fork ID should be rejected or not based on the local chain's status.
NewStaticFilter creates a filter at block zero.
ID is a fork identifier as defined by EIP-2124.
NewID calculates the Ethereum fork ID from the chain config, genesis hash, and head.
NewIDWithChain calculates the Ethereum fork ID from an existing chain instance.