RethL1BlockInfo

Trait RethL1BlockInfo 

Source
pub trait RethL1BlockInfo {
    // Required methods
    fn l1_tx_data_fee(
        &mut self,
        chain_spec: impl OpHardforks,
        timestamp: u64,
        input: &[u8],
        is_deposit: bool,
    ) -> Result<U256, BlockExecutionError>;
    fn l1_data_gas(
        &self,
        chain_spec: impl OpHardforks,
        timestamp: u64,
        input: &[u8],
    ) -> Result<U256, BlockExecutionError>;
}
Expand description

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

Required Methods§

Source

fn l1_tx_data_fee( &mut self, chain_spec: impl OpHardforks, 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 chain spec 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: impl OpHardforks, timestamp: u64, input: &[u8], ) -> Result<U256, BlockExecutionError>

Computes the data gas cost for an L2 transaction.

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RethL1BlockInfo for L1BlockInfo

Source§

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

Source§

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

Implementors§