Skip to content

[SharovBot] rpc: fix eth_simulateV1 blockHashOverrides propagation and EIP-7825 gas check (release/3.4)#21091

Open
erigon-copilot[bot] wants to merge 1 commit intorelease/3.4from
sharovbot/fix-eth-simulate-v1-r34
Open

[SharovBot] rpc: fix eth_simulateV1 blockHashOverrides propagation and EIP-7825 gas check (release/3.4)#21091
erigon-copilot[bot] wants to merge 1 commit intorelease/3.4from
sharovbot/fix-eth-simulate-v1-r34

Conversation

@erigon-copilot
Copy link
Copy Markdown
Contributor

[SharovBot]

Summary

Cherry-pick of main commit c128fdd3 (PR #20818) to release/3.4.

Fixes 4 consistently failing mainnet-rpc-integ-tests on release/3.4 (tests 19, 24, 26, 27).

Root Causes & Fixes

Fix 1: blockHashOverrides not propagated across simulated blocks

Before: Each call to simulateBlock() created a fresh blockHashOverrides := ethapi.BlockHashOverrides{}, so in a multi-block simulation, earlier simulated blocks' hashes were unavailable to later blocks' BLOCKHASH opcode.

After: blockHashOverrides is created once in SimulateV1() and accumulated across iterations, with each completed block's hash inserted before the next block runs.

Fix 2: EIP-7825 gas cap applied to simulated calls

Before: msg.SetCheckGas(s.validation) — when validation=true (test_24), the EIP-7825 gas cap was enforced on simulated calls, causing gas-related failures that shouldn't apply to simulations.

After: msg.SetCheckGas(false) — matches Geth's SkipTransactionChecks behavior. EIP-7825 gas cap is never applied to simulated calls regardless of validation mode.

Bonus: Disable flaky test_201

Adds eth_simulateV1/test_201.json to the disabled list (flaky, non-deterministic failure).

Failing Tests Fixed

Test Block Flags Issue
test_19 22842260 (Prague) returnFullTransactions=true, traceTransfers=true blockHashOverrides not propagated
test_24 20784966 validation=true, traceTransfers=true EIP-7825 gas cap in validation mode
test_26 23412976 (Prague) validation=false, traceTransfers=false blockHashOverrides not propagated
test_27 latest validation=false, traceTransfers=true blockHashOverrides not propagated

Evidence

…d disable EIP-7825 gas check

Cherry-pick of main commit c128fdd to release/3.4.

Two fixes:
1. blockHashOverrides is now accumulated across simulated blocks (not reset per-block).
   This allows BLOCKHASH opcodes in later simulated blocks to correctly resolve hashes
   of earlier simulated blocks in the same multi-block simulation.

2. msg.SetCheckGas(false) replaces msg.SetCheckGas(s.validation).
   EIP-7825 gas cap does not apply to simulated calls (matches Geth SkipTransactionChecks).
   This fixes eth_simulateV1 test_24 (validation=true) failing with gas-related errors.

Also disables eth_simulateV1/test_201.json which is flaky.

Fixes 4 failing mainnet-rpc-integ-tests (test_19, test_24, test_26, test_27) on release/3.4.

Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com>
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.

0 participants