feat(chainspec): add GravityHardfork enum + EthChainSpec hardfork methods#309
Open
feat(chainspec): add GravityHardfork enum + EthChainSpec hardfork methods#309
Conversation
96b3204 to
b699032
Compare
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.
b699032 to
7bd39e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add shared hardfork infrastructure to main:
GravityHardforkenum (Alpha, Beta, Gamma, Delta) ingravity.rsEthChainSpectrait methods:{alpha,beta,gamma,delta}_transitions_at_block()andis_{alpha,beta,gamma,delta}_active_at_block_number()with defaultfalseChainSpec.gravity_hardforksfield with genesis JSON parsing (alphaBlock,betaBlock,gammaBlock,deltaBlockfromextra_fields)ChainSpecimpl overrides usinggravity_hardforks.is_fork_active_at_block()Release branches add concrete hardfork modules (
alpha.rs,beta.rs, etc.) that implement the actual bytecode upgrades.