Skip to content

Commit a68ecb4

Browse files
committed
feat(internal/ethapi): add MaxUsedGas field to eth_simulateV1 response ethereum#32789
1 parent 198370f commit a68ecb4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/ethapi/simulate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type simCallResult struct {
6868
ReturnValue hexutil.Bytes `json:"returnData"`
6969
Logs []*types.Log `json:"logs"`
7070
GasUsed hexutil.Uint64 `json:"gasUsed"`
71+
MaxUsedGas hexutil.Uint64 `json:"maxUsedGas"`
7172
Status hexutil.Uint64 `json:"status"`
7273
Error *callError `json:"error,omitempty"`
7374
}
@@ -225,7 +226,7 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
225226
gasUsed += result.UsedGas
226227
receipts[i] = core.MakeReceipt(evm, result, sim.state, blockContext.BlockNumber, common.Hash{}, tx, gasUsed, root)
227228
logs := tracer.Logs()
228-
callRes := simCallResult{ReturnValue: result.Return(), Logs: logs, GasUsed: hexutil.Uint64(result.UsedGas)}
229+
callRes := simCallResult{ReturnValue: result.Return(), Logs: logs, GasUsed: hexutil.Uint64(result.UsedGas), MaxUsedGas: hexutil.Uint64(result.MaxUsedGas)}
229230
if result.Failed() {
230231
callRes.Status = hexutil.Uint64(types.ReceiptStatusFailed)
231232
if errors.Is(result.Err, vm.ErrExecutionReverted) {

0 commit comments

Comments
 (0)