diff --git a/crates/scroll/alloy/hardforks/src/hardfork.rs b/crates/scroll/alloy/hardforks/src/hardfork.rs index dce4ac29147..719e41c889c 100644 --- a/crates/scroll/alloy/hardforks/src/hardfork.rs +++ b/crates/scroll/alloy/hardforks/src/hardfork.rs @@ -21,13 +21,15 @@ hardfork!( /// EuclidV2 EuclidV2, /// Feynman - Feynman + Feynman, + /// Galileo + Galileo, } ); impl ScrollHardfork { /// Scroll mainnet list of hardforks. - pub const fn scroll_mainnet() -> [(Self, ForkCondition); 8] { + pub const fn scroll_mainnet() -> [(Self, ForkCondition); 9] { [ (Self::Archimedes, ForkCondition::Block(0)), (Self::Bernoulli, ForkCondition::Block(5220340)), @@ -37,11 +39,12 @@ impl ScrollHardfork { (Self::Euclid, ForkCondition::Timestamp(1744815600)), (Self::EuclidV2, ForkCondition::Timestamp(1745305200)), (Self::Feynman, ForkCondition::Timestamp(1755576000)), + (Self::Galileo, ForkCondition::Timestamp(u64::MAX)), ] } /// Scroll sepolia list of hardforks. - pub const fn scroll_sepolia() -> [(Self, ForkCondition); 8] { + pub const fn scroll_sepolia() -> [(Self, ForkCondition); 9] { [ (Self::Archimedes, ForkCondition::Block(0)), (Self::Bernoulli, ForkCondition::Block(3747132)), @@ -51,6 +54,7 @@ impl ScrollHardfork { (Self::Euclid, ForkCondition::Timestamp(1741680000)), (Self::EuclidV2, ForkCondition::Timestamp(1741852800)), (Self::Feynman, ForkCondition::Timestamp(1753167600)), + (Self::Galileo, ForkCondition::Timestamp(u64::MAX)), ] } } @@ -62,8 +66,16 @@ mod tests { #[test] fn check_scroll_hardfork_from_str() { - let hardfork_str = - ["BernOulLi", "CUrie", "DaRwIn", "DaRwInV2", "EUcliD", "eUClidv2", "FEYnmaN"]; + let hardfork_str = [ + "BernOulLi", + "CUrie", + "DaRwIn", + "DaRwInV2", + "EUcliD", + "eUClidv2", + "FEYnmaN", + "gaLiLEo", + ]; let expected_hardforks = [ ScrollHardfork::Bernoulli, ScrollHardfork::Curie, @@ -72,6 +84,7 @@ mod tests { ScrollHardfork::Euclid, ScrollHardfork::EuclidV2, ScrollHardfork::Feynman, + ScrollHardfork::Galileo, ]; let hardforks: Vec = diff --git a/crates/scroll/alloy/hardforks/src/lib.rs b/crates/scroll/alloy/hardforks/src/lib.rs index a4b755ac03b..7dba7693601 100644 --- a/crates/scroll/alloy/hardforks/src/lib.rs +++ b/crates/scroll/alloy/hardforks/src/lib.rs @@ -52,6 +52,11 @@ pub trait ScrollHardforks: EthereumHardforks { fn is_feynman_active_at_timestamp(&self, timestamp: u64) -> bool { self.scroll_fork_activation(ScrollHardfork::Feynman).active_at_timestamp(timestamp) } + + /// Returns `true` if [`Galileo`](ScrollHardfork::Galileo) is active at given block timestamp. + fn is_galileo_active_at_timestamp(&self, timestamp: u64) -> bool { + self.scroll_fork_activation(ScrollHardfork::Galileo).active_at_timestamp(timestamp) + } } /// A type allowing to configure activation [`ForkCondition`]s for a given list of diff --git a/crates/scroll/chainspec/src/genesis.rs b/crates/scroll/chainspec/src/genesis.rs index c522461ec01..56a8c1ab885 100644 --- a/crates/scroll/chainspec/src/genesis.rs +++ b/crates/scroll/chainspec/src/genesis.rs @@ -69,6 +69,8 @@ pub struct ScrollHardforkInfo { pub euclid_v2_time: Option, /// feynman hardfork timestamp pub feynman_time: Option, + /// galileo hardfork timestamp + pub galileo_time: Option, } impl ScrollHardforkInfo { @@ -187,7 +189,8 @@ mod tests { "curieBlock": 12, "darwinTime": 0, "euclidTime": 11, - "feynmanTime": 100 + "feynmanTime": 100, + "galileoTime": 110 } "#; @@ -205,6 +208,7 @@ mod tests { euclid_time: Some(11), euclid_v2_time: None, feynman_time: Some(100), + galileo_time: Some(110), } ); } @@ -219,6 +223,7 @@ mod tests { "darwinTime": 0, "euclidTime": 11, "feynmanTime": 100, + "galileoTime": 110, "scroll": { "feeVaultAddress": "0x5300000000000000000000000000000000000005", "maxTxPayloadBytesPerBlock": 122880, @@ -247,6 +252,7 @@ mod tests { euclid_time: Some(11), euclid_v2_time: None, feynman_time: Some(100), + galileo_time: Some(110), }), scroll_chain_config: ScrollChainConfig { fee_vault_address: Some(address!("5300000000000000000000000000000000000005")), diff --git a/crates/scroll/chainspec/src/lib.rs b/crates/scroll/chainspec/src/lib.rs index aa7fdeae5d9..5688111fd06 100644 --- a/crates/scroll/chainspec/src/lib.rs +++ b/crates/scroll/chainspec/src/lib.rs @@ -431,6 +431,7 @@ impl From for ScrollChainSpec { (ScrollHardfork::Euclid.boxed(), hard_fork_info.euclid_time), (ScrollHardfork::EuclidV2.boxed(), hard_fork_info.euclid_v2_time), (ScrollHardfork::Feynman.boxed(), hard_fork_info.feynman_time), + (ScrollHardfork::Galileo.boxed(), hard_fork_info.galileo_time), ]; let mut time_hardforks = time_hardfork_opts @@ -545,7 +546,11 @@ mod tests { ), ( Head { number: 7096836, timestamp: 1755576000, ..Default::default() }, - ForkId { hash: ForkHash([0x38, 0x0f, 0x78, 0x5d]), next: 0 }, + ForkId { hash: ForkHash([0x38, 0x0f, 0x78, 0x5d]), next: u64::MAX }, + ), + ( + Head { number: 7096836, timestamp: u64::MAX, ..Default::default() }, + ForkId { hash: ForkHash([0x50, 0xe7, 0xe6, 0xd5]), next: 0 }, ), ], ); @@ -633,7 +638,11 @@ mod tests { ), ( Head { number: 4740239, timestamp: 1753167600, ..Default::default() }, - ForkId { hash: ForkHash([0x19, 0xbb, 0x92, 0xc6]), next: 0 }, + ForkId { hash: ForkHash([0x19, 0xbb, 0x92, 0xc6]), next: u64::MAX }, + ), + ( + Head { number: 4740239, timestamp: u64::MAX, ..Default::default() }, + ForkId { hash: ForkHash([0xf8, 0x27, 0xe0, 0xfc]), next: 0 }, ), ], ); @@ -734,6 +743,7 @@ mod tests { (String::from("darwinTime"), 0.into()), (String::from("darwinV2Time"), 0.into()), (String::from("feynmanTime"), 0.into()), + (String::from("galileoTime"), 0.into()), ( String::from("scroll"), serde_json::json!({ @@ -777,6 +787,7 @@ mod tests { ScrollHardfork::Darwin.boxed(), ScrollHardfork::DarwinV2.boxed(), ScrollHardfork::Feynman.boxed(), + ScrollHardfork::Galileo.boxed(), ]; assert!(expected_hardforks diff --git a/crates/scroll/hardforks/src/lib.rs b/crates/scroll/hardforks/src/lib.rs index c780f15eb3f..ef55f392492 100644 --- a/crates/scroll/hardforks/src/lib.rs +++ b/crates/scroll/hardforks/src/lib.rs @@ -40,6 +40,7 @@ pub static SCROLL_MAINNET_HARDFORKS: LazyLock = LazyLock::new(|| (ScrollHardfork::Euclid.boxed(), ForkCondition::Timestamp(1744815600)), (ScrollHardfork::EuclidV2.boxed(), ForkCondition::Timestamp(1745305200)), (ScrollHardfork::Feynman.boxed(), ForkCondition::Timestamp(1755576000)), + (ScrollHardfork::Galileo.boxed(), ForkCondition::Timestamp(u64::MAX)), ]) }); @@ -64,6 +65,7 @@ pub static SCROLL_SEPOLIA_HARDFORKS: LazyLock = LazyLock::new(|| (ScrollHardfork::Euclid.boxed(), ForkCondition::Timestamp(1741680000)), (ScrollHardfork::EuclidV2.boxed(), ForkCondition::Timestamp(1741852800)), (ScrollHardfork::Feynman.boxed(), ForkCondition::Timestamp(1753167600)), + (ScrollHardfork::Galileo.boxed(), ForkCondition::Timestamp(u64::MAX)), ]) }); @@ -88,5 +90,6 @@ pub static DEV_HARDFORKS: LazyLock = LazyLock::new(|| { (ScrollHardfork::Euclid.boxed(), ForkCondition::Timestamp(0)), (ScrollHardfork::EuclidV2.boxed(), ForkCondition::Timestamp(0)), (ScrollHardfork::Feynman.boxed(), ForkCondition::Timestamp(0)), + (ScrollHardfork::Galileo.boxed(), ForkCondition::Timestamp(0)), ]) });