From f1475d03ef473660d466b9ead36bdae3858c3b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Pa=C4=8Dandi?= <3002868+Dinonard@users.noreply.github.com> Date: Mon, 9 Sep 2024 08:29:10 +0200 Subject: [PATCH] Modify Shibuya governance params (#1351) --- primitives/src/governance.rs | 15 +++++++ runtime/shibuya/src/lib.rs | 82 ++++++++++++++++++------------------ 2 files changed, 56 insertions(+), 41 deletions(-) diff --git a/primitives/src/governance.rs b/primitives/src/governance.rs index b05998747..da3acf489 100644 --- a/primitives/src/governance.rs +++ b/primitives/src/governance.rs @@ -44,6 +44,11 @@ pub type EnsureRootOrTwoThirdsMainCouncil = EitherOfDiverse< pallet_collective::EnsureProportionAtLeast, >; +pub type EnsureRootOrHalfMainCouncil = EitherOfDiverse< + EnsureRoot, + pallet_collective::EnsureProportionAtLeast, +>; + // Technical Committee pub type EnsureRootOrAllTechnicalCommittee = EitherOfDiverse< EnsureRoot, @@ -55,6 +60,11 @@ pub type EnsureRootOrTwoThirdsTechnicalCommittee = EitherOfDiverse< pallet_collective::EnsureProportionAtLeast, >; +pub type EnsureRootOrHalfTechnicalCommittee = EitherOfDiverse< + EnsureRoot, + pallet_collective::EnsureProportionAtLeast, +>; + // Community Council pub type EnsureRootOrAllCommunityCouncil = EitherOfDiverse< EnsureRoot, @@ -65,3 +75,8 @@ pub type EnsureRootOrTwoThirdsCommunityCouncil = EitherOfDiverse< EnsureRoot, pallet_collective::EnsureProportionAtLeast, >; + +pub type EnsureRootOrHalfCommunityCouncil = EitherOfDiverse< + EnsureRoot, + pallet_collective::EnsureProportionAtLeast, +>; diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 5ec031f27..c5ed92c76 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -84,10 +84,10 @@ use astar_primitives::{ governance::{ CommunityCouncilCollectiveInst, CommunityCouncilMembershipInst, CommunityTreasuryInst, EnsureRootOrAllMainCouncil, EnsureRootOrAllTechnicalCommittee, - EnsureRootOrTwoThirdsCommunityCouncil, EnsureRootOrTwoThirdsMainCouncil, - EnsureRootOrTwoThirdsTechnicalCommittee, MainCouncilCollectiveInst, - MainCouncilMembershipInst, MainTreasuryInst, OracleMembershipInst, - TechnicalCommitteeCollectiveInst, TechnicalCommitteeMembershipInst, + EnsureRootOrHalfCommunityCouncil, EnsureRootOrHalfMainCouncil, + EnsureRootOrHalfTechnicalCommittee, MainCouncilCollectiveInst, MainCouncilMembershipInst, + MainTreasuryInst, OracleMembershipInst, TechnicalCommitteeCollectiveInst, + TechnicalCommitteeMembershipInst, }, oracle::{CurrencyAmount, CurrencyId, DummyCombineData, Price}, xcm::AssetLocationIdConverter, @@ -462,9 +462,9 @@ impl pallet_dapp_staking::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type Currency = Balances; type SmartContract = SmartContract; - type ContractRegisterOrigin = EnsureRootOrTwoThirdsCommunityCouncil; + type ContractRegisterOrigin = EnsureRootOrHalfCommunityCouncil; type ContractUnregisterOrigin = frame_system::EnsureRoot; - type ManagerOrigin = EnsureRootOrTwoThirdsTechnicalCommittee; + type ManagerOrigin = EnsureRootOrHalfTechnicalCommittee; type NativePriceProvider = PriceAggregator; type StakingRewardHandler = Inflation; type CycleConfiguration = InflationCycleConfig; @@ -1240,11 +1240,11 @@ impl orml_oracle::Config for Runtime { impl pallet_membership::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type AddOrigin = EnsureRootOrTwoThirdsMainCouncil; - type RemoveOrigin = EnsureRootOrTwoThirdsMainCouncil; - type SwapOrigin = EnsureRootOrTwoThirdsMainCouncil; - type ResetOrigin = EnsureRootOrTwoThirdsMainCouncil; - type PrimeOrigin = EnsureRootOrTwoThirdsMainCouncil; + type AddOrigin = EnsureRootOrHalfMainCouncil; + type RemoveOrigin = EnsureRootOrHalfMainCouncil; + type SwapOrigin = EnsureRootOrHalfMainCouncil; + type ResetOrigin = EnsureRootOrHalfMainCouncil; + type PrimeOrigin = EnsureRootOrHalfMainCouncil; type MembershipInitialized = (); type MembershipChanged = (); type MaxMembers = ConstU32<16>; @@ -1277,11 +1277,11 @@ parameter_types! { impl pallet_membership::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type AddOrigin = EnsureRootOrTwoThirdsMainCouncil; - type RemoveOrigin = EnsureRootOrTwoThirdsMainCouncil; - type SwapOrigin = EnsureRootOrTwoThirdsMainCouncil; - type ResetOrigin = EnsureRootOrTwoThirdsMainCouncil; - type PrimeOrigin = EnsureRootOrTwoThirdsMainCouncil; + type AddOrigin = EnsureRootOrHalfMainCouncil; + type RemoveOrigin = EnsureRootOrHalfMainCouncil; + type SwapOrigin = EnsureRootOrHalfMainCouncil; + type ResetOrigin = EnsureRootOrHalfMainCouncil; + type PrimeOrigin = EnsureRootOrHalfMainCouncil; type MembershipInitialized = Council; type MembershipChanged = Council; type MaxMembers = CouncilMaxMembers; @@ -1290,11 +1290,11 @@ impl pallet_membership::Config for Runtime { impl pallet_membership::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type AddOrigin = EnsureRootOrTwoThirdsMainCouncil; - type RemoveOrigin = EnsureRootOrTwoThirdsMainCouncil; - type SwapOrigin = EnsureRootOrTwoThirdsMainCouncil; - type ResetOrigin = EnsureRootOrTwoThirdsMainCouncil; - type PrimeOrigin = EnsureRootOrTwoThirdsMainCouncil; + type AddOrigin = EnsureRootOrHalfMainCouncil; + type RemoveOrigin = EnsureRootOrHalfMainCouncil; + type SwapOrigin = EnsureRootOrHalfMainCouncil; + type ResetOrigin = EnsureRootOrHalfMainCouncil; + type PrimeOrigin = EnsureRootOrHalfMainCouncil; type MembershipInitialized = TechnicalCommittee; type MembershipChanged = TechnicalCommittee; type MaxMembers = TechnicalCommitteeMaxMembers; @@ -1303,11 +1303,11 @@ impl pallet_membership::Config for Runtime { impl pallet_membership::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type AddOrigin = EnsureRootOrTwoThirdsMainCouncil; - type RemoveOrigin = EnsureRootOrTwoThirdsMainCouncil; - type SwapOrigin = EnsureRootOrTwoThirdsMainCouncil; - type ResetOrigin = EnsureRootOrTwoThirdsMainCouncil; - type PrimeOrigin = EnsureRootOrTwoThirdsMainCouncil; + type AddOrigin = EnsureRootOrHalfMainCouncil; + type RemoveOrigin = EnsureRootOrHalfMainCouncil; + type SwapOrigin = EnsureRootOrHalfMainCouncil; + type ResetOrigin = EnsureRootOrHalfMainCouncil; + type PrimeOrigin = EnsureRootOrHalfMainCouncil; type MembershipInitialized = CommunityCouncil; type MembershipChanged = CommunityCouncil; type MaxMembers = CommunityCouncilMaxMembers; @@ -1322,7 +1322,7 @@ impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type MotionDuration = ConstU32<{ 2 * DAYS }>; + type MotionDuration = ConstU32<{ 5 * DAYS }>; type MaxProposals = ConstU32<16>; type MaxMembers = CouncilMaxMembers; type DefaultVote = pallet_collective::PrimeDefaultVote; @@ -1335,7 +1335,7 @@ impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type MotionDuration = ConstU32<{ 2 * DAYS }>; + type MotionDuration = ConstU32<{ 5 * DAYS }>; type MaxProposals = ConstU32<16>; type MaxMembers = TechnicalCommitteeMaxMembers; type DefaultVote = pallet_collective::PrimeDefaultVote; @@ -1348,7 +1348,7 @@ impl pallet_collective::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; - type MotionDuration = ConstU32<{ 2 * DAYS }>; + type MotionDuration = ConstU32<{ 5 * DAYS }>; type MaxProposals = ConstU32<16>; type MaxMembers = CommunityCouncilMaxMembers; type DefaultVote = pallet_collective::PrimeDefaultVote; @@ -1360,9 +1360,9 @@ impl pallet_collective::Config for Runtime { impl pallet_democracy::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; - type EnactmentPeriod = ConstU32<{ 2 * HOURS }>; - type LaunchPeriod = ConstU32<{ 3 * DAYS }>; - type VotingPeriod = ConstU32<{ 3 * DAYS }>; + type EnactmentPeriod = ConstU32<{ 2 * DAYS }>; + type LaunchPeriod = ConstU32<{ 4 * DAYS }>; + type VotingPeriod = ConstU32<{ 4 * DAYS }>; type VoteLockingPeriod = ConstU32<{ 1 * DAYS }>; type MinimumDeposit = ConstU128<{ 10 * SBY }>; type FastTrackVotingPeriod = ConstU32<{ 1 * HOURS }>; @@ -1374,21 +1374,21 @@ impl pallet_democracy::Config for Runtime { type MaxBlacklisted = ConstU32<128>; /// A two third majority of the Council can choose the next external "super majority approve" proposal. - type ExternalOrigin = EnsureRootOrTwoThirdsMainCouncil; + type ExternalOrigin = EnsureRootOrHalfMainCouncil; /// A two third majority of the Council can choose the next external "majority approve" proposal. Also bypasses blacklist filter. - type ExternalMajorityOrigin = EnsureRootOrTwoThirdsMainCouncil; + type ExternalMajorityOrigin = EnsureRootOrHalfMainCouncil; /// Unanimous approval of the Council can choose the next external "super majority against" proposal. type ExternalDefaultOrigin = EnsureRootOrAllMainCouncil; /// A two third majority of the Technical Committee can have an external proposal tabled immediately /// for a _fast track_ vote, and a custom enactment period. - type FastTrackOrigin = EnsureRootOrTwoThirdsTechnicalCommittee; + type FastTrackOrigin = EnsureRootOrHalfTechnicalCommittee; /// Unanimous approval of the Technical Committee can have an external proposal tabled immediately /// for a completely custom _voting period length_ vote, and a custom enactment period. type InstantOrigin = EnsureRootOrAllTechnicalCommittee; type InstantAllowed = ConstBool; /// A two third majority of the Council can cancel a passed proposal. Can happen only once per unique proposal. - type CancellationOrigin = EnsureRootOrTwoThirdsMainCouncil; + type CancellationOrigin = EnsureRootOrHalfMainCouncil; /// Only a passed public referendum can permanently blacklist a proposal. type BlacklistOrigin = EnsureRoot; /// An unanimous Technical Committee can cancel a public proposal, slashing the deposit(s). @@ -1415,8 +1415,8 @@ impl pallet_treasury::Config for Runtime { type RuntimeEvent = RuntimeEvent; // Two origins which can either approve or reject the spending proposal - type ApproveOrigin = EnsureRootOrTwoThirdsMainCouncil; - type RejectOrigin = EnsureRootOrTwoThirdsMainCouncil; + type ApproveOrigin = EnsureRootOrHalfMainCouncil; + type RejectOrigin = EnsureRootOrHalfMainCouncil; type OnSlash = Treasury; type ProposalBond = ProposalBond; @@ -1455,8 +1455,8 @@ impl pallet_treasury::Config for Runtime { type RuntimeEvent = RuntimeEvent; // Two origins which can either approve or reject the spending proposal - type ApproveOrigin = EnsureRootOrTwoThirdsCommunityCouncil; - type RejectOrigin = EnsureRootOrTwoThirdsCommunityCouncil; + type ApproveOrigin = EnsureRootOrHalfCommunityCouncil; + type RejectOrigin = EnsureRootOrHalfCommunityCouncil; type OnSlash = CommunityTreasury; type ProposalBond = ProposalBond; @@ -1505,7 +1505,7 @@ impl InstanceFilter for CommunityCouncilCallFilter { impl pallet_collective_proxy::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type CollectiveProxy = EnsureRootOrTwoThirdsCommunityCouncil; + type CollectiveProxy = EnsureRootOrHalfCommunityCouncil; type ProxyAccountId = CommunityTreasuryAccountId; type CallFilter = CommunityCouncilCallFilter; type WeightInfo = pallet_collective_proxy::weights::SubstrateWeight;