use kona_genesis::RollupConfig;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum EngineForkchoiceVersion {
V2,
V3,
}
impl EngineForkchoiceVersion {
pub fn from_cfg(cfg: &RollupConfig, timestamp: u64) -> Self {
if cfg.is_ecotone_active(timestamp) {
Self::V3
} else {
Self::V2
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum EngineNewPayloadVersion {
V2,
V3,
V4,
}
impl EngineNewPayloadVersion {
pub fn from_cfg(cfg: &RollupConfig, timestamp: u64) -> Self {
if cfg.is_isthmus_active(timestamp) {
Self::V4
} else if cfg.is_ecotone_active(timestamp) {
Self::V3
} else {
Self::V2
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum EngineGetPayloadVersion {
V2,
V3,
V4,
}
impl EngineGetPayloadVersion {
pub fn from_cfg(cfg: &RollupConfig, timestamp: u64) -> Self {
if cfg.is_isthmus_active(timestamp) {
Self::V4
} else if cfg.is_ecotone_active(timestamp) {
Self::V3
} else {
Self::V2
}
}
}