Skip to content

feat: hardfork test framework#621

Open
ByteYue wants to merge 3 commits intomainfrom
hardfork-test-framework
Open

feat: hardfork test framework#621
ByteYue wants to merge 3 commits intomainfrom
hardfork-test-framework

Conversation

@ByteYue
Copy link
Copy Markdown
Contributor

@ByteYue ByteYue commented Mar 21, 2026

Description

Issue Number: closes #xxx

How Has This Been Tested?

Key Areas to Review

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Consensus
  • EVM Runtime
  • Gravity SDK Core
  • CLI Tools
  • E2E Tests
  • Documentation
  • Other (specify)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

ByteYue added 3 commits March 17, 2026 13:59
Introduce a reusable framework for hardfork lifecycle E2E testing:

- system_contracts.py: Per-hardfork contract address registry
- hardfork_framework.py: Generic 6-phase test runner with HardforkTestConfig:
  Phase 1: Pre-hardfork cluster liveness validation
  Phase 2: Pre-hardfork contract snapshot + light tx pressure
  Phase 3: Hardfork transition (wait for block, verify chain alive)
  Phase 4: Post-hardfork bytecode verification
  Phase 5: Epoch change stability verification
  Phase 6: Node restart & replay verification
- test_gamma.py: Gamma test using the framework (config + one-liner)
- hardfork_utils.py: Refactored to import from system_contracts.py

Adding a new hardfork E2E test only requires:
1. Register contracts in system_contracts.py
2. Create test_<name>.py with HardforkTestConfig
3. Call run_hardfork_lifecycle_test(cluster, config)
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.

2 participants