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§
Sourcefn coinbase(&self) -> &Address
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.
Sourcefn difficulty(&self) -> &U256
fn difficulty(&self) -> &U256
The difficulty of the block.
Unused after the Paris (AKA the merge) upgrade, and replaced by prevrandao
.
Sourcefn prevrandao(&self) -> Option<&B256>
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
.
Sourcefn blob_excess_gas_and_price(&self) -> Option<&BlobExcessGasAndPrice>
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§
Sourcefn blob_gasprice(&self) -> Option<u128>
fn blob_gasprice(&self) -> Option<u128>
See EIP-4844 and calc_blob_gasprice
.
Returns None
if Cancun
is not enabled.
Sourcefn blob_excess_gas(&self) -> Option<u64>
fn blob_excess_gas(&self) -> Option<u64>
Return blob_excess_gas
header field. See EIP-4844.
Returns None
if Cancun
is not enabled.