revm_context_interface::block

Trait Block

Source
pub trait Block {
    // Required methods
    fn number(&self) -> &U256;
    fn beneficiary(&self) -> &Address;
    fn timestamp(&self) -> &U256;
    fn gas_limit(&self) -> &U256;
    fn basefee(&self) -> &U256;
    fn difficulty(&self) -> &U256;
    fn prevrandao(&self) -> Option<&B256>;
    fn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>;

    // Provided methods
    fn blob_gasprice(&self) -> Option<u128> { ... }
    fn blob_excess_gas(&self) -> Option<u64> { ... }
}
Expand description

Trait for retrieving block information required for execution.\

Required Methods§

Source

fn number(&self) -> &U256

The number of ancestor blocks of this block (block height).

Source

fn beneficiary(&self) -> &Address

Beneficiary (Coinbase, miner) is a address that have signed the block.

This is the receiver address of priority gas rewards.

Source

fn timestamp(&self) -> &U256

The timestamp of the block in seconds since the UNIX epoch.

Source

fn gas_limit(&self) -> &U256

The gas limit of the block.

Source

fn basefee(&self) -> &U256

The base fee per gas, added in the London upgrade with EIP-1559.

Source

fn difficulty(&self) -> &U256

The difficulty of the block.

Unused after the Paris (AKA the merge) upgrade, and replaced by prevrandao.

Source

fn prevrandao(&self) -> Option<&B256>

The output of the randomness beacon provided by the beacon chain.

Replaces difficulty after the Paris (AKA the merge) upgrade with EIP-4399.

NOTE: prevrandao can be found in a block in place of mix_hash.

Source

fn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>

Excess blob gas and blob gasprice. See also calc_excess_blob_gas and calc_blob_gasprice.

Incorporated as part of the Cancun upgrade via EIP-4844.

Provided Methods§

Source

fn blob_gasprice(&self) -> Option<u128>

See EIP-4844 and calc_blob_gasprice.

Returns None if Cancun is not enabled.

Source

fn blob_excess_gas(&self) -> Option<u64>

Return blob_excess_gas header field. See EIP-4844.

Returns None if Cancun is not enabled.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + Block + ?Sized> Block for &'a T

Source§

fn number(&self) -> &U256

Source§

fn beneficiary(&self) -> &Address

Source§

fn timestamp(&self) -> &U256

Source§

fn gas_limit(&self) -> &U256

Source§

fn basefee(&self) -> &U256

Source§

fn difficulty(&self) -> &U256

Source§

fn prevrandao(&self) -> Option<&B256>

Source§

fn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>

Source§

fn blob_gasprice(&self) -> Option<u128>

Source§

fn blob_excess_gas(&self) -> Option<u64>

Source§

impl<'a, T: 'a + Block + ?Sized> Block for &'a mut T

Source§

fn number(&self) -> &U256

Source§

fn beneficiary(&self) -> &Address

Source§

fn timestamp(&self) -> &U256

Source§

fn gas_limit(&self) -> &U256

Source§

fn basefee(&self) -> &U256

Source§

fn difficulty(&self) -> &U256

Source§

fn prevrandao(&self) -> Option<&B256>

Source§

fn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>

Source§

fn blob_gasprice(&self) -> Option<u128>

Source§

fn blob_excess_gas(&self) -> Option<u64>

Source§

impl<T: Block + ?Sized> Block for Box<T>

Source§

fn number(&self) -> &U256

Source§

fn beneficiary(&self) -> &Address

Source§

fn timestamp(&self) -> &U256

Source§

fn gas_limit(&self) -> &U256

Source§

fn basefee(&self) -> &U256

Source§

fn difficulty(&self) -> &U256

Source§

fn prevrandao(&self) -> Option<&B256>

Source§

fn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>

Source§

fn blob_gasprice(&self) -> Option<u128>

Source§

fn blob_excess_gas(&self) -> Option<u64>

Source§

impl<T: Block + ?Sized> Block for Arc<T>

Source§

fn number(&self) -> &U256

Source§

fn beneficiary(&self) -> &Address

Source§

fn timestamp(&self) -> &U256

Source§

fn gas_limit(&self) -> &U256

Source§

fn basefee(&self) -> &U256

Source§

fn difficulty(&self) -> &U256

Source§

fn prevrandao(&self) -> Option<&B256>

Source§

fn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>

Source§

fn blob_gasprice(&self) -> Option<u128>

Source§

fn blob_excess_gas(&self) -> Option<u64>

Implementors§