Relax force_default_xcm_version for testnet system parachains (#2385)

This PR fixes two things:
- relax `force_default_xcm_version` for testnet system parachains (e.g.
BridgeHubWestend has now 2 and there is no way to change it to 3, so we
need to call `force_xcm_version(3)` for every parachain that it is
connected to, because we send XCMv3 messages)
- add `Storage` item to `PolkadotXcm` pallet definition (now we cannot
see storage items for `pallet_xcm` in PJS)


## TODO

- [ ] when merged open PR to `polkadot-fellows/runtimes` repo
This commit is contained in:
Branislav Kontur
2023-11-17 17:06:45 +01:00
committed by GitHub
parent 079b14f624
commit 0385902cd0
7 changed files with 42 additions and 32 deletions
@@ -275,8 +275,10 @@ impl Contains<RuntimeCall> for SafeCallFilter {
matches!( matches!(
call, call,
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | RuntimeCall::PolkadotXcm(
RuntimeCall::System( pallet_xcm::Call::force_xcm_version { .. } |
pallet_xcm::Call::force_default_xcm_version { .. }
) | RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } | frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } | frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } | frame_system::Call::set_code_without_checks { .. } |
@@ -272,8 +272,10 @@ impl Contains<RuntimeCall> for SafeCallFilter {
matches!( matches!(
call, call,
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | RuntimeCall::PolkadotXcm(
RuntimeCall::System( pallet_xcm::Call::force_xcm_version { .. } |
pallet_xcm::Call::force_default_xcm_version { .. }
) | RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } | frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } | frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } | frame_system::Call::set_code_without_checks { .. } |
@@ -498,7 +498,7 @@ construct_runtime!(
// XCM helpers. // XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config<T>} = 31, PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
@@ -161,8 +161,10 @@ impl Contains<RuntimeCall> for SafeCallFilter {
matches!( matches!(
call, call,
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | RuntimeCall::PolkadotXcm(
RuntimeCall::System( pallet_xcm::Call::force_xcm_version { .. } |
pallet_xcm::Call::force_default_xcm_version { .. }
) | RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } | frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } | frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } | frame_system::Call::set_code_without_checks { .. } |
@@ -497,7 +497,7 @@ construct_runtime!(
// XCM helpers. // XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30, XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin, Config<T>} = 31, PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
@@ -150,8 +150,10 @@ impl Contains<RuntimeCall> for SafeCallFilter {
matches!( matches!(
call, call,
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | RuntimeCall::PolkadotXcm(
RuntimeCall::System( pallet_xcm::Call::force_xcm_version { .. } |
pallet_xcm::Call::force_default_xcm_version { .. }
) | RuntimeCall::System(
frame_system::Call::set_heap_pages { .. } | frame_system::Call::set_heap_pages { .. } |
frame_system::Call::set_code { .. } | frame_system::Call::set_code { .. } |
frame_system::Call::set_code_without_checks { .. } | frame_system::Call::set_code_without_checks { .. } |
@@ -178,8 +178,10 @@ impl Contains<RuntimeCall> for SafeCallFilter {
pallet_collator_selection::Call::add_invulnerable { .. } | pallet_collator_selection::Call::add_invulnerable { .. } |
pallet_collator_selection::Call::remove_invulnerable { .. }, pallet_collator_selection::Call::remove_invulnerable { .. },
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | RuntimeCall::PolkadotXcm(
RuntimeCall::XcmpQueue(..) | pallet_xcm::Call::force_xcm_version { .. } |
pallet_xcm::Call::force_default_xcm_version { .. }
) | RuntimeCall::XcmpQueue(..) |
RuntimeCall::MessageQueue(..) | RuntimeCall::MessageQueue(..) |
RuntimeCall::Alliance( RuntimeCall::Alliance(
// `init_members` accepts unbounded vecs as arguments, // `init_members` accepts unbounded vecs as arguments,