Skip to content

Commit fb52660

Browse files
muharemsamelamin
authored andcommitted
Companion: Accept Kusama StakingAdmin origin (paritytech#1865)
* Companion: Accept Kusamsa StakinAdmin origin * Fellows origin for xcmp queue controller * plurality bodies to ensure origin * include root into controller ensure origin * fix * use xcm bodies * rename to more frequent "defense" Co-authored-by: parity-processbot <>
1 parent ba57e1e commit fb52660

File tree

1 file changed

+20
-5
lines changed
  • parachains/runtimes/assets/statemine/src

1 file changed

+20
-5
lines changed

parachains/runtimes/assets/statemine/src/lib.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use xcm_config::{KsmLocation, XcmConfig};
6969
pub use sp_runtime::BuildStorage;
7070

7171
// Polkadot imports
72-
use pallet_xcm::{EnsureXcm, IsMajorityOfBody};
72+
use pallet_xcm::{EnsureXcm, IsMajorityOfBody, IsVoiceOfBody};
7373
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
7474
use xcm::latest::BodyId;
7575
use xcm_executor::XcmExecutor;
@@ -451,6 +451,11 @@ impl parachain_info::Config for Runtime {}
451451

452452
impl cumulus_pallet_aura_ext::Config for Runtime {}
453453

454+
parameter_types! {
455+
// Fellows pluralistic body.
456+
pub const FellowsBodyId: BodyId = BodyId::Technical;
457+
}
458+
454459
impl cumulus_pallet_xcmp_queue::Config for Runtime {
455460
type RuntimeEvent = RuntimeEvent;
456461
type XcmExecutor = XcmExecutor<XcmConfig>;
@@ -459,7 +464,10 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
459464
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
460465
type ControllerOrigin = EitherOfDiverse<
461466
EnsureRoot<AccountId>,
462-
EnsureXcm<IsMajorityOfBody<KsmLocation, ExecutiveBody>>,
467+
EnsureXcm<(
468+
IsMajorityOfBody<KsmLocation, ExecutiveBody>,
469+
IsVoiceOfBody<KsmLocation, FellowsBodyId>,
470+
)>,
463471
>;
464472
type ControllerOriginConverter = xcm_config::XcmOriginToTransactDispatchOrigin;
465473
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
@@ -502,11 +510,18 @@ parameter_types! {
502510
pub const MinCandidates: u32 = 5;
503511
pub const SessionLength: BlockNumber = 6 * HOURS;
504512
pub const MaxInvulnerables: u32 = 100;
513+
// StakingAdmin pluralistic body.
514+
pub const StakingAdminBodyId: BodyId = BodyId::Defense;
505515
}
506516

507-
/// We allow root and the Relay Chain council to execute privileged collator selection operations.
508-
pub type CollatorSelectionUpdateOrigin =
509-
EitherOfDiverse<EnsureRoot<AccountId>, EnsureXcm<IsMajorityOfBody<KsmLocation, ExecutiveBody>>>;
517+
/// We allow root, the Relay Chain council and the StakingAdmin to execute privileged collator selection operations.
518+
pub type CollatorSelectionUpdateOrigin = EitherOfDiverse<
519+
EnsureRoot<AccountId>,
520+
EnsureXcm<(
521+
IsMajorityOfBody<KsmLocation, ExecutiveBody>,
522+
IsVoiceOfBody<KsmLocation, StakingAdminBodyId>,
523+
)>,
524+
>;
510525

511526
impl pallet_collator_selection::Config for Runtime {
512527
type RuntimeEvent = RuntimeEvent;

0 commit comments

Comments
 (0)