ethapi: deref gasUsed pointer in eth_simulate log (#33192)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled

Show the actual gas used in the block limit error so RPC clients see
useful numbers.
This commit is contained in:
David Klank 2025-11-15 16:04:21 +02:00 committed by GitHub
parent 2a2f106a01
commit 5e6f7374de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -377,7 +377,7 @@ func (sim *simulator) sanitizeCall(call *TransactionArgs, state vm.StateDB, head
call.Gas = (*hexutil.Uint64)(&remaining)
}
if *gasUsed+uint64(*call.Gas) > blockContext.GasLimit {
return &blockGasLimitReachedError{fmt.Sprintf("block gas limit reached: %d >= %d", gasUsed, blockContext.GasLimit)}
return &blockGasLimitReachedError{fmt.Sprintf("block gas limit reached: %d >= %d", *gasUsed, blockContext.GasLimit)}
}
if err := call.CallDefaults(sim.gp.Gas(), header.BaseFee, sim.chainConfig.ChainID); err != nil {
return err