feat(tests): port Cancun static tests and delete originals#2481
Draft
chfast wants to merge 3 commits intoethereum:forks/amsterdamfrom
Draft
feat(tests): port Cancun static tests and delete originals#2481chfast wants to merge 3 commits intoethereum:forks/amsterdamfrom
chfast wants to merge 3 commits intoethereum:forks/amsterdamfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2481 +/- ##
===================================================
+ Coverage 85.97% 86.02% +0.04%
===================================================
Files 599 599
Lines 36916 36916
Branches 3771 3771
===================================================
+ Hits 31738 31756 +18
+ Misses 4560 4551 -9
+ Partials 618 609 -9
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:
|
chfast
added a commit
to chfast/execution-specs
that referenced
this pull request
Mar 12, 2026
Add pr= link for ethereum#2481 to all Cancun ported_from markers. Add pr= link for ethereum#2478 to chainid ported_from marker.
spencer-tb
reviewed
Mar 12, 2026
Contributor
spencer-tb
left a comment
There was a problem hiding this comment.
Thanks for adding this! Some potential gaps below after chatting with claude, they look reasonable to me:
transStorageResetFiller.yml to test_tstore_clear_after_deployment_tx:
- I think this mapping is wrong. The YAML and the python test different things I believe. The YAML is testing that revert propagation works correctly when the call chain crosses contract boundaries with different call opcodes. I think we should remove this and port this YAML fully by adding a test function
test_revert_in_callback_chaintotests/cancun/eip1153_tstore/test_tstorage_reentrancy_contexts.pywith the ported marker.
14_revertAfterNestedStaticcallFiller.yml to test_subcall:
- The existing
STATICCALL_CANT_CALL_TSTOREcase tests direct TSTORE in a static callee, but the YAML tests that the static flag propagates through a nested CALL, i.e STATICCALL to CALL to TSTORE fails. I think we should remove the ported from marker here and instead add a new case toReentrancyTestCasesintest_tstorage_reentrancy_contexts.py, something likeSTATICCALL_PROPAGATES_STATIC_FLAG_THROUGH_CALL, adding the ported marker totest_reentrant_call.
transStorageOKFiller.yml to test_subcall:
test_subcallcovers the basic call-type semantics (CALLCODE/DELEGATECALL, isolation via CALL, STATICCALL restrictions), which maps to theinheritTrans()andstaticCall()scenarios in the YAML. But the YAML also has 12 scenarios testing recursive call chains (sumTo,callcodeSumTo,delegateSumTo), intervening contracts (callbackSum), binary tree recursion (binTree,delegateBinTree), and deep mixed call stacks (deepCall). These multi level scenarios aren't covered. I think we should add new tests for the recursive/deep patterns intest_tstorage_reentrancy_contexts.py.
MCOPY_copy_costFiller.yml to test_mcopy_memory_expansion:
- The YAML focuses on copy cost scaling with 31 word-boundary vectors (size 31/32/33, etc.), while the python test focuses on memory expansion cost. The marker is a reasonable partial match. I think specific word boundary copy cost vectors aren't replicated. Lower risk, but we could consider adding a few word boundary parametrized cases (length=31, 32, 33) to
test_mcopy_memory_expansion.
6 tasks
Port MCOPY_memory_hashFiller.yml as a new test_mcopy_repeated test that verifies memory hash consistency after performing the same MCOPY twice: idempotent for non-overlapping copies, different for overlapping forward/backward moves. Add @pytest.mark.ported_from markers to existing tests that already cover the remaining 12 static files across EIP-1153 (transient storage), EIP-4844 (blob transactions), and EIP-5656 (MCOPY). Delete the entire tests/static/state_tests/Cancun/ directory.
Add pr= link for ethereum#2481 to all Cancun ported_from markers. Add pr= link for ethereum#2478 to chainid ported_from marker.
- Remove wrong transStorageResetFiller mapping from test_tstore_clear_after_deployment_tx (tests different behavior) - Remove 14_revertAfterNestedStaticcallFiller from test_subcall - Add STATICCALL_PROPAGATES_STATIC_FLAG_THROUGH_CALL case to ReentrancyTestCases (static flag propagates through nested CALL) - Add test_revert_in_callback_chain for cross-contract revert propagation with CALL/CALLCODE/DELEGATECALL and REVERT/INVALID/STOP - Add test_tstore_recursive_call for transient storage persistence across recursive call depth with different call opcodes - Add word-boundary MCOPY copy cost vectors (length=31,32,33) with aligned and unaligned source offsets
0b06683 to
afda208
Compare
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
Add
ported_frommarkers to existing Python tests that cover the former Cancun static test files, and add new tests to cover gaps identified during review.Ported-from markers added to existing test functions for:
stEIP1153_transientStorage:transStorageOKFiller.yml,10_revertUndoesStoreAfterReturnFiller.yml,14_revertAfterNestedStaticcallFiller.yml,transStorageResetFiller.ymlstEIP4844_blobtransactions:emptyBlobhashListFiller.yml,wrongBlobhashVersionFiller.yml,createBlobhashTxFiller.yml,opcodeBlobhashOutOfRangeFiller.yml,opcodeBlobhBoundsFiller.ymlstEIP5656_MCOPY:MCOPYFiller.yml,MCOPY_copy_costFiller.yml,MCOPY_memory_expansion_costFiller.ymlstChainId:chainIdFiller.jsonNew tests to cover gaps in the ported static tests:
STATICCALL_PROPAGATES_STATIC_FLAG_THROUGH_CALL— STATICCALL's static flag propagates through a nested CALL, preventing TSTORE (ports14_revertAfterNestedStaticcallFiller.yml)test_revert_in_callback_chain— revert propagation across contract boundaries with CALL/CALLCODE/DELEGATECALL and REVERT/INVALID/STOP terminations (portstransStorageResetFiller.yml)test_tstore_recursive_call— transient storage persistence across recursive call depth with different call opcodes (ports recursive/deep patterns fromtransStorageOKFiller.yml)test_mcopy_memory_expansion🔗 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
🐬