Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/hardforks/src/ethereum/mainnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ pub const MAINNET_SHANGHAI_TIMESTAMP: u64 = 1_681_338_455;
pub const MAINNET_CANCUN_TIMESTAMP: u64 = 1_710_338_135;
/// Prague hard fork activation timestamp is 1746612311.
pub const MAINNET_PRAGUE_TIMESTAMP: u64 = 1_746_612_311;
/// Osaka hard fork activation timestamp is 1764798551.
pub const MAINNET_OSAKA_TIMESTAMP: u64 = 1_764_798_551;
/// BPO1 hardfork activation timestamp is 1765290071.
pub const MAINNET_BPO1_TIMESTAMP: u64 = 1_765_290_071;
/// BPO2 hardfork activation timestamp is 1767747671.
pub const MAINNET_BPO2_TIMESTAMP: u64 = 1_767_747_671;
12 changes: 9 additions & 3 deletions crates/hardforks/src/hardfork/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ impl EthereumHardfork {
Self::Shanghai => Some(MAINNET_SHANGHAI_TIMESTAMP),
Self::Cancun => Some(MAINNET_CANCUN_TIMESTAMP),
Self::Prague => Some(MAINNET_PRAGUE_TIMESTAMP),
// upcoming hardforks
Self::Osaka => Some(MAINNET_OSAKA_TIMESTAMP),
Self::Bpo1 => Some(MAINNET_BPO1_TIMESTAMP),
Self::Bpo2 => Some(MAINNET_BPO2_TIMESTAMP),
_ => None,
}
}
Expand Down Expand Up @@ -417,7 +419,7 @@ impl EthereumHardfork {
}

/// Ethereum mainnet list of hardforks.
pub const fn mainnet() -> [(Self, ForkCondition); 18] {
pub const fn mainnet() -> [(Self, ForkCondition); 21] {
[
(Self::Frontier, ForkCondition::Block(MAINNET_FRONTIER_BLOCK)),
(Self::Homestead, ForkCondition::Block(MAINNET_HOMESTEAD_BLOCK)),
Expand All @@ -444,6 +446,9 @@ impl EthereumHardfork {
(Self::Shanghai, ForkCondition::Timestamp(MAINNET_SHANGHAI_TIMESTAMP)),
(Self::Cancun, ForkCondition::Timestamp(MAINNET_CANCUN_TIMESTAMP)),
(Self::Prague, ForkCondition::Timestamp(MAINNET_PRAGUE_TIMESTAMP)),
(Self::Osaka, ForkCondition::Timestamp(MAINNET_OSAKA_TIMESTAMP)),
(Self::Bpo1, ForkCondition::Timestamp(MAINNET_BPO1_TIMESTAMP)),
(Self::Bpo2, ForkCondition::Timestamp(MAINNET_BPO2_TIMESTAMP)),
]
}

Expand Down Expand Up @@ -620,7 +625,8 @@ impl EthereumHardfork {
_i if timestamp < MAINNET_SHANGHAI_TIMESTAMP => Self::Paris,
_i if timestamp < MAINNET_CANCUN_TIMESTAMP => Self::Shanghai,
_i if timestamp < MAINNET_PRAGUE_TIMESTAMP => Self::Cancun,
_ => Self::Prague,
_i if timestamp < MAINNET_OSAKA_TIMESTAMP => Self::Prague,
_ => Self::Osaka,
}),
NamedChain::Sepolia => Some(match timestamp {
_i if timestamp < SEPOLIA_PARIS_TIMESTAMP => Self::London,
Expand Down