-
Notifications
You must be signed in to change notification settings - Fork 21k
eth/gasestimator: check ErrGasLimitTooHigh conditions #32268
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
base: fusaka-devnet-3
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,9 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin | |
if call.GasLimit >= params.TxGas { | ||
hi = call.GasLimit | ||
} | ||
if hi >= params.MaxTxGas { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might break L2 projects whose transactions potentially consume more gas in order to amortize L1 costs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might have misunderstood the code, but even if the L2s specified gas higher than There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, you are right! I will ask L2 forks how they plan to integrate the EIP-7825 first, but generally your changes look good to me. |
||
hi = params.MaxTxGas | ||
} | ||
// Normalize the max fee per gas the call is willing to spend. | ||
var feeCap *big.Int | ||
if call.GasFeeCap != nil { | ||
|
@@ -209,6 +212,9 @@ func execute(ctx context.Context, call *core.Message, opts *Options, gasLimit ui | |
if errors.Is(err, core.ErrIntrinsicGas) { | ||
return true, nil, nil // Special case, raise gas limit | ||
} | ||
if errors.Is(err, core.ErrGasLimitTooHigh) { | ||
return true, nil, nil // Special case, lower gas limit | ||
} | ||
return true, nil, err // Bail out | ||
} | ||
return result.Failed(), result, nil | ||
|
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 use params.MaxTxGas instead
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.
Ah thank you, I think I got mixed up with an older branch! Will fix it:)