internal/ethapi: select precompiles using the simulated header (#33363)

The simulator computed active precompiles from the base header, which is
incorrect when simulations cross fork boundaries. This change selects
precompiles using the current simulated header so the precompile set
matches the block’s number/time. It brings simulate in line with doCall,
tracing, and mining, and keeps precompile state overrides applied on the
correct epoch set.
This commit is contained in:
Fibonacci747 2025-12-10 07:56:56 +01:00 committed by GitHub
parent c21fe5475f
commit 215ee6ac18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -233,7 +233,7 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
if block.BlockOverrides.BlobBaseFee != nil {
blockContext.BlobBaseFee = block.BlockOverrides.BlobBaseFee.ToInt()
}
precompiles := sim.activePrecompiles(sim.base)
precompiles := sim.activePrecompiles(header)
// State overrides are applied prior to execution of a block
if err := block.StateOverrides.Apply(sim.state, precompiles); err != nil {
return nil, nil, nil, err