avoid capping warnings for gas set by internal system transactions

This commit is contained in:
Karlo 2022-06-03 11:07:36 +02:00
parent 783f93b1d7
commit 57e829fae9

View file

@ -183,12 +183,15 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (t
// Set sender address or use zero address if none specified. // Set sender address or use zero address if none specified.
addr := args.from() addr := args.from()
// Gas set for system calls
systemCallGas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2))
// Set default gas & gas price if none were set // Set default gas & gas price if none were set
gas := globalGasCap gas := globalGasCap
if gas == 0 { if gas == 0 {
gas = uint64(math.MaxUint64 / 2) gas = uint64(math.MaxUint64 / 2)
} }
if args.Gas != nil { if args.Gas != nil && *args.Gas != systemCallGas {
gas = uint64(*args.Gas) gas = uint64(*args.Gas)
} }
if globalGasCap != 0 && globalGasCap < gas { if globalGasCap != 0 && globalGasCap < gas {