Skip to content

Commit

Permalink
Don't modify gas cap if already zero (infinite)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacolvin0 committed Jan 12, 2025
1 parent dd32b78 commit aaded57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aaded57

Please sign in to comment.