Skip to main content

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. Append a Vivace variant to tempo_hardfork! — automatically:
    • defines the enum variant via [hardfork!]
    • implements trait TempoHardforks by adding is_vivace(), is_vivace_active_at_timestamp(), and updating tempo_hardfork_at()
    • adds tests for each of the TempoHardfork methods
  2. Update From<TempoHardfork> for SpecId if the hardfork requires a different Ethereum SpecId

§In spec.rs:

  1. Add vivace_time: Option<u64> field to TempoGenesisInfo
  2. Add TempoHardfork::Vivace => self.vivace_time arm to TempoGenesisInfo::fork_time()

§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

Macros§

tempo_hardfork 🔒
Single-source hardfork definition macro. Append a new variant and everything else is generated:

Enums§

TempoHardfork
Tempo-specific hardforks for network upgrades.

Traits§

TempoHardforks
Trait for querying Tempo-specific hardfork activations.