Module hardfork

Module hardfork 

Source
Expand description

Tempo-specific hardfork definitions and traits.

This module provides the infrastructure for managing hardfork transitions in Tempo.

§Adding a New Hardfork

When a new hardfork is needed (e.g., Vivace):

§In hardfork.rs:

  1. Add a new variant to TempoHardfork enum
  2. Add is_vivace() method to TempoHardfork impl
  3. Add is_vivace_active_at_timestamp() to TempoHardforks trait
  4. Update tempo_hardfork_at() to check for the new hardfork first (latest hardfork is checked first)
  5. Add TempoHardfork::Vivace => Self::OSAKA (or appropriate SpecId) in From<TempoHardfork> for SpecId
  6. Update From<SpecId> for TempoHardfork to check for the new hardfork first
  7. Add test test_is_vivace and update existing is_* tests to include the new variant

§In spec.rs:

  1. Add vivace_time: Option<u64> field to TempoGenesisInfo
  2. Extract vivace_time in TempoChainSpec::from_genesis
  3. Add (TempoHardfork::Vivace, vivace_time) to tempo_forks vec
  4. Update tests to include "vivaceTime": <timestamp> in genesis JSON

§In genesis files and generator:

  1. Add "vivaceTime": 0 to genesis/dev.json
  2. Add vivace_time: Option<u64> arg to xtask/src/genesis_args.rs
  3. Add insertion of "vivaceTime" to chain_config.extra_fields

§Current State

The Adagio variant is a placeholder representing the pre-hardfork baseline.

Enums§

TempoHardfork
Tempo-specific hardforks for network upgrades.

Traits§

TempoHardforks
Trait for querying Tempo-specific hardfork activations.