diff --git a/system-parachains/collectives/collectives-polkadot/src/impls.rs b/system-parachains/collectives/collectives-polkadot/src/impls.rs index a897e6b112..61d1f768f8 100644 --- a/system-parachains/collectives/collectives-polkadot/src/impls.rs +++ b/system-parachains/collectives/collectives-polkadot/src/impls.rs @@ -241,8 +241,25 @@ pub mod benchmarks { pub struct OpenHrmpChannel(PhantomData); impl> EnsureSuccessful for OpenHrmpChannel { fn ensure_successful() { - if let ChannelStatus::Closed = ParachainSystem::get_channel_status(I::get().into()) { - ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(I::get().into()) + let para_id = I::get(); + + // open HRMP channel + if let ChannelStatus::Closed = ParachainSystem::get_channel_status(para_id.into()) { + ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(para_id.into()) + } + + // set XCM version for sibling parachain + let sibling_parachain = Location::new(1, [Parachain(para_id)]); + if let None = PolkadotXcm::get_version_for(&sibling_parachain) { + if let Err(e) = PolkadotXcm::force_xcm_version( + RuntimeOrigin::root(), + sibling_parachain.into(), + system_parachains_constants::genesis_presets::SAFE_XCM_VERSION, + ) { + log::error!( + "Failed to `force_xcm_version` for para_id: {para_id:?}, error: {e:?}" + ); + } } } }