Skip to content

feat: add Gamma hardfork E2E test with bridge verification#608

Draft
ByteYue wants to merge 2 commits intomainfrom
hardfork_e2e_test
Draft

feat: add Gamma hardfork E2E test with bridge verification#608
ByteYue wants to merge 2 commits intomainfrom
hardfork_e2e_test

Conversation

@ByteYue
Copy link
Contributor

@ByteYue ByteYue commented Mar 17, 2026

Add a comprehensive E2E test suite for the Gamma hardfork at
gravity_e2e/cluster_test_cases/hardfork_test/.

Hardfork Test (test_hardfork.py)

Boots a single-node devnet using v1.0.0 genesis contracts, then validates
the full Gamma hardfork lifecycle across 6 phases:

  1. Pre-hardfork chain liveness
  2. System contract bytecode snapshot + transaction pressure
  3. Hardfork transition at configurable gammaBlock (default 500)
  4. Post-hardfork bytecode verification — confirms all 10 system contracts
    are upgraded (StakingConfig, ValidatorConfig, GovernanceConfig, Staking,
    ValidatorManagement, Reconfiguration, Blocker, PerformanceTracker,
    Governance, NativeOracle)
  5. Epoch boundary crossing — bytecodes remain stable
  6. Node stop → restart → replay through hardfork block

Bridge Test (test_hardfork_bridge.py)

Verifies cross-chain bridge functionality across the hardfork boundary:

  • Phase A: 10 pre-loaded bridge events (MockAnvil) → NativeMinted verified
  • Phase B: Hardfork contract upgrade confirmation
  • Phase C: 10 additional bridge events → verified post-hardfork with
    continuous nonces (1→20) and correct cumulative balance

Infrastructure

  • hooks.py: Combined pre-start hook — starts MockAnvil on port 8546,
    injects gammaBlock into genesis.json, writes relayer_config.json
  • genesis.toml: Uses gravity-testnet-v1.0.0 contracts with
    oracle+bridge config targeting local MockAnvil (chainId 31337)
  • hardfork_utils.py: Reusable utilities for block waiting, contract
    snapshot/comparison, and transaction pressure

@ByteYue ByteYue marked this pull request as draft March 17, 2026 07:15
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