Description
We found that the FastLZ algorithm is a pretty good estimate for the actual results we'd see from zlib compressing the batches we write to L1 (albeit with a different scalar as the compression ratios aren't quite as good). See https://github.com/roberto-bayardo/compression-analysis and this sheet.
l1fee = ((0s in calldata) * 4 + (1s in calldata) * 16 + 188) * l1BaseFee * 0.684
works pretty well on average, but penalizes very compressible txs (e.g.), and undercharges incompressible txs (e.g.). This change makes the L1CostFunc much fairer compared to real-world L1 costs.
Description We found that the FastLZ algorithm is a pretty good estimate for the actual results we'd see from zlib compressing the batches we write to L1 (albeit with a different
scalar
as the compression ratios aren't quite as good). See https://github.com/roberto-bayardo/compression-analysis and this sheet.This PR introduces a
flzCompress
call into theDataGas
part of theL1CostFunc
. Companionoptimism
PR is here: https://github.com/ethereum-optimism/optimism/pull/9618Tests
TODO
Additional context
The current naive L1Cost approach:
works pretty well on average, but penalizes very compressible txs (e.g.), and undercharges incompressible txs (e.g.). This change makes the
L1CostFunc
much fairer compared to real-world L1 costs.