Skip to content

feat: Add hardfork test framework#306

Draft
ByteYue wants to merge 6 commits intomainfrom
hardfork-test-framework
Draft

feat: Add hardfork test framework#306
ByteYue wants to merge 6 commits intomainfrom
hardfork-test-framework

Conversation

@ByteYue
Copy link
Contributor

@ByteYue ByteYue commented Mar 21, 2026

No description provided.

Lchangliang and others added 6 commits March 17, 2026 16:03
* feat(evm): implement Alpha hardfork contract upgrades and disable PoW rewards (#277)

* feat(evm): implement Beta hardfork contract upgrades
* feat: add Gamma hardfork infrastructure and integration test

Cherry-picked from gamma_fork_test (3599442) onto gravity-testnet-v1.2.
Resolved merge conflicts in api.rs, gravity.rs, spec.rs, mod.rs, parallel_execute.rs.
Updated test fixture to use top-level genesis config format (alphaBlock/betaBlock/gammaBlock).

* refactor: extract gamma hardfork bytecodes to external .bin files

Move 12 inline hex arrays (4231 lines) to bytecodes/gamma/*.bin files,
loaded via include_bytes!() at compile time. gamma.rs reduced to 98 lines.
Zero runtime overhead, identical compiled output.

* fix: resolve clippy doc_markdown and missing_docs warnings

- Add backticks around StakePool in doc comments (alpha.rs, beta.rs, parallel_execute.rs)
- Add doc comments to all ADDRESS constants in gamma.rs
…nstructing jwk txns (#294)

Co-authored-by: nekomoto911 <nekomoto911@gmail.com>
…l addresses (#303)

* fix(gamma): regenerate Staking and StakePool bytecodes and update pool addresses

Regenerated staking.bin and stakepool.bin from gravity_chain_core_contracts HEAD
which includes bd42d9a (nonReentrant on unstakeAndWithdraw). The previous .bin
files were compiled before this fix, causing an 8-byte size mismatch.

- staking.bin: 11054 → 11062 bytes (embeds StakePool init code via CREATE2)
- stakepool.bin: 6909 → 6917 bytes (nonReentrant modifier added)
- Updated STAKEPOOL_ADDRESSES with 4 actual pool addresses from live chain
Introduce a framework for standardizing hardfork bytecode upgrades:

- hardfork/common.rs: HardforkUpgrades trait with system_upgrades(),
  extra_upgrades(), and storage_patches() methods
- hardfork/gamma.rs: GammaHardfork struct implementing the trait,
  plus GAMMA_STAKEPOOL_UPGRADES convenience constant
- hardfork_test_helpers.rs: Generic verification functions:
  - verify_bytecodes_at_block(): verify new bytecodes are applied
  - verify_bytecodes_old_before_block(): verify upgrade hasn't happened early
  - verify_storage_patches(): verify storage slot initialization

Future hardforks only need to define a new module with bytecode
constants + implement HardforkUpgrades, then call the generic helpers.
@ByteYue ByteYue marked this pull request as draft March 21, 2026 13:33
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