diff --git a/rpc/jsonrpc/eth_simulation.go b/rpc/jsonrpc/eth_simulation.go index 27feb7122c7..4a258134756 100644 --- a/rpc/jsonrpc/eth_simulation.go +++ b/rpc/jsonrpc/eth_simulation.go @@ -173,11 +173,13 @@ func (api *APIImpl) SimulateV1(ctx context.Context, req SimulationRequest, block // Iterate over each given SimulatedBlock parent := sim.base + blockHashOverrides := ethapi.BlockHashOverrides{} for index, bsc := range simulatedBlocks { - blockResult, current, err := sim.simulateBlock(ctx, tx, sharedDomains, &bsc, headers[index], parent, headers[:index], blockNumber == latestBlockNumber) + blockResult, current, err := sim.simulateBlock(ctx, tx, sharedDomains, &bsc, headers[index], parent, headers[:index], blockNumber == latestBlockNumber, blockHashOverrides) if err != nil { return nil, err } + blockHashOverrides[current.NumberU64()] = current.Hash() simulatedBlockResults = append(simulatedBlockResults, blockResult) headers[index] = current.Header() parent = current.Header() @@ -507,6 +509,7 @@ func (s *simulator) simulateBlock( parent *types.Header, ancestors []*types.Header, latest bool, + blockHashOverrides ethapi.BlockHashOverrides, ) (SimulatedBlockResult, *types.Block, error) { header.ParentHash = parent.Hash() if s.chainConfig.IsLondon(header.Number.Uint64()) { @@ -529,7 +532,6 @@ func (s *simulator) simulateBlock( blockNumber := header.Number.Uint64() - blockHashOverrides := ethapi.BlockHashOverrides{} txnList := make([]types.Transaction, 0, len(bsc.Calls)) receiptList := make(types.Receipts, 0, len(bsc.Calls)) tracer := rpchelper.NewLogTracer(s.traceTransfers, blockNumber, common.Hash{}, common.Hash{}, 0) @@ -788,7 +790,7 @@ func (s *simulator) simulateCall( if err != nil { return nil, nil, nil, err } - msg.SetCheckGas(s.validation) + msg.SetCheckGas(false) // EIP-7825 gas cap does not apply to simulated calls (matches Geth SkipTransactionChecks) msg.SetCheckNonce(s.validation) txCtx := protocol.NewEVMTxContext(msg) txn, err := call.ToTransaction(s.gasPool.Gas(), &blockCtx.BaseFee)