-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
auto: fix chain module #14140
auto: fix chain module #14140
Conversation
I see you updated files related to |
I see you updated files related to
|
@@ -11,7 +11,7 @@ interface IChainModule { | |||
// retrieve the L1 data fee for a L2 transaction. it should return 0 for L1 chains and | |||
// L2 chains which don't have L1 fee component. it uses msg.data to estimate L1 data so | |||
// it must be used with a transaction. Return value in wei. | |||
function getCurrentL1Fee() external view returns (uint256); | |||
function getCurrentL1Fee(uint256 dataSize) external view returns (uint256); |
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.
option 2 is use a bytes
here. but that makes L1 fee calculation extremely costly and that's what we try to avoid
@@ -16,7 +16,7 @@ contract OptimismModule is ChainModuleBase { | |||
uint256 private constant FIXED_GAS_OVERHEAD = 60_000; | |||
uint256 private constant PER_CALLDATA_BYTE_GAS_OVERHEAD = 270; | |||
|
|||
function getCurrentL1Fee() external view override returns (uint256) { | |||
function getCurrentL1Fee(uint256) external view override returns (uint256) { |
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.
using uint256
will make it not accurate
using bytes
will make it waste lots of gas
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.
- passing bytes into this function
- concat this bytes with a padding
- passing the concated bytes to getL1Fee
with chain module (uint256) and V2: nothing
with chain module (bytes) and V2: 1 (BASE, OP), 1/2/3 (Scroll)
Quality Gate passedIssues Measures |
Requires Dependencies
Resolves Dependencies