Skip to content

fix(context): keep is_empty on EIP-7702 account in load_account_delegated - #3802

Merged
rakita merged 1 commit into
bluealloy:mainfrom
cuiweixie:fix/host-load-account-delegated-is-empty
Jul 22, 2026
Merged

rakita merged 1 commit into
bluealloy:mainfrom
cuiweixie:fix/host-load-account-delegated-is-empty

Conversation

@cuiweixie

Copy link
Copy Markdown
Contributor

Summary

  • Stop overwriting AccountLoad::is_empty with the EIP-7702 delegate account's emptiness in Host::load_account_delegated.
  • Align the Host default with JournalInner::load_account_delegated, so empty-account / creation-cost checks use the caller account.
  • Add a regression test: non-empty EIP-7702 account delegating to an empty account must keep is_empty == false.

Test plan

  • cargo test -p revm-context-interface --lib load_account_delegated_keeps_caller_is_empty_not_delegate -- --nocapture
  • Confirm the test fails if account_load.data.is_empty = delegate_account.is_empty is restored

…ated

Do not overwrite AccountLoad::is_empty with the delegate account's flag.
Empty-account / creation-cost checks must reflect the caller account,
matching JournalInner::load_account_delegated.
@codspeed

codspeed Bot commented Jul 15, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 3.59%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 180 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Simulation blake2/2_rounds 3.4 µs 3.2 µs +3.59%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cuiweixie:fix/host-load-account-delegated-is-empty (c790572) with main (a094a93)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

@rakita

rakita commented Jul 22, 2026

Copy link
Copy Markdown
Member

This PR is more correct in CALL type of opcodes you use target is_empty to decide if account is going to be created or not. This function is not used in revm so this is not a consensus issue,

@rakita
rakita merged commit 41e8b33 into bluealloy:main Jul 22, 2026
32 of 34 checks passed
This was referenced Jul 22, 2026
RealiCZ added a commit to megaeth-labs/revm that referenced this pull request Sep 18, 2026
…lloy#3746 bluealloy#3802 bluealloy#3864 (#54)

Co-authored-by: Prajjwal Chittori <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Anders Brownworth <[email protected]>
Co-authored-by: Ivan Wang <[email protected]>
Co-authored-by: cui <[email protected]>
@RealiCZ RealiCZ mentioned this pull request Sep 18, 2026
43 tasks done
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.

2 participants