-
Notifications
You must be signed in to change notification settings - Fork 284
Estimate compression ratio at rollupFee for Feynman #1197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Estimate compression ratio at rollupFee for Feynman #1197
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
9d4f5bc to
4c1dc4d
Compare
|
Waiting for a decision on which |
d0e730b to
ce2498e
Compare
b83f7dc to
e3c5bd7
Compare
|
Following the discussion here, I reverted the use of a standard go zstd library in favour for the da-codec's version. |
jonastheis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert all the whitespace changes. Next to being a pain when reviewing it also increases the diff.
Good common practice is to check files and their content before committing to avoid such whitespace changes from eg linter and to make sure what you're committing is actually sensible.
rollup/fees/rollup_fee.go
Outdated
| // Default compression ratio is 1.0 (no compression) | ||
| compressionRatio := big.NewInt(rcfg.Precision.Int64()) | ||
|
|
||
| compressedBytes, err := zstd.CompressScrollBatchBytes(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might still be good to use the zstd version that comes with da-codec. maybe we need to introduce a new function there to get rid of the overhead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the da-codec version to codecv8's zstd compression: f31326d.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might still be good to use the zstd version that comes with da-codec
The call stack would be a bit counter-intuitive here. calculateEncodedL1DataFeeFeynman is called based on IsCurie and IsFeynman checks.
I can think of two refactoring ways:
-
Passing
blockNumberandblockTimeas parameters ofcalculateEncodedL1DataFeeFeynman, or determining it outside and passing the compression function as a parameter. This will require remembering to update thisutilfunction inda-codecrepo, which is the same as updating here in future upgrades. -
Or another solution would be to expose a new interface based on the
da-codecversion, dedicated to compression ratio estimation here (determining the fees).
Do either of these approaches align with your thoughts, or do you have a different method in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand your point about the counter-intuitive call stack.
But I agree we should:
- Pass
compressionRatioas parameter for easier testing, and - Expose an estimate tx compression ratio function in
da-codec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replied to the comment here: #1196 (comment).
434dbf6 to
185d45e
Compare
185d45e to
bfcbb4b
Compare
b6e7b53 to
0346191
Compare
* Change l1DataFee to rollupFee for Feynman * Update CommitScalarSlot to ExecScalarSlot * Rename l1DataFee to rollupFee * Scale compression ratio to match scalars precision * Use l1DataFee and commitScalar instead of rollupFee and execScalar * Use blocktime not blocknumber * Add unit test * Clarify test comment * feat(feynman): upgrade gas oracle predeploy * address comments * revert renaming CalculateL1DataFee to CalculateRollupFee * simplify EstimateL1DataFeeForMessage * address comments * add a comment based on pr reviews * update formula * tweaks * tweak comments * Estimate compression ratio at rollupFee for Feynman (#1197) * Estimate compression ratio * Update rollup/fees/rollup_fee.go Co-authored-by: Péter Garamvölgyi <[email protected]> * Check compressed size smaller and remove unnecessary checks/changes * goimports locally run * rollback format changes * update da-codec's zstd function * apply zstd * tweaks * tweak unit test * make sure compression ratio >= 1 * nit --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: colinlyguo <[email protected]> Co-authored-by: colin <[email protected]> * refactoring * remove incorrect merge artifact * error handling * update da-codec commit * update da-codec commit --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: colin <[email protected]> Co-authored-by: colinlyguo <[email protected]>
1. Purpose or design rationale of this PR
See #1196 for more.
2. PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
3. Deployment tag versioning
Has the version in
params/version.gobeen updated?4. Breaking change label
Does this PR have the
breaking-changelabel?