From 57e829fae9003903e25604a1d135a650be65400d Mon Sep 17 00:00:00 2001 From: Karlo Date: Fri, 3 Jun 2022 11:07:36 +0200 Subject: [PATCH] avoid capping warnings for gas set by internal system transactions --- internal/ethapi/transaction_args.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 9c5950af58..2c3520a885 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -183,12 +183,15 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (t // Set sender address or use zero address if none specified. addr := args.from() + // Gas set for system calls + systemCallGas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2)) + // Set default gas & gas price if none were set gas := globalGasCap if gas == 0 { gas = uint64(math.MaxUint64 / 2) } - if args.Gas != nil { + if args.Gas != nil && *args.Gas != systemCallGas { gas = uint64(*args.Gas) } if globalGasCap != 0 && globalGasCap < gas {