Skip to main content

eth_payload_attributes

Function eth_payload_attributes 

Source
pub fn eth_payload_attributes<C: EthereumHardforks>(
    chain_spec: &C,
    timestamp: u64,
) -> PayloadAttributes
Expand description

Creates Ethereum [PayloadAttributes] that are valid for the hardforks active in chain_spec at timestamp.

Withdrawals are set once Shanghai is active, the parent beacon block root once Cancun is active, and a slot number once Amsterdam is active. The payload builder requires a slot number for EIP-7843; tests use the timestamp as a deterministic dummy slot because the exact beacon slot is irrelevant for local e2e payloads.

This is the default attributes generator of E2ETestSetupBuilder, so the same test works against any hardfork schedule, including forks activating mid-test.