From aaded574dcf7b2f6b5851ee858603cb61335217e Mon Sep 17 00:00:00 2001 From: Joshua Colvin Date: Sat, 11 Jan 2025 20:02:59 -0700 Subject: [PATCH] Don't modify gas cap if already zero (infinite) --- internal/ethapi/transaction_args.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 197584a74..612d70962 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -490,9 +490,11 @@ func (args *TransactionArgs) ToMessage(baseFee *big.Int, globalGasCap uint64, he } // Arbitrum: raise the gas cap to ignore L1 costs so that it's compute-only if state != nil && !skipL1Charging { - // ToMessage recurses once to allow ArbOS to intercept the result for all callers - // ArbOS uses this to modify globalGasCap so that the cap will ignore this tx's specific L1 data costs - postingGas, err := core.RPCPostingGasHook(msg, header, state) + var postingGas uint64 + var err error + if globalGasCap != 0 { + postingGas, err = core.RPCPostingGasHook(msg, header, state) + } if err == nil { args.setGasUsingCap(globalGasCap + postingGas) msg.GasLimit = uint64(*args.Gas)