pub fn adjust_l1_gas_price_for_tx(
    l1_gas_price: u64,
    fair_l2_gas_price: u64,
    tx_gas_per_pubdata_limit: U256
) -> u64
Expand description

Adjusts the L1 gas price for a transaction based on the current pubdata price and the fair L2 gas price. If the current pubdata price is small enough, returns the original L1 gas price. Otherwise, calculates a new L1 gas price based on the fair L2 gas price and the transaction gas per pubdata limit.

Arguments

  • l1_gas_price - The original L1 gas price.
  • fair_l2_gas_price - The fair L2 gas price.
  • tx_gas_per_pubdata_limit - The transaction gas per pubdata limit.

Returns

The adjusted L1 gas price.