Skip to content

Commit adc9443

Browse files
authored
Use three out of five membership threshold (#1404)
* use three out of five membership threshold * update copyright year
1 parent 940a8d8 commit adc9443

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

runtime/common/src/lib.rs

+31-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022-2024 Forecasting Technologies LTD.
1+
// Copyright 2022-2025 Forecasting Technologies LTD.
22
// Copyright 2021-2022 Zeitgeist PM LLC.
33
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
44
//
@@ -202,6 +202,12 @@ macro_rules! decl_common_types {
202202
EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 2>,
203203
>;
204204

205+
// At least 60%
206+
type EnsureRootOrThreeFifthsCouncil = EitherOfDiverse<
207+
EnsureRoot<AccountId>,
208+
EnsureProportionAtLeast<AccountId, CouncilInstance, 3, 5>,
209+
>;
210+
205211
// At least 66%
206212
type EnsureRootOrTwoThirdsCouncil = EitherOfDiverse<
207213
EnsureRoot<AccountId>,
@@ -228,6 +234,12 @@ macro_rules! decl_common_types {
228234
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 1, 2>,
229235
>;
230236

237+
// At least 60%
238+
type EnsureRootOrThreeFifthsTechnicalCommittee = EitherOfDiverse<
239+
EnsureRoot<AccountId>,
240+
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 3, 5>,
241+
>;
242+
231243
// At least 66%
232244
type EnsureRootOrTwoThirdsTechnicalCommittee = EitherOfDiverse<
233245
EnsureRoot<AccountId>,
@@ -483,7 +495,7 @@ macro_rules! impl_config_traits {
483495
#[cfg(feature = "parachain")]
484496
impl cumulus_pallet_xcmp_queue::Config for Runtime {
485497
type ChannelInfo = ParachainSystem;
486-
type ControllerOrigin = EnsureRootOrTwoThirdsTechnicalCommittee;
498+
type ControllerOrigin = EnsureRootOrThreeFifthsTechnicalCommittee;
487499
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
488500
type ExecuteOverweightOrigin = EnsureRootOrHalfTechnicalCommittee;
489501
type PriceForSiblingDelivery = ();
@@ -664,7 +676,7 @@ macro_rules! impl_config_traits {
664676
impl orml_asset_registry::Config for Runtime {
665677
type AssetId = CurrencyId;
666678
type AssetProcessor = CustomAssetProcessor;
667-
type AuthorityOrigin = AsEnsureOriginWithArg<EnsureRootOrTwoThirdsCouncil>;
679+
type AuthorityOrigin = AsEnsureOriginWithArg<EnsureRootOrThreeFifthsCouncil>;
668680
type Balance = Balance;
669681
type CustomMetadata = CustomMetadata;
670682
type RuntimeEvent = RuntimeEvent;
@@ -814,7 +826,7 @@ macro_rules! impl_config_traits {
814826
type ExternalDefaultOrigin = EnsureRootOrAllCouncil;
815827
/// Origin that can have an ExternalMajority/ExternalDefault vote
816828
/// be tabled immediately and with a shorter voting/enactment period.
817-
type FastTrackOrigin = EnsureRootOrTwoThirdsTechnicalCommittee;
829+
type FastTrackOrigin = EnsureRootOrThreeFifthsTechnicalCommittee;
818830
/// Origin from which the next majority-carries (or more permissive) referendum may be tabled
819831
/// to vote immediately and asynchronously in a similar manner to the emergency origin.
820832
type InstantOrigin = EnsureRootOrAllTechnicalCommittee;
@@ -858,41 +870,41 @@ macro_rules! impl_config_traits {
858870
}
859871

860872
impl pallet_membership::Config<AdvisoryCommitteeMembershipInstance> for Runtime {
861-
type AddOrigin = EnsureRootOrTwoThirdsCouncil;
873+
type AddOrigin = EnsureRootOrThreeFifthsCouncil;
862874
type RuntimeEvent = RuntimeEvent;
863875
type MaxMembers = AdvisoryCommitteeMaxMembers;
864876
type MembershipChanged = AdvisoryCommittee;
865877
type MembershipInitialized = AdvisoryCommittee;
866-
type PrimeOrigin = EnsureRootOrTwoThirdsCouncil;
867-
type RemoveOrigin = EnsureRootOrTwoThirdsCouncil;
868-
type ResetOrigin = EnsureRootOrTwoThirdsCouncil;
869-
type SwapOrigin = EnsureRootOrTwoThirdsCouncil;
878+
type PrimeOrigin = EnsureRootOrThreeFifthsCouncil;
879+
type RemoveOrigin = EnsureRootOrThreeFifthsCouncil;
880+
type ResetOrigin = EnsureRootOrThreeFifthsCouncil;
881+
type SwapOrigin = EnsureRootOrThreeFifthsCouncil;
870882
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
871883
}
872884

873885
impl pallet_membership::Config<CouncilMembershipInstance> for Runtime {
874-
type AddOrigin = EnsureRootOrThreeFourthsCouncil;
886+
type AddOrigin = EnsureRootOrThreeFifthsCouncil;
875887
type RuntimeEvent = RuntimeEvent;
876888
type MaxMembers = CouncilMaxMembers;
877889
type MembershipChanged = Council;
878890
type MembershipInitialized = Council;
879-
type PrimeOrigin = EnsureRootOrThreeFourthsCouncil;
880-
type RemoveOrigin = EnsureRootOrThreeFourthsCouncil;
881-
type ResetOrigin = EnsureRootOrThreeFourthsCouncil;
882-
type SwapOrigin = EnsureRootOrThreeFourthsCouncil;
891+
type PrimeOrigin = EnsureRootOrThreeFifthsCouncil;
892+
type RemoveOrigin = EnsureRootOrThreeFifthsCouncil;
893+
type ResetOrigin = EnsureRootOrThreeFifthsCouncil;
894+
type SwapOrigin = EnsureRootOrThreeFifthsCouncil;
883895
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
884896
}
885897

886898
impl pallet_membership::Config<TechnicalCommitteeMembershipInstance> for Runtime {
887-
type AddOrigin = EnsureRootOrTwoThirdsCouncil;
899+
type AddOrigin = EnsureRootOrThreeFifthsCouncil;
888900
type RuntimeEvent = RuntimeEvent;
889901
type MaxMembers = TechnicalCommitteeMaxMembers;
890902
type MembershipChanged = TechnicalCommittee;
891903
type MembershipInitialized = TechnicalCommittee;
892-
type PrimeOrigin = EnsureRootOrTwoThirdsCouncil;
893-
type RemoveOrigin = EnsureRootOrTwoThirdsCouncil;
894-
type ResetOrigin = EnsureRootOrTwoThirdsCouncil;
895-
type SwapOrigin = EnsureRootOrTwoThirdsCouncil;
904+
type PrimeOrigin = EnsureRootOrThreeFifthsCouncil;
905+
type RemoveOrigin = EnsureRootOrThreeFifthsCouncil;
906+
type ResetOrigin = EnsureRootOrThreeFifthsCouncil;
907+
type SwapOrigin = EnsureRootOrThreeFifthsCouncil;
896908
type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
897909
}
898910

0 commit comments

Comments
 (0)