Skip to content

feat(chainspec): add GravityHardfork enum + EthChainSpec hardfork methods#309

Open
ByteYue wants to merge 1 commit intomainfrom
feat/hardfork-infra
Open

feat(chainspec): add GravityHardfork enum + EthChainSpec hardfork methods#309
ByteYue wants to merge 1 commit intomainfrom
feat/hardfork-infra

Conversation

@ByteYue
Copy link
Contributor

@ByteYue ByteYue commented Mar 25, 2026

Add shared hardfork infrastructure to main:

  • GravityHardfork enum (Alpha, Beta, Gamma, Delta) in gravity.rs
  • EthChainSpec trait methods: {alpha,beta,gamma,delta}_transitions_at_block() and is_{alpha,beta,gamma,delta}_active_at_block_number() with default false
  • ChainSpec.gravity_hardforks field with genesis JSON parsing (alphaBlock, betaBlock, gammaBlock, deltaBlock from extra_fields)
  • ChainSpec impl overrides using gravity_hardforks.is_fork_active_at_block()

Release branches add concrete hardfork modules (alpha.rs, beta.rs, etc.) that implement the actual bytecode upgrades.

@ByteYue ByteYue force-pushed the feat/hardfork-infra branch from 96b3204 to b699032 Compare March 25, 2026 13:13
Minimal shared hardfork infrastructure for main:
- GravityHardfork enum (Alpha, Beta, Gamma, Delta) via hardfork! macro
- ChainSpec.gravity_hardforks: ChainHardforks field for activation blocks
- Genesis JSON parsing from extra_fields (alphaBlock, betaBlock, etc.)

Callers use the generic Hardforks trait:
  chain_spec.gravity_hardforks.is_fork_active_at_block(GravityHardfork::Alpha, n)

No EthChainSpec trait changes — follows reth's pattern of using generic
fork queries rather than per-hardfork trait methods.
@ByteYue ByteYue force-pushed the feat/hardfork-infra branch from b699032 to 7bd39e6 Compare March 25, 2026 13:27
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.

1 participant