Skip to content

Conversation

@dhil
Copy link
Contributor

@dhil dhil commented Oct 22, 2025

No description provided.

Copilot AI review requested due to automatic review settings October 22, 2025 15:26
@dhil dhil marked this pull request as draft October 22, 2025 15:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the state override mechanism for eth_call to apply overrides directly to original account states during State object construction, rather than applying them after construction. This ensures that tracers (PreState and StateDiff) capture the correct pre-execution state including overrides.

Key Changes:

  • Moved state override application logic from eth_call.cpp into the State constructor
  • Added a new templated State constructor that accepts state overrides as a parameter
  • Modified state overrides to work directly with OriginalAccountState instead of using state mutation methods

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
category/rpc/eth_call.cpp Simplified to use new State constructor with state overrides parameter
category/execution/ethereum/state3/state.hpp Added templated constructor that applies state overrides to original account states
category/rpc/eth_call_test.cpp Added test validating PreState and StateDiff tracers with state overrides

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dhil dhil requested a review from Baltoli October 22, 2025 16:11
@dhil dhil force-pushed the dhil/prestate-overrides branch 5 times, most recently from 5b55631 to 76cc85b Compare October 28, 2025 18:03
@dhil dhil marked this pull request as ready for review October 28, 2025 18:03
@dhil dhil force-pushed the dhil/prestate-overrides branch 5 times, most recently from 47b374b to 8bd9c40 Compare October 30, 2025 15:29
@jhunsaker jhunsaker force-pushed the dhil/prestate-overrides branch from 8bd9c40 to becb63d Compare October 30, 2025 16:28
@dhil dhil force-pushed the dhil/prestate-overrides branch from becb63d to d3a36d1 Compare October 31, 2025 15:50
@dhil dhil changed the title [eth_call] Apply state overrides to original accounts [eth_call] Fix interaction between prestate tracers and state overrides Oct 31, 2025
@dhil dhil requested a review from jhunsaker October 31, 2025 17:23
@dhil dhil force-pushed the dhil/prestate-overrides branch 2 times, most recently from 318b8b7 to 8a2f039 Compare November 3, 2025 11:04
@Baltoli Baltoli force-pushed the dhil/prestate-overrides branch from 8a2f039 to a6c98a9 Compare November 5, 2025 14:29
@dhil dhil force-pushed the dhil/prestate-overrides branch 8 times, most recently from e6de0be to 461cd7b Compare November 10, 2025 16:51
@dhil dhil force-pushed the dhil/prestate-overrides branch from 461cd7b to 766ec35 Compare November 10, 2025 17:36
@dhil dhil requested a review from Copilot November 10, 2025 17:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zander-xyz
zander-xyz previously approved these changes Nov 10, 2025
dhil added 3 commits November 10, 2025 15:37
The problem is that state overrides are applied to `State::current`
accounts, whereas the prestate trace is computed from
`State::original`. Thus prestate tracers do not respect state
overrides. In this patch, we merge the state overrides into the block
state before execution, and create a new `State` instance with this
updated block state, meaning that the former `State::current` accounts
will be `State::original` in the new state instance. This new state
instance is then passed to execution.
@dhil dhil force-pushed the dhil/prestate-overrides branch from e90e137 to cc8a0c7 Compare November 10, 2025 20:37
@jhunsaker jhunsaker merged commit 7c0d8d7 into main Nov 10, 2025
8 checks passed
@jhunsaker jhunsaker deleted the dhil/prestate-overrides branch November 10, 2025 21:18
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.

5 participants