reth_optimism_node::engine

Function validate_withdrawals_presence

Source
pub fn validate_withdrawals_presence(
    chain_spec: &ChainSpec,
    version: EngineApiMessageVersion,
    message_validation_kind: MessageValidationKind,
    timestamp: u64,
    has_withdrawals: bool,
) -> Result<(), EngineObjectValidationError>
Available on crate feature optimism only.
Expand description

Validates the presence of the withdrawals field according to the payload timestamp.

After Canyon, withdrawals field must be Some. Before Canyon, withdrawals field must be None;

Canyon activates the Shanghai EIPs, see the Canyon specs for more details: https://github.com/ethereum-optimism/optimism/blob/ab926c5fd1e55b5c864341c44842d6d1ca679d99/specs/superchain-upgrades.md#canyon