From dede3378f3d0c983ff44fedc405d9a88d109db67 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 23 Sep 2024 15:20:43 +0200 Subject: [PATCH] internal/ethapi: fix gascap 0 for eth_simulateV1 --- internal/ethapi/api.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 8c38d7d03761..7981f35ae391 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1289,13 +1289,17 @@ func (api *BlockChainAPI) SimulateV1(ctx context.Context, opts simOpts, blockNrO if state == nil || err != nil { return nil, err } + gasCap := api.b.RPCGasCap() + if gasCap == 0 { + gasCap = math.MaxUint64 + } sim := &simulator{ b: api.b, state: state, base: base, chainConfig: api.b.ChainConfig(), // Each tx and all the series of txes shouldn't consume more gas than cap - gp: new(core.GasPool).AddGas(api.b.RPCGasCap()), + gp: new(core.GasPool).AddGas(gasCap), traceTransfers: opts.TraceTransfers, validate: opts.Validation, fullTx: opts.ReturnFullTransactions,