From e5f4b274b39df4e8a44b9bc14294cef8ebb91bd2 Mon Sep 17 00:00:00 2001 From: Sina M <1591639+s1na@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:40:38 +0100 Subject: [PATCH] internal/ethapi: fix logs bloom in eth_simulateV1 (#31411) Geth was returning empty logsBloom for the simulated block. --- internal/ethapi/simulate.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index ac76372424..097de8b0b0 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -217,9 +217,13 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header, if err := sim.sanitizeCall(&call, sim.state, header, blockContext, &gasUsed); err != nil { return nil, nil, err } - tx := call.ToTransaction(types.DynamicFeeTxType) + var ( + tx = call.ToTransaction(types.DynamicFeeTxType) + txHash = tx.Hash() + ) txes[i] = tx - tracer.reset(tx.Hash(), uint(i)) + tracer.reset(txHash, uint(i)) + sim.state.SetTxContext(txHash, i) // EoA check is always skipped, even in validation mode. msg := call.ToMessage(header.BaseFee, !sim.validate, true) result, err := applyMessageWithEVM(ctx, evm, msg, timeout, sim.gp)