Skip to content

Commit f40a18e

Browse files
Merge pull request #448 from OffchainLabs/large-maxgas
Avoid overflow when adding additional gas
2 parents 658e67a + 25fc5f0 commit f40a18e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/ethapi/api.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,9 @@ func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *s
721721
if err != nil {
722722
return nil, err
723723
}
724-
gp.AddGas(postingGas)
724+
if gp.Gas() < gomath.MaxUint64-postingGas {
725+
gp.AddGas(postingGas)
726+
}
725727
}
726728
if msg.GasLimit > gp.Gas() {
727729
gp.SetGas(msg.GasLimit)

0 commit comments

Comments
 (0)