state: Charge the recipient creation before resolving the delegation - #1740
Conversation
Follow the execution-specs order, where the recipient's NEW_ACCOUNT state-gas is charged before the delegation target of tx.to is resolved. The order is not observable: only a nonexistent recipient is charged and a delegated recipient has code, so it exists. Assert the latter.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1740 +/- ##
=======================================
Coverage 97.98% 97.98%
=======================================
Files 183 183
Lines 16856 16857 +1
Branches 3856 3856
=======================================
+ Hits 16516 16517 +1
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:
|
Merging this PR will improve performance by 2.71%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | baseline/analyse/main/sha1_shifts |
11.5 µs | 11.2 µs | +2.71% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing state/recipient-charge-first (5029db7) with master (d9e925a)
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused ordering change matches the stated execution semantics without introducing observable regressions.
Review effort: Balanced
Findings: None
What changed in this PR
Reorders EIP-8037 recipient-creation charging to match execution-specs before delegation resolution.
Changes:
- Moves NEW_ACCOUNT state-gas charging before delegation lookup.
- Asserts that delegated recipients exist.
| File | Description |
|---|---|
test/state/state.cpp |
Reorders top-level state-gas charging and pins the delegation invariant. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Follow the execution-specs order, where the recipient's NEW_ACCOUNT state-gas is charged before the delegation target of tx.to is resolved. The order is not observable: only a nonexistent recipient is charged and a delegated recipient has code, so it exists. The new assert pins the latter.
Peeled from #1733.
🤖 Generated with Claude Code