Skip to content

feat(spec-spec, tests): Implement eip-8246 and testing scenario#2842

Open
LouisTsai-Csie wants to merge 3 commits into
ethereum:eips/amsterdam/eip-8246from
LouisTsai-Csie:implement-eip-8246
Open

feat(spec-spec, tests): Implement eip-8246 and testing scenario#2842
LouisTsai-Csie wants to merge 3 commits into
ethereum:eips/amsterdam/eip-8246from
LouisTsai-Csie:implement-eip-8246

Conversation

@LouisTsai-Csie
Copy link
Copy Markdown
Collaborator

@LouisTsai-Csie LouisTsai-Csie commented May 12, 2026

🗒️ Description

Implement EIP-8246: https://forkcast.org/eips/8246

🔗 Related Issues or PRs

issue #2821

✅ 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-->

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.79%. Comparing base (87c52b4) to head (68d5c14).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           eips/amsterdam/eip-8246    #2842      +/-   ##
===========================================================
- Coverage                    90.01%   89.79%   -0.23%     
===========================================================
  Files                          539      487      -52     
  Lines                        32618    28885    -3733     
  Branches                      3030     2621     -409     
===========================================================
- Hits                         29361    25937    -3424     
+ Misses                        2699     2433     -266     
+ Partials                       558      515      -43     
Flag Coverage Δ
unittests 89.79% <ø> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marioevz marioevz requested a review from gurukamath May 13, 2026 21:52
Copy link
Copy Markdown
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Looks good overall. I think we need to take care of failing tests in ./tests/cancun/eip6780_selfdestruct before eventually merging into forks/amsterdam (if this gets included in a devnet).

Comment thread tests/amsterdam/eip8246_selfdestruct_no_burn/test_selfdestruct_no_burn.py Outdated
Comment thread tests/amsterdam/eip8246_selfdestruct_no_burn/test_selfdestruct_no_burn.py Outdated

"""
account.nonce = Uint(0)
account.code_hash = EMPTY_CODE_HASH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be worth to double check whether this is sufficient to clear the code. cc @gurukamath as he probably knows the answer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. This is equivalent to resetting the code.

@LouisTsai-Csie LouisTsai-Csie marked this pull request as ready for review May 14, 2026 16:08
set_account(tx_state, address, None)


def preserve_account_balance(account: Account) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about creating a convert_to_balance_only_account (or something similar) which has all the semantics of destroy_account minus the balance bit and simply calling that in fork.py?


"""
account.nonce = Uint(0)
account.code_hash = EMPTY_CODE_HASH
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. This is equivalent to resetting the code.

@@ -434,7 +434,7 @@ def destroy_account(tx_state: TransactionState, address: Address) -> None:
This function is made available exclusively for the ``SELFDESTRUCT``
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docstring to be updated

for address in tx_output.accounts_to_delete:
destroy_account(tx_state, address)
destroy_storage(tx_state, address)
modify_state(tx_state, address, preserve_account_balance)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If modify_state ends up calling destroy_account (zero-balance case), destroy_storage runs twice. Not a huge issue but something to be kept in mind

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