Skip to content

Blk 9 evm migration tests improved#99

Open
sfffaaa wants to merge 20 commits intomainfrom
BLK-9_evm-migration-tests-improved
Open

Blk 9 evm migration tests improved#99
sfffaaa wants to merge 20 commits intomainfrom
BLK-9_evm-migration-tests-improved

Conversation

@sfffaaa
Copy link
Copy Markdown
Collaborator

@sfffaaa sfffaaa commented Oct 24, 2025

  1. Extract the EVM migration test into several different small tests. Now it'll need around 4+ hrs to run on the runtime upgrade tests
  2. Update snapshot tools

jaypan added 19 commits October 24, 2025 13:41
* Split monolithic evm_migration_test.py into 5 focused test files:
  - evm_migration_tokens_test.py (ERC20, ERC721, ERC1155)
  - evm_migration_calls_test.py (delegatecall, call operations)
  - evm_migration_storage_test.py (storage, upgrade, struct)
  - evm_migration_precompile_test.py (precompiles, chain info)
  - evm_migration_advanced_test.py (events, gas, EIPs)

* Add gas tolerance to migration testing framework:
* Improve test debugging and maintenance:
* Add comprehensive documentation in EVM_MIGRATION_TESTS_README.md
…ion and code deduplication

Performed comprehensive code refactoring to improve maintainability and readability:
…clear naming

- Add pytest-check plugin for comprehensive failure reporting
- Fix gas tolerance logging visibility in pytest output
- Rename test methods for clarity and accuracy
- Update documentation with comprehensive migration test guide
- Remove redundant try-catch blocks
- Rename misleading method names for clarity
- Fix skipif reason messages for consistency across all test files
- Enhance gas tolerance mechanism with warnings.warn() for pytest visibility
- Add pytest-check dependency for comprehensive failure reporting
- Update base.py with pytest-check integration using context managers
- Document pytest-check usage and benefits in README
- Add gas tolerance for mcopy_edge_cases and long_calldata_tests
- Add total_edge_case_gas and nested_gas_used to gas fields list
- Fix non-deterministic account generation in calltest.py
- Add chain_metadata_tests to gas-sensitive tests list
- Add volatile blockchain fields to filtered fields:
- Fix non-deterministic account generation in storage.py
- Use fixed seed phrases for consistent account generation
- basic_storage_tests() now only reads storage (no writes)
- assembly_storage_tests() now only reads storage (no writes)
- Created basic_storage_write_tests() for write operations
- Created assembly_storage_write_tests() for write operations
- complex_storage_tests() - removed complexStorageTest() write
- mapping_storage_tests() - removed writeMappingValue() writes
- packed_storage_tests() - removed writePackedValues() operations
- integrity_tests() - removed emitStorageSnapshot() transaction
- basic_storage_write_tests() - Storage slot write operations
- assembly_storage_write_tests() - Packed value write operations
- complex_storage_write_tests() - Complex storage operations
- mapping_storage_write_tests() - Mapping write operations
- packed_storage_write_tests() - Comprehensive packed storage testing
- integrity_write_tests() - Event emission functionality
- Split mcopy_edge_cases into 4 separate test methods for better isolation
- Remove problematic total_edge_case_gas summation that caused false failures
- Add comprehensive volatile field detection with pattern matching
- Fix transaction timeout issues in precompile operations
- Separate calldata write operations from migration comparison
- Enhanced gas tolerance for legitimate runtime upgrade variations
…ion validation

- Remove volatile timestamp and block number fields from chain_metadata_tests
- Keep stable execution_time in time_locked_tests
- Remove volatile current_block fields from block_dependent_tests
- Remove chain info tests from gas-sensitive lists since they no longer need gas tolerance
- Focus tests on meaningful runtime upgrade validation
- Split long_calldata_tests into focused methods:
- Separate state modification with calldata_limits_write_tests
- Remove artificial gas summation patterns
- Improve test isolation and single responsibility principle
- Improve transaction receipt retrieval with retry logic in peaq_eth_utils
- Add proper error handling for event filtering in event.py and gas.py
- Fix race condition where events weren't immediately available for filtering
- Resolves Event0 not found error in migration tests
- Add nested_gas_used to gas_fields in base.py
- Fixes "Non-gas values differ" error for nested_calldata_decoding_test
- Ensures nested_gas_used is properly recognized as a gas field
- Allows gas-sensitive tests to correctly filter this field
- Add mcopy_basic_tests, mcopy_zero_length_test, mcopy_overlap_test, mcopy_odd_size_test
- Complete coverage of EIP-5656 MCOPY functionality tests
- Ensures gas differences in MCOPY operations don't cause migration test failures
- Focuses migration validation on functional correctness rather than gas variations
- Break long lines in calldata_heavy.py migration methods
- Split long create_filter calls in gas.py event handling
- Maintain functionality while improving code readability
- Remove execution_time from time_locked_tests as it was volatile
- Remove reference to non-existent EVM_MIGRATION_TESTS_README.md from README
- Add missing newlines at end of migration test files
- Remove duplicate method definitions in base.py
- Fix indentation issues in gas tolerance methods
- Comment out unused web3_block variable in chain_info.py
- Remove unnecessary f-string formatting in gas.py and snapshot_info.py

All flake8 issues resolved while maintaining functionality.
@sfffaaa sfffaaa requested a review from talhadaar October 24, 2025 11:46
- Remove extra blank lines in base.py (E303)
- Remove trailing blank line at end of base.py (W391)
- Refactor complex display_comparison_summary function (C901)
  * Split into 4 smaller focused functions
  * Improved readability and maintainability
  * Reduced cyclomatic complexity

All flake8 issues now resolved.
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.

1 participant