From 1d3301e9b63ef4d40ff13a594db2061e20049c57 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Mon, 23 Jan 2023 11:45:23 +0900 Subject: [PATCH 1/2] XCM: Add HRMP to SafeCallFilter --- runtime/kusama/src/xcm_config.rs | 1 + runtime/polkadot/src/xcm_config.rs | 1 + runtime/rococo/src/xcm_config.rs | 1 + runtime/westend/src/xcm_config.rs | 1 + 4 files changed, 4 insertions(+) diff --git a/runtime/kusama/src/xcm_config.rs b/runtime/kusama/src/xcm_config.rs index 96679c3919a4..cd6db12583ef 100644 --- a/runtime/kusama/src/xcm_config.rs +++ b/runtime/kusama/src/xcm_config.rs @@ -326,6 +326,7 @@ impl Contains for SafeCallFilter { pallet_nomination_pools::Call::update_roles { .. } | pallet_nomination_pools::Call::chill { .. }, ) | + RuntimeCall::Hrmp(..) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, diff --git a/runtime/polkadot/src/xcm_config.rs b/runtime/polkadot/src/xcm_config.rs index abdd850f9e61..6525d775b8d0 100644 --- a/runtime/polkadot/src/xcm_config.rs +++ b/runtime/polkadot/src/xcm_config.rs @@ -290,6 +290,7 @@ impl Contains for SafeCallFilter { pallet_nomination_pools::Call::update_roles { .. } | pallet_nomination_pools::Call::chill { .. }, ) | + RuntimeCall::Hrmp(..) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, diff --git a/runtime/rococo/src/xcm_config.rs b/runtime/rococo/src/xcm_config.rs index 4b6702afa7b2..1be01ef81f63 100644 --- a/runtime/rococo/src/xcm_config.rs +++ b/runtime/rococo/src/xcm_config.rs @@ -261,6 +261,7 @@ impl Contains for SafeCallFilter { pallet_bounties::Call::close_bounty { .. }, ) | RuntimeCall::ChildBounties(..) | + RuntimeCall::Hrmp(..) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, diff --git a/runtime/westend/src/xcm_config.rs b/runtime/westend/src/xcm_config.rs index 5e887dafe9a1..de96606fcedd 100644 --- a/runtime/westend/src/xcm_config.rs +++ b/runtime/westend/src/xcm_config.rs @@ -201,6 +201,7 @@ impl Contains for SafeCallFilter { pallet_nomination_pools::Call::update_roles { .. } | pallet_nomination_pools::Call::chill { .. }, ) | + RuntimeCall::Hrmp(..) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, From 15622e8dd159f722529099665f26e4277b66d2de Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Mon, 23 Jan 2023 11:56:42 +0900 Subject: [PATCH 2/2] Whitelist several paras_registrar calls --- runtime/kusama/src/xcm_config.rs | 9 ++++++++- runtime/polkadot/src/xcm_config.rs | 9 ++++++++- runtime/rococo/src/xcm_config.rs | 9 ++++++++- runtime/westend/src/xcm_config.rs | 9 ++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/runtime/kusama/src/xcm_config.rs b/runtime/kusama/src/xcm_config.rs index cd6db12583ef..f46eca0c8189 100644 --- a/runtime/kusama/src/xcm_config.rs +++ b/runtime/kusama/src/xcm_config.rs @@ -26,7 +26,7 @@ use frame_support::{ traits::{Contains, Everything, Nothing}, weights::Weight, }; -use runtime_common::{xcm_sender, ToAuthor}; +use runtime_common::{paras_registrar, xcm_sender, ToAuthor}; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm_builder::{ @@ -327,6 +327,13 @@ impl Contains for SafeCallFilter { pallet_nomination_pools::Call::chill { .. }, ) | RuntimeCall::Hrmp(..) | + RuntimeCall::Registrar( + paras_registrar::Call::deregister { .. } | + paras_registrar::Call::swap { .. } | + paras_registrar::Call::remove_lock { .. } | + paras_registrar::Call::reserve { .. } | + paras_registrar::Call::add_lock { .. }, + ) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, diff --git a/runtime/polkadot/src/xcm_config.rs b/runtime/polkadot/src/xcm_config.rs index 6525d775b8d0..4f817093703a 100644 --- a/runtime/polkadot/src/xcm_config.rs +++ b/runtime/polkadot/src/xcm_config.rs @@ -25,7 +25,7 @@ use frame_support::{ traits::{Contains, Everything, Nothing}, weights::Weight, }; -use runtime_common::{xcm_sender, ToAuthor}; +use runtime_common::{paras_registrar, xcm_sender, ToAuthor}; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm_builder::{ @@ -291,6 +291,13 @@ impl Contains for SafeCallFilter { pallet_nomination_pools::Call::chill { .. }, ) | RuntimeCall::Hrmp(..) | + RuntimeCall::Registrar( + paras_registrar::Call::deregister { .. } | + paras_registrar::Call::swap { .. } | + paras_registrar::Call::remove_lock { .. } | + paras_registrar::Call::reserve { .. } | + paras_registrar::Call::add_lock { .. }, + ) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, diff --git a/runtime/rococo/src/xcm_config.rs b/runtime/rococo/src/xcm_config.rs index 1be01ef81f63..229df3a5df95 100644 --- a/runtime/rococo/src/xcm_config.rs +++ b/runtime/rococo/src/xcm_config.rs @@ -25,7 +25,7 @@ use frame_support::{ traits::{Contains, Everything, Nothing}, weights::Weight, }; -use runtime_common::{xcm_sender, ToAuthor}; +use runtime_common::{paras_registrar, xcm_sender, ToAuthor}; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm_builder::{ @@ -262,6 +262,13 @@ impl Contains for SafeCallFilter { ) | RuntimeCall::ChildBounties(..) | RuntimeCall::Hrmp(..) | + RuntimeCall::Registrar( + paras_registrar::Call::deregister { .. } | + paras_registrar::Call::swap { .. } | + paras_registrar::Call::remove_lock { .. } | + paras_registrar::Call::reserve { .. } | + paras_registrar::Call::add_lock { .. }, + ) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true, diff --git a/runtime/westend/src/xcm_config.rs b/runtime/westend/src/xcm_config.rs index de96606fcedd..ef38ca5d2970 100644 --- a/runtime/westend/src/xcm_config.rs +++ b/runtime/westend/src/xcm_config.rs @@ -24,7 +24,7 @@ use frame_support::{ parameter_types, traits::{Contains, Everything, Nothing}, }; -use runtime_common::{xcm_sender, ToAuthor}; +use runtime_common::{paras_registrar, xcm_sender, ToAuthor}; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm_builder::{ @@ -202,6 +202,13 @@ impl Contains for SafeCallFilter { pallet_nomination_pools::Call::chill { .. }, ) | RuntimeCall::Hrmp(..) | + RuntimeCall::Registrar( + paras_registrar::Call::deregister { .. } | + paras_registrar::Call::swap { .. } | + paras_registrar::Call::remove_lock { .. } | + paras_registrar::Call::reserve { .. } | + paras_registrar::Call::add_lock { .. }, + ) | RuntimeCall::XcmPallet(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) => true,