Skip to content

[SharovBot] fix eth_simulateV1 BLOCKHASH returning real chain hash for simulated blocks#20820

Closed
erigon-copilot[bot] wants to merge 1 commit intomainfrom
agent-fix/eth-simulatev1-blockhash
Closed

[SharovBot] fix eth_simulateV1 BLOCKHASH returning real chain hash for simulated blocks#20820
erigon-copilot[bot] wants to merge 1 commit intomainfrom
agent-fix/eth-simulatev1-blockhash

Conversation

@erigon-copilot
Copy link
Copy Markdown
Contributor

[SharovBot] Fix eth_simulateV1 BLOCKHASH returning real chain hash for simulated blocks

Summary

  • When eth_simulateV1 simulates multiple blocks in sequence, BLOCKHASH for previously-simulated block numbers now returns the simulated block hash instead of the real chain hash
  • A shared blockHashOverrides map accumulates simulated block hashes across the simulation run and is passed into MakeBlockHashProvider which checks overrides first before falling back to the real chain

Test plan

  • go build ./... passes
  • No test files modified
  • eth_simulateV1/test_125.json RPC integration test should pass (requires mainnet node)

🤖 Generated with Claude Code

…r simulated blocks

When simulating multiple blocks in sequence, the BLOCKHASH opcode in
subsequent blocks was resolving against the real blockchain instead of
returning the hash of previously-simulated blocks. This fix accumulates
simulated block hashes in a BlockHashOverrides map that is shared across
all simulated blocks, so the EVM's GetHashFunc checks simulated hashes
first before falling back to the real chain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
@lupin012
Copy link
Copy Markdown
Contributor

The Fix is already present in #20818

@lupin012 lupin012 closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants