Trait reth_evm_optimism::l1::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§