Skip to content

Commit 5166d08

Browse files
s1nahowjmay
authored andcommitted
internal/ethapi: fix logs bloom in eth_simulateV1 (ethereum#31411)
Geth was returning empty logsBloom for the simulated block.
1 parent abe0cd6 commit 5166d08

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/ethapi/simulate.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,13 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
217217
if err := sim.sanitizeCall(&call, sim.state, header, blockContext, &gasUsed); err != nil {
218218
return nil, nil, err
219219
}
220-
tx := call.ToTransaction(types.DynamicFeeTxType)
220+
var (
221+
tx = call.ToTransaction(types.DynamicFeeTxType)
222+
txHash = tx.Hash()
223+
)
221224
txes[i] = tx
222-
tracer.reset(tx.Hash(), uint(i))
225+
tracer.reset(txHash, uint(i))
226+
sim.state.SetTxContext(txHash, i)
223227
// EoA check is always skipped, even in validation mode.
224228
msg := call.ToMessage(header.BaseFee, !sim.validate, true)
225229
result, err := applyMessageWithEVM(ctx, evm, msg, timeout, sim.gp)

0 commit comments

Comments
 (0)