reth::payload

Function validate_payload_timestamp

pub fn validate_payload_timestamp(
    chain_spec: impl EthereumHardforks,
    version: EngineApiMessageVersion,
    timestamp: u64,
) -> Result<(), EngineObjectValidationError>
Expand description

Validates the timestamp depending on the version called:

  • If V2, this ensures that the payload timestamp is pre-Cancun.
  • If V3, this ensures that the payload timestamp is within the Cancun timestamp.
  • If V4, this ensures that the payload timestamp is within the Prague timestamp.

Otherwise, this will return EngineObjectValidationError::UnsupportedFork.