-
Notifications
You must be signed in to change notification settings - Fork 1
skip refundIsthmusOperatorCost for estimate_gas #42
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
Conversation
core/state_transition.go
Outdated
| } | ||
|
|
||
| if rules.IsOptimismIsthmus { | ||
| if rules.IsOptimismIsthmus && shouldCheckGasFormula { |
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.
It seems that the original logic is changed if we add shouldCheckGasFormula here
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.
shouldCheckGasFormula is always true within consensus; it's only false for api calls like estimate_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.
Strictly speak, this is an upstream issue, there's a related but un-merged pr here: ethereum-optimism#599 .
qzhodl
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.
LGTM
|
would like to also hear @qizhou 's opinion before merging. |
| return nil, fmt.Errorf("optimism l1 cost overflows U256: %d", l1Cost) | ||
| } | ||
| if shouldCheckGasFormula { | ||
| if shouldCheckGasFormula { |
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 guess you can put all shouldCheckGasFormula checks in one condition check rather than multiple ones.
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.
Good point, done!
Skip
refundIsthmusOperatorCost()during gas estimation (whenshouldCheckGasFormulais false) since operator cost wasn't pre-charged.Fixes QuarkChain/optimism#130
UPDATE
l1 cost has the same issue, so also fixed.