[SharovBot] fix eth_simulateV1 BLOCKHASH returning real chain hash for simulated blocks#20820
Closed
erigon-copilot[bot] wants to merge 1 commit intomainfrom
Closed
[SharovBot] fix eth_simulateV1 BLOCKHASH returning real chain hash for simulated blocks#20820erigon-copilot[bot] wants to merge 1 commit intomainfrom
erigon-copilot[bot] wants to merge 1 commit intomainfrom
Conversation
…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>
Contributor
|
The Fix is already present in #20818 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[SharovBot] Fix eth_simulateV1 BLOCKHASH returning real chain hash for simulated blocks
Summary
eth_simulateV1simulates multiple blocks in sequence,BLOCKHASHfor previously-simulated block numbers now returns the simulated block hash instead of the real chain hashblockHashOverridesmap accumulates simulated block hashes across the simulation run and is passed intoMakeBlockHashProviderwhich checks overrides first before falling back to the real chainTest plan
go build ./...passeseth_simulateV1/test_125.jsonRPC integration test should pass (requires mainnet node)🤖 Generated with Claude Code