feat(tests): port EXTCODEHASH new account static test#2326
Merged
LouisTsai-Csie merged 2 commits intoethereum:forks/amsterdamfrom Feb 27, 2026
Merged
feat(tests): port EXTCODEHASH new account static test#2326LouisTsai-Csie merged 2 commits intoethereum:forks/amsterdamfrom
LouisTsai-Csie merged 2 commits intoethereum:forks/amsterdamfrom
Conversation
Port extCodeHashNewAccountFiller.json and createEmptyThenExtcodehashFiller.json: EXTCODEHASH/EXTCODESIZE of a contract created via CREATE2 within the same transaction reflects the newly deployed code. Parametrized over empty and non-empty deployed code.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2326 +/- ##
================================================
Coverage 85.85% 85.85%
================================================
Files 599 599
Lines 39428 39428
Branches 3776 3776
================================================
Hits 33851 33851
Misses 4946 4946
Partials 631 631
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
LouisTsai-Csie
requested changes
Feb 26, 2026
Collaborator
LouisTsai-Csie
left a comment
There was a problem hiding this comment.
Thanks! Leave some comment
Comment on lines
+608
to
+612
| def test_extcodehash_new_account( | ||
| state_test: StateTestFiller, | ||
| pre: Alloc, | ||
| deployed_code: bytes, | ||
| ) -> None: |
Collaborator
There was a problem hiding this comment.
Could we add CREATE as parametrization here:
Suggested change
| def test_extcodehash_new_account( | |
| state_test: StateTestFiller, | |
| pre: Alloc, | |
| deployed_code: bytes, | |
| ) -> None: | |
| @pytest.mark.parametrize("opcode", [Op.CREATE, Op.CREATE2]) | |
| def test_extcodehash_new_account( | |
| state_test: StateTestFiller, | |
| pre: Alloc, | |
| deployed_code: bytes, | |
| opcode: Op, | |
| ) -> None: |
More changes needed, comment below:
Comment on lines
+641
to
+645
| created_address = compute_create2_address( | ||
| address=code_address, | ||
| salt=0x10, | ||
| initcode=initcode, | ||
| ) |
Collaborator
There was a problem hiding this comment.
Suggested change
| created_address = compute_create2_address( | |
| address=code_address, | |
| salt=0x10, | |
| initcode=initcode, | |
| ) | |
| created_address = compute_create_address( | |
| address=code_address, | |
| nonce=1, | |
| salt=0, | |
| initcode=initcode, | |
| opcode=opcode, | |
| ) |
now it handles both cases - CREATE2 and CREATE
Member
Author
There was a problem hiding this comment.
Do we really need to know this address at python side?
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.
🗒️ Description
Port extCodeHashNewAccountFiller.json and createEmptyThenExtcodehashFiller.json: EXTCODEHASH/EXTCODESIZE of a contract created via CREATE/CREATE2 within the same transaction reflects the newly deployed code. Parametrized over empty and non-empty deployed code.
🔗 Related Issues or PRs
N/A.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx tox -e statictype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.Cute Animal Picture