Skip to content

Support time-based forking #937

@Rjected

Description

@Rjected

Describe the feature

Shanghai and future forks will fork based on timestamp rather than block, and we currently only use a BlockNumber to distinguish between forks:

/// The active hard forks and their block numbers
pub hardforks: BTreeMap<Hardfork, BlockNumber>,

This could be changed to another type such as:

enum ForkKind {
    /// A fork's block number
    Block(BlockNumber),
    
    /// The unix timestamp of a fork
    Time(u64),
}

Additional context

The geth implementation of this has been merged in go-ethereum#25878

Metadata

Metadata

Assignees

Labels

A-utilsRelated to commonly used utilitiesC-enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions