state: Process the top-level message in a dedicated function - #1736
Merged
Merged
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1736 +/- ##
=======================================
Coverage 97.98% 97.98%
=======================================
Files 183 183
Lines 16851 16856 +5
Branches 3856 3856
=======================================
+ Hits 16511 16516 +5
Misses 250 250
Partials 90 90
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The refactor preserves behavior, with no unresolved issues identified.
Review effort: Balanced
Findings: None
What changed in this PR
Refactors top-level transaction processing into process_top_level() without changing behavior.
Changes:
- Centralizes authorization, delegation, state-gas charging, and execution.
- Removes top-level state-gas handling from
Host::call(). - Exposes
Host::account_exists()for preparation checks.
| File | Description |
|---|---|
test/state/state.cpp |
Adds and integrates top-level message processing. |
test/state/host.hpp |
Makes account_exists() publicly accessible. |
test/state/host.cpp |
Removes top-level state-gas handling from Host::call(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chfast
force-pushed
the
state/top-level-new-account
branch
4 times, most recently
from
September 24, 2026 10:52
b7ce811 to
6d664f8
Compare
The NEW_ACCOUNT state-gas of the account a transaction creates is a pre-execution charge (EIP-8037). EIP-2780 adds more such charges: the ones of the EIP-7702 authorizations and the delegation target access. Running out of gas for any of them must revert the applied authorizations, which Host::call() cannot do. Move this charge and its refill from Host::call() to the new process_top_level(), which also applies the authorizations and resolves the recipient's delegation. Their refund is carried in the call result. No behavior change.
chfast
force-pushed
the
state/top-level-new-account
branch
from
September 24, 2026 11:17
42324ca to
d89c800
Compare
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.

Move the processing of the transaction's top-level message out of
transition()intoprocess_top_level(). It applies the EIP-7702 authorizations (their refund now travels in the call result's gas refund), resolves the recipient's delegation, charges the NEW_ACCOUNT state-gas of a recipient the call creates, and makes the call, refilling that state-gas if the call fails.The NEW_ACCOUNT charge is a pre-execution charge (EIP-8037), so it moves here from
Host::call(), which no longer handles the transaction's state-gas. This prepares EIP-2780 (#1733): its additional pre-execution charges must revert the applied authorizations when they run out of gas, whichHost::call()cannot do.No behavior change.
🤖 Generated with Claude Code