Skip to main content

Crate tempo_hardfork

Crate tempo_hardfork 

Source
Expand description

Tempo-specific hardfork definitions, activation schedules, and protocol constants.

This crate is the lightweight source of truth for Tempo hardfork identifiers. It intentionally does not depend on tempo-chainspec or Reth, so SDK crates can use TempoHardfork without pulling in chain-spec/node integration.

§Adding a New Hardfork

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

§In tempo-hardfork

  1. Append a Vivace variant to tempo_hardfork! — automatically:
    • defines the enum variant via [hardfork!]
    • adds the variant to TempoHardfork::VARIANTS
    • generates the is_vivace() inherent helper
    • exports the variant through tempo_post_genesis_hardforks! for downstream generated APIs
    • adds tests for the generated hardfork helpers
  2. Update activation schedule methods/constants for the new fork.
  3. Update From<TempoHardfork> for SpecId if the hardfork requires a different Ethereum SpecId.

§In tempo-chainspec

  1. Add vivace_time: Option<u64> field to TempoGenesisInfo if the fork is configurable in genesis. fork_time() is generated through tempo_post_genesis_hardforks!, so missing fields for new hardfork variants fail at compile 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.

Modules§

constants
Tempo constants shared by both the published surface and the reth-backed spec implementation.

Macros§

tempo_hardfork 🔒
Single-source hardfork definition macro. Append a new variant and everything else is generated:
tempo_post_genesis_hardforks
Invokes the given macro with all post-Genesis Tempo hardfork variants.

Enums§

TempoHardfork
Tempo-specific hardforks for network upgrades.