diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs index 3c4a9306c50e..685b9a9d35bb 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs @@ -26,7 +26,7 @@ use crate::{ }; use bp_messages::{ source_chain::FromBridgedChainMessagesDeliveryProof, - target_chain::FromBridgedChainMessagesProof, LaneId, + target_chain::FromBridgedChainMessagesProof, }; use bp_runtime::Chain; use bridge_hub_common::xcm_version::XcmVersionOfDestAndRemoteBridge; @@ -224,3 +224,59 @@ mod tests { assert_eq!(BridgeRococoToRococoBulletinMessagesPalletInstance::get(), expected,); } } + +// TODO:(bridges-v2) - migration from static to dynamic lanes - FAIL-CI +pub mod migration_for_bridges_v2 { + use super::*; + + // /// A pair of sending chain location and message lane, used by this chain to send messages + // /// over the bridge. + // #[cfg_attr(feature = "std", derive(Debug, Eq, PartialEq))] + // pub struct SenderAndLane { + // /// Sending chain relative location. + // pub location: Location, + // /// Message lane, used by the sending chain. + // pub lane: LaneId, + // } + // + // impl SenderAndLane { + // /// Create new object using provided location and lane. + // pub fn new(location: Location, lane: LaneId) -> Self { + // SenderAndLane { location, lane } + // } + // } + // + // pub const XCM_LANE_FOR_ROCOCO_PEOPLE_TO_ROCOCO_BULLETIN: LaneId = LaneId([0, 0, 0, 0]); + // + // parameter_types! { + // pub RococoPeopleParaId: cumulus_primitives_core::ParaId = rococo_runtime_constants::system_parachain::PEOPLE_ID.into(); + // // Lanes + // /// All active lanes that the current bridge supports. + // pub ActiveOutboundLanesToRococoBulletin: &'static [bp_messages::LaneId] + // = &[XCM_LANE_FOR_ROCOCO_PEOPLE_TO_ROCOCO_BULLETIN]; + // /// Lane identifier, used to connect Rococo People and Rococo Bulletin chain. + // pub const RococoPeopleToRococoBulletinMessagesLane: bp_messages::LaneId + // = XCM_LANE_FOR_ROCOCO_PEOPLE_TO_ROCOCO_BULLETIN; + // /// Identifier of the sibling Rococo People parachain. + // /// A route (XCM location and bridge lane) that the Rococo People Chain -> Rococo Bulletin Chain + // /// message is following. + // pub FromRococoPeopleToRococoBulletinRoute: SenderAndLane = SenderAndLane::new( + // ParentThen(Parachain(RococoPeopleParaId::get().into()).into()).into(), + // XCM_LANE_FOR_ROCOCO_PEOPLE_TO_ROCOCO_BULLETIN, + // ); + // /// All active routes and their destinations. + // pub ActiveLanes: alloc::vec::Vec<(SenderAndLane, (NetworkId, InteriorLocation))> = alloc::vec![ + // ( + // FromRococoPeopleToRococoBulletinRoute::get(), + // (RococoBulletinGlobalConsensusNetwork::get(), Here) + // ) + // ]; + // } + + pub struct StaticToDynamicLanes; + impl frame_support::traits::OnRuntimeUpgrade for StaticToDynamicLanes { + fn on_runtime_upgrade() -> Weight { + todo!() + } + } +} diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs index 465bac6b9a4f..db966bee1994 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs @@ -25,7 +25,7 @@ use crate::{ }; use bp_messages::{ source_chain::FromBridgedChainMessagesDeliveryProof, - target_chain::FromBridgedChainMessagesProof, LaneId, + target_chain::FromBridgedChainMessagesProof, }; use bp_runtime::Chain; use bridge_hub_common::xcm_version::XcmVersionOfDestAndRemoteBridge; @@ -274,3 +274,52 @@ mod tests { assert_eq!(BridgeRococoToWestendMessagesPalletInstance::get(), expected,); } } + +// TODO:(bridges-v2) - migration from static to dynamic lanes - FAIL-CI +pub mod migration_for_bridges_v2 { + use super::*; + + // /// A pair of sending chain location and message lane, used by this chain to send messages + // /// over the bridge. + // #[cfg_attr(feature = "std", derive(Debug, Eq, PartialEq))] + // pub struct SenderAndLane { + // /// Sending chain relative location. + // pub location: Location, + // /// Message lane, used by the sending chain. + // pub lane: LaneId, + // } + // + // impl SenderAndLane { + // /// Create new object using provided location and lane. + // pub fn new(location: Location, lane: LaneId) -> Self { + // SenderAndLane { location, lane } + // } + // } + // + // pub const XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND: LaneId = LaneId([0, 0, 0, 2]); + // parameter_types! { + // pub AssetHubRococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_rococo::ASSET_HUB_ROCOCO_PARACHAIN_ID.into(); + // pub AssetHubWestendParaId: cumulus_primitives_core::ParaId = bp_asset_hub_westend::ASSET_HUB_WESTEND_PARACHAIN_ID.into(); + // + // // Lanes + // pub ActiveOutboundLanesToBridgeHubWestend: &'static [bp_messages::LaneId] = &[XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND]; + // pub const AssetHubRococoToAssetHubWestendMessagesLane: bp_messages::LaneId = XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND; + // pub FromAssetHubRococoToAssetHubWestendRoute: SenderAndLane = SenderAndLane::new( + // ParentThen([Parachain(AssetHubRococoParaId::get().into())].into()).into(), + // XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND, + // ); + // pub ActiveLanes: alloc::vec::Vec<(SenderAndLane, (NetworkId, InteriorLocation))> = alloc::vec![ + // ( + // FromAssetHubRococoToAssetHubWestendRoute::get(), + // (WestendGlobalConsensusNetwork::get(), [Parachain(AssetHubWestendParaId::get().into())].into()) + // ) + // ]; + // } + + pub struct StaticToDynamicLanes; + impl frame_support::traits::OnRuntimeUpgrade for StaticToDynamicLanes { + fn on_runtime_upgrade() -> Weight { + todo!() + } + } +} diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 4a31bf8703c6..a57fb8148964 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -161,6 +161,8 @@ pub type Migrations = ( ConstU32, ConstU32, >, + bridge_to_westend_config::migration_for_bridges_v2::StaticToDynamicLanes, + bridge_to_bulletin_config::migration_for_bridges_v2::StaticToDynamicLanes, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, ); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_rococo_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_rococo_config.rs index 68fe1c4a5304..f9e19f50f88e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_rococo_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/bridge_to_rococo_config.rs @@ -23,7 +23,7 @@ use crate::{ }; use bp_messages::{ source_chain::FromBridgedChainMessagesDeliveryProof, - target_chain::FromBridgedChainMessagesProof, LaneId, + target_chain::FromBridgedChainMessagesProof, }; use bp_parachains::SingleParaStoredHeaderDataBuilder; use bp_runtime::Chain; @@ -304,3 +304,52 @@ mod tests { ); } } + +// TODO:(bridges-v2) - migration from static to dynamic lanes - FAIL-CI +pub mod migration_for_bridges_v2 { + use super::*; + + // /// A pair of sending chain location and message lane, used by this chain to send messages + // /// over the bridge. + // #[cfg_attr(feature = "std", derive(Debug, Eq, PartialEq))] + // pub struct SenderAndLane { + // /// Sending chain relative location. + // pub location: Location, + // /// Message lane, used by the sending chain. + // pub lane: LaneId, + // } + // + // impl SenderAndLane { + // /// Create new object using provided location and lane. + // pub fn new(location: Location, lane: LaneId) -> Self { + // SenderAndLane { location, lane } + // } + // } + // + // pub const XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO: LaneId = LaneId([0, 0, 0, 2]); + // parameter_types! { + // pub AssetHubWestendParaId: cumulus_primitives_core::ParaId = bp_asset_hub_westend::ASSET_HUB_WESTEND_PARACHAIN_ID.into(); + // pub AssetHubRococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_rococo::ASSET_HUB_ROCOCO_PARACHAIN_ID.into(); + // + // // Lanes + // pub ActiveOutboundLanesToBridgeHubRococo: &'static [bp_messages::LaneId] = &[XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO]; + // pub const AssetHubWestendToAssetHubRococoMessagesLane: bp_messages::LaneId = XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO; + // pub FromAssetHubWestendToAssetHubRococoRoute: SenderAndLane = SenderAndLane::new( + // ParentThen([Parachain(AssetHubWestendParaId::get().into())].into()).into(), + // XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO, + // ); + // pub ActiveLanes: alloc::vec::Vec<(SenderAndLane, (NetworkId, InteriorLocation))> = alloc::vec![ + // ( + // FromAssetHubWestendToAssetHubRococoRoute::get(), + // (RococoGlobalConsensusNetwork::get(), [Parachain(AssetHubRococoParaId::get().into())].into()) + // ) + // ]; + // } + + pub struct StaticToDynamicLanes; + impl frame_support::traits::OnRuntimeUpgrade for StaticToDynamicLanes { + fn on_runtime_upgrade() -> Weight { + todo!() + } + } +} diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs index 13fef13b5b24..d0e55895ecbf 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs @@ -134,6 +134,7 @@ pub type Migrations = ( // unreleased cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + bridge_to_rococo_config::migration_for_bridges_v2::StaticToDynamicLanes, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, );