GasPriceOracle
Following the Fjord upgrade, three additional values used for L1 fee computation are:- costIntercept
- costFastlzCoef
- minTransactionSize
GasPriceOracle contract. The
calculation follows the same formula outlined in the
Fjord L1-Cost fee changes (FastLZ estimator)
section.
A new method is introduced: getL1FeeUpperBound(uint256). This method returns an upper bound for the L1 fee
for a given transaction size. It is provided for callers who wish to estimate L1 transaction costs in the
write path, and is much more gas efficient than getL1Fee.
The upper limit overhead is assumed to be original/255+16, borrowed from LZ4. According to historical data, this
approach can encompass more than 99.99% of transactions.
This is implemented as follows:
L1 Gas Usage Estimation
ThegetL1GasUsed method is updated to take into account the improved compression estimation
accuracy as part of the Fjord upgrade.
getL1GasUsed method is deprecated as of Fjord because it does not capture that there are
two kinds of gas being consumed due to the introduction of blobs. This function will revert when
called in a future upgrade.
Users can continue to use the getL1Fee method to estimate the L1 fee for a given transaction, or the
new getL1FeeUpperBound method introduced by Fjord as a lower gas alternative.