Fjord: Add FastLZ compression into L1CostFunc#249
Merged
sebastianst merged 13 commits intoethereum-optimism:optimismfrom May 15, 2024
Merged
Fjord: Add FastLZ compression into L1CostFunc#249sebastianst merged 13 commits intoethereum-optimism:optimismfrom
sebastianst merged 13 commits intoethereum-optimism:optimismfrom
Conversation
sebastianst
requested changes
Apr 10, 2024
f600b2d to
6f9c662
Compare
2cf18c7 to
e2139eb
Compare
sebastianst
reviewed
May 7, 2024
5fdf668 to
3704c9f
Compare
protolambda
reviewed
May 15, 2024
Contributor
protolambda
left a comment
There was a problem hiding this comment.
Generally looks good. FlzCompressLen is difficult to review in isolation, but the tests in the monorepo for it look good. Still looking into the differences with Brotli.
c8002af to
ae09e9f
Compare
protolambda
approved these changes
May 15, 2024
Co-authored-by: Michael de Hoog <michael.dehoog@coinbase.com> Co-authored-by: Yukai Tu <yukai.tu@coinbase.com> Co-authored-by: Danyal Prout <danyal.prout@coinbase.com>
…e same hardfork block
Co-authored-by: Sebastian Stammler <stammler.s@gmail.com>
ae09e9f to
f8b1629
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
scalaras the compression ratios aren't quite as good). See https://github.com/roberto-bayardo/compression-analysis and this sheet.This PR introduces a
flzCompresscall into theDataGaspart of theL1CostFunc. CompanionoptimismPR is here: ethereum-optimism/optimism#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
L1CostFuncmuch fairer compared to real-world L1 costs.