Closed mdehoog closed 4 months ago
Something annoying about the L1CostFunc impl is a lot of the cost logic ends up duplicated in receipts.go, so you kind of have to re-implement stuff there.
I tried to improve the abstractions a bit in this PR in preparation for 4844: https://github.com/ethereum-optimism/op-geth/pull/203
I think it will make this change a bit cleaner if/when merged.
Closing in favor of #249, which uses a shared base branch.
This one looks obsoleted by https://github.com/ethereum-optimism/op-geth/pull/249... can we close it? cc: @danyalprout
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: ethereum-optimism/optimism#8635.Tests
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.