Skip to content

Commit

Permalink
internal/ethapi: fix gascap 0 for eth_simulateV1 (#30496)
Browse files Browse the repository at this point in the history
Similar to #30474.
  • Loading branch information
s1na authored Sep 24, 2024
1 parent 2278647 commit f2e13c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f2e13c7

Please sign in to comment.