Skip to content

Commit

Permalink
fix gas price not right problem (#10451)
Browse files Browse the repository at this point in the history
old code has side affect, it will cause baseFee to be changed.
so if you set `maxFeePerGas` the gas price will always be `maxFeePerGas`
even if `baseFee`+`maxPriorityFeePerGas` is less than `maxFeePerGas`.
  • Loading branch information
marshalys authored and yperbasis committed May 23, 2024
1 parent 6d4a614 commit 1dc82c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion turbo/adapter/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (args *CallArgs) ToMessage(globalGasCap uint64, baseFee *uint256.Int) (type
gasFeeCap, gasTipCap = gasPrice, gasPrice
} else {
// User specified 1559 gas fields (or none), use those
gasFeeCap = baseFee
gasFeeCap = uint256.MustFromBig(baseFee.ToBig())
if args.MaxFeePerGas != nil {
overflow := gasFeeCap.SetFromBig(args.MaxFeePerGas.ToInt())
if overflow {
Expand Down

0 comments on commit 1dc82c7

Please sign in to comment.