Skip to content

feat(spec-specs, tests): refund EIP-8037 account creation for existing create targets#19

Open
spencer-tb wants to merge 8 commits into
eips/amsterdam/eip-8037-source-based-refundsfrom
eips/amsterdam/eip-8037-account-charge-at-access
Open

feat(spec-specs, tests): refund EIP-8037 account creation for existing create targets#19
spencer-tb wants to merge 8 commits into
eips/amsterdam/eip-8037-source-based-refundsfrom
eips/amsterdam/eip-8037-account-charge-at-access

Conversation

@spencer-tb

Copy link
Copy Markdown
Owner

🗒️ Description

Charge the CREATE/CREATE2 account-creation state gas (NEW_ACCOUNT) unconditionally before the create frame, and refund it on frame exit when the destination already existed (an existing leaf, so no new account is created) — in addition to the existing refunds on failure (revert, halt, collision, pre-frame failure).

Deciding whether the target pre-exists requires reading the computed address, which EIP-7928 (Block-Level Access Lists) defers until the EVM actually accesses it. Charging unconditionally and refunding after the frame avoids that early read while keeping the out-of-gas condition in the parent frame (unchanged behavior). CALL* stays conditional. The same unconditional-charge-with-refill applies to top-level contract-creation transactions.

Stacked on the source-based-refunds branch.

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@spencer-tb spencer-tb force-pushed the eips/amsterdam/eip-8037-account-charge-at-access branch 4 times, most recently from 7ee353f to 640cec5 Compare June 17, 2026 15:26
@spencer-tb spencer-tb changed the base branch from eips/amsterdam/eip-8037-source-based-refunds to forks/amsterdam June 17, 2026 15:31
@spencer-tb spencer-tb changed the base branch from forks/amsterdam to eips/amsterdam/eip-8037-source-based-refunds June 17, 2026 15:34
@spencer-tb spencer-tb force-pushed the eips/amsterdam/eip-8037-account-charge-at-access branch from 640cec5 to 1c62eda Compare June 17, 2026 15:37
spencer-tb and others added 5 commits June 17, 2026 16:39
…thereum#2995)

Co-authored-by: raxhvl <10168946+raxhvl@users.noreply.github.com>
…ereum#2998)

Add `test_max_code_size_jumpdest_in_immediate`, which places a `0x5B`
as the last byte of a `MAX_CODE_SIZE` contract, right after an
immediate-carrying opcode, and jumps to it:

- `PUSH1`: The `0x5B` is push data, always skipped, so the jump is
  rejected.
- `DUPN`/`SWAPN`/`EXCHANGE`: Per EIP-8024 the `0x5B` is an invalid
  immediate, kept at an instruction boundary, so it stays a valid
  `JUMPDEST` and the jump is accepted.

Exercises the immediate-skipping branches of jumpdest analysis well
past the old 24 KiB code and 48 KiB initcode limits.
@spencer-tb spencer-tb force-pushed the eips/amsterdam/eip-8037-account-charge-at-access branch 2 times, most recently from 150926b to cd87062 Compare June 18, 2026 12:57
@spencer-tb spencer-tb force-pushed the eips/amsterdam/eip-8037-account-charge-at-access branch from cd87062 to aa06dcb Compare June 18, 2026 14:42
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.

3 participants