internal/ethapi: fix gascap 0 for eth_simulateV1 (#30496)
Similar to #30474.
This commit is contained in:
parent
2278647ef2
commit
f2e13c7e33
@ -1289,13 +1289,17 @@ func (api *BlockChainAPI) SimulateV1(ctx context.Context, opts simOpts, blockNrO
|
|||||||
if state == nil || err != nil {
|
if state == nil || err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
gasCap := api.b.RPCGasCap()
|
||||||
|
if gasCap == 0 {
|
||||||
|
gasCap = math.MaxUint64
|
||||||
|
}
|
||||||
sim := &simulator{
|
sim := &simulator{
|
||||||
b: api.b,
|
b: api.b,
|
||||||
state: state,
|
state: state,
|
||||||
base: base,
|
base: base,
|
||||||
chainConfig: api.b.ChainConfig(),
|
chainConfig: api.b.ChainConfig(),
|
||||||
// Each tx and all the series of txes shouldn't consume more gas than cap
|
// 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,
|
traceTransfers: opts.TraceTransfers,
|
||||||
validate: opts.Validation,
|
validate: opts.Validation,
|
||||||
fullTx: opts.ReturnFullTransactions,
|
fullTx: opts.ReturnFullTransactions,
|
||||||
|
Loading…
Reference in New Issue
Block a user