revm_wiring::block

Trait Block

Source
pub trait Block {
    // Required methods
    fn number(&self) -> &U256;
    fn coinbase(&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 coinbase(&self) -> &Address

Coinbase or miner or address that created and signed the block.

This is the receiver address of all the gas spent in the block.

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.

Implementors§