Skip to content

Commit 5e6f737

Browse files
authored
ethapi: deref gasUsed pointer in eth_simulate log (#33192)
Show the actual gas used in the block limit error so RPC clients see useful numbers.
1 parent 2a2f106 commit 5e6f737

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/ethapi/simulate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func (sim *simulator) sanitizeCall(call *TransactionArgs, state vm.StateDB, head
377377
call.Gas = (*hexutil.Uint64)(&remaining)
378378
}
379379
if *gasUsed+uint64(*call.Gas) > blockContext.GasLimit {
380-
return &blockGasLimitReachedError{fmt.Sprintf("block gas limit reached: %d >= %d", gasUsed, blockContext.GasLimit)}
380+
return &blockGasLimitReachedError{fmt.Sprintf("block gas limit reached: %d >= %d", *gasUsed, blockContext.GasLimit)}
381381
}
382382
if err := call.CallDefaults(sim.gp.Gas(), header.BaseFee, sim.chainConfig.ChainID); err != nil {
383383
return err

0 commit comments

Comments
 (0)