Skip to content

Gravity Testnet v1.3.0

Choose a tag to compare

Contracts Release: gravity-testnet-v1.3.0

Full Changelog:

Breaking Changes

Unified Hardfork Framework

This release introduces a unified hardfork dispatch framework based on the new HardforkUpgrades trait, replacing the ad-hoc per-hardfork glue established in v1.1.1 / v1.2.0. All four Gravity-native hardforks (Alpha, Beta, Gamma, Delta) are now expressed as HardforkUpgrades implementations and dispatched through a single apply_hardfork_upgrades() entry point in parallel_execute.rs (#307, #309, #312, #318).

Key changes:

  • GravityHardfork enum (Alpha/Beta/Gamma/Delta) added to chainspec, exposed via new EthChainSpec trait methods ({alpha,beta,gamma,delta}_transitions_at_block() and is_{alpha,beta,gamma,delta}_active_at_block_number()).
  • Genesis JSON now parses alphaBlock, betaBlock, gammaBlock, deltaBlock from extra_fields into ChainSpec.gravity_hardforks.
  • HardforkUpgrades trait standardizes the interface for system_upgrades(), extra_upgrades(), storage_patches(), and the new batch_storage_patches() (a (&[Address], B256, U256) form needed for Gamma's ReentrancyGuard initialization across all StakePool instances).
  • Dispatch ordering: Alpha/Beta are applied before balance increments; Gamma/Delta are applied after.
  • Test framework: a new generic hardfork_test_helpers module (verify_bytecodes_at_block(), verify_bytecodes_old_before_block(), verify_storage_patches()) is added so each hardfork can be validated with the same harness — see HARDFORK_TESTING.md.

Delta Hardfork

This release ships the Delta hardfork together with the corresponding gravity_chain_core_contracts v1.3.0 release. Delta upgrades 4 system contracts (StakingConfig, ValidatorManagement, Governance, NativeOracle) and applies the storage migration required by the removal of minimumProposalStake from StakingConfig (packed _initialized bit at slot 1, clearing of stale slots 2/3/6/7). Activation is configured via genesis config.deltaBlock.

What's Changed

Features

  • feat: add hardfork testing framework (trait + generic helpers) by @ByteYue in #307
  • feat(chainspec): add GravityHardfork enum + EthChainSpec hardfork methods by @ByteYue in #309
  • feat(hardfork): add batch_storage_patches to HardforkUpgrades trait by @ByteYue in #318

Bug Fixes

  • fix(view): replace block_hash with block_id in block_hash_ref by @AshinGau in #302
  • fix: Use BTreeMap for Deterministic Event Ordering Causes Consensus Split by @ByteYue in #304
    • Replaces a non-deterministic HashMap event-iteration order that could produce divergent block outputs across nodes and trigger a consensus split.
  • fix: Fix coacker audit by @nekomoto911 in #311
  • fix(relayer): persist state to disk before updating in-memory by @ByteYue in #314
    • OracleRelayerManager::update_and_save_state previously advanced the in-memory nonce before the disk write, so a crash mid-save() would restart from stale on-disk state and re-deliver already-processed events. The state is now cloned, persisted first, and only committed to live in-memory state after the disk write succeeds.
  • fix(unwind): commit view and set prune distance for execution unwind by @AshinGau in #313
    • Enforces MINIMUM_PRUNING_DISTANCE in get_next_block_range() so the pruner retains enough historical blocks for unwind.
    • Inserts commit_view() calls between write/read steps during unwind because RocksDB's WriteBatch (unlike MDBX) does not provide immediate read-after-write visibility, so explicit flushes are required before state root recalculation and state removal.
    • Also moves nested_hash to reth-trie-db for reuse and skips init_genesis on already-initialized databases.

Security Audit Fixes

  • fix: Fix coacker audit by @nekomoto911 in #311
  • fix: Use BTreeMap for Deterministic Event Ordering Causes Consensus Split by @ByteYue in #304
  • fix(relayer): persist state to disk before updating in-memory by @ByteYue in #314

Refactoring & Chores

  • refactor(hardfork): unified hardfork framework with stub implementations by @ByteYue in #312
  • chore(deps): update gaptos & grevm by @nekomoto911 in #289
  • chore(deps): Update gaptos deps to address empty jwk provider when constructing jwk txns by @ByteYue in #294