Function get_beacon_root_from_state

Source
pub fn get_beacon_root_from_state(
    state: &EthereumState,
    timestamp: U256,
) -> B256
Expand description

Retrieves a beacon root from Ethereum state using EIP-4788 storage.

This function looks up a beacon root stored in the EIP-4788 beacon roots contract at the BEACON_ROOTS_ADDRESS. The beacon root is indexed by timestamp and retrieved from the circular buffer using modular arithmetic.

§Arguments

  • state - The Ethereum state to query
  • timestamp - The timestamp to look up the beacon root for

§Returns

The beacon root hash stored at the given timestamp