feat(tests): update python tests after running the script#4
Open
spencer-tb wants to merge 30 commits intoleolara:leolara/port-static-tests-with-postfrom
Open
Conversation
- Use EOA(key=...) for sender instead of raw Address + secret_key - Use pre.deploy_contract() for contract accounts (fallback to Account() for oversized code > 24576 bytes) - Omit default transaction values (value=0, data=b"", nonce=0, access_list=[]) - Fix name collisions: + maps to _plus_, - maps to _minus_ - Conditionally import Hash only when needed - Add @pytest.mark.slow for slow categories (stQuadraticComplexityTest, stStaticCall, stTimeConsuming) - Remove code from post assertions — code doesn't change and just bloats the generated tests - Fix func_doc IndexError when filler comment is "This " with no body - Fix addr_vars lookup using padded vs unpadded address keys
- Merge pre-state across all fixture cases (fixes MissingAccountError) - Derive valid_from from filler network field instead of fixture dir - Deduplicate fixtures across fork directories (keep earliest fork) - Parametrize `to` field for contract creation (to=None) support - Escape docstrings containing backslashes or triple quotes - Prevent ruff stack overflow with RUST_MIN_STACK=16777216 - Pad access list addresses to 40 hex chars - Support both static/ and non-static/ fixture output layouts - Add Amsterdam to FORK_ORDER - Fix compare_fixtures.py: strip test_ prefix, skip ported_static/
find_fixture_files() was picking up blockchain_tests fixtures which share the same test names as state_tests, causing identity collisions during dedup that resulted in 0 state_tests being generated.
Port remaining categories plus other fixes
When a test has different expected post-states across forks (e.g. precompile gas changes in Prague), generate separate test functions per fork range with correct valid_from/valid_until markers. - Refactor find_fixture_files into grouped variant that returns all fork paths per identity - Add detect_fork_ranges() to compare post-state hashes across forks - Generate _from_<fork> suffixed functions for divergent ranges - Skip ranges beyond filler's valid_until to avoid empty fork ranges Verified: 2180/2180 fixtures match in roundtrip comparison.
chore: some more fixes for the script
1452e08 to
4de5c0d
Compare
Regenerated all 2,180 ported test files using the updated fixture_to_python.py script. Key improvements: - Fork-divergent post-states: 88 tests with separate _from_<fork> functions when expected results differ across forks - All 59 categories including slow tests (stQuadraticComplexityTest, stStaticCall, stTimeConsuming) - Verified: 149,490 test cases passed, 0 failed - Hasher compare: state_tests hashes match compiled_static exactly
- Add RUST_MIN_STACK to tox static env for ruff stack overflow - Fix ruff lint errors in fixture_to_python.py (docstrings, unused vars, dict comprehension) - Add mypy: ignore-errors to 4 files with deeply nested Op chains - Remove leftover debug script
4de5c0d to
a65b9c5
Compare
|
I'll go ahead and merge these commits on top of Leo's branch, and then will try to merge the parent PR to |
8be9328 to
dd2632c
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.
Summary
Regenerates all ported static tests with fork-divergent post-state support and lint fixes.
Compiled static tests ran with:
These can alternatively be found here: u
Porting the to python tests:
Verification with hasher:
Note: only compare
state_testsusedblockchain_testsembed source paths in their directory layout causing structural hash differences, not content differences.Verification with
compare_fixtures.py:Gives us:
For example,
precompsEIP2929Cancunincompiled_staticis one fixture that exists infor_cancun/,for_prague/, andfor_osaka/directories. In the ported fixtures, that becomes three separate test functions: