Skip to content

Commit 2b17c85

Browse files
s1najakub-freebit
authored andcommitted
internal/ethapi: fix gascap 0 for eth_simulateV1 (ethereum#30496)
Similar to ethereum#30474.
1 parent 9cefcb6 commit 2b17c85

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/ethapi/api.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,13 +1289,17 @@ func (api *BlockChainAPI) SimulateV1(ctx context.Context, opts simOpts, blockNrO
12891289
if state == nil || err != nil {
12901290
return nil, err
12911291
}
1292+
gasCap := api.b.RPCGasCap()
1293+
if gasCap == 0 {
1294+
gasCap = math.MaxUint64
1295+
}
12921296
sim := &simulator{
12931297
b: api.b,
12941298
state: state,
12951299
base: base,
12961300
chainConfig: api.b.ChainConfig(),
12971301
// Each tx and all the series of txes shouldn't consume more gas than cap
1298-
gp: new(core.GasPool).AddGas(api.b.RPCGasCap()),
1302+
gp: new(core.GasPool).AddGas(gasCap),
12991303
traceTransfers: opts.TraceTransfers,
13001304
validate: opts.Validation,
13011305
fullTx: opts.ReturnFullTransactions,

0 commit comments

Comments
 (0)