reth_optimism_evm::l1

Trait RethL1BlockInfo

Source
pub trait RethL1BlockInfo {
    // Required methods
    fn l1_tx_data_fee(
        &self,
        chain_spec: &ChainSpec,
        timestamp: u64,
        input: &[u8],
        is_deposit: bool,
    ) -> Result<U256, BlockExecutionError>;
    fn l1_data_gas(
        &self,
        chain_spec: &ChainSpec,
        timestamp: u64,
        input: &[u8],
    ) -> Result<U256, BlockExecutionError>;
}
Available on crate feature optimism only.
Expand description

An extension trait for [L1BlockInfo] that allows us to calculate the L1 cost of a transaction based off of the ChainSpec’s activated hardfork.

Required Methods§

Source

fn l1_tx_data_fee( &self, chain_spec: &ChainSpec, timestamp: u64, input: &[u8], is_deposit: bool, ) -> Result<U256, BlockExecutionError>

Forwards an L1 transaction calculation to revm and returns the gas cost.

§Takes
  • chain_spec: The ChainSpec for the node.
  • timestamp: The timestamp of the current block.
  • input: The calldata of the transaction.
  • is_deposit: Whether or not the transaction is a deposit.
Source

fn l1_data_gas( &self, chain_spec: &ChainSpec, timestamp: u64, input: &[u8], ) -> Result<U256, BlockExecutionError>

Computes the data gas cost for an L2 transaction.

§Takes
  • chain_spec: The ChainSpec for the node.
  • timestamp: The timestamp of the current block.
  • input: The calldata of the transaction.

Implementations on Foreign Types§

Source§

impl RethL1BlockInfo for L1BlockInfo

Source§

fn l1_tx_data_fee( &self, chain_spec: &ChainSpec, timestamp: u64, input: &[u8], is_deposit: bool, ) -> Result<U256, BlockExecutionError>

Source§

fn l1_data_gas( &self, chain_spec: &ChainSpec, timestamp: u64, input: &[u8], ) -> Result<U256, BlockExecutionError>

Implementors§