op_alloy_protocol

Function calculate_tx_l1_cost_fjord

Source
pub fn calculate_tx_l1_cost_fjord(
    input: &[u8],
    base_fee: Uint<256, 4>,
    base_fee_scalar: Uint<256, 4>,
    blob_base_fee: Uint<256, 4>,
    blob_base_fee_scalar: Uint<256, 4>,
) -> Uint<256, 4>
Expand description

Calculate the gas cost of a transaction based on L1 block data posted on L2, post-Fjord.

L1 cost function: estimatedSize*(baseFeeScalar*l1BaseFee*16 + blobFeeScalar*l1BlobBaseFee)/1e12