Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Collectives runtime: alliance pallet upgrade introducing new retirement notice feature #1573

Merged
merged 4 commits into from
Aug 29, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions parachains/runtimes/collectives/collectives-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ impl pallet_collator_selection::Config for Runtime {
type WeightInfo = weights::pallet_collator_selection::WeightInfo<Runtime>;
}

parameter_types! {
pub const AllianceMotionDuration: BlockNumber = 5 * DAYS;
pub const ALLIANCE_MOTION_DURATION: BlockNumber = 5 * DAYS;

parameter_types! {
pub const AllianceMotionDuration: BlockNumber = ALLIANCE_MOTION_DURATION;
}
pub const ALLIANCE_MAX_PROPOSALS: u32 = 100;
pub const ALLIANCE_MAX_MEMBERS: u32 = 100;
Expand All @@ -451,6 +452,9 @@ parameter_types! {
// account used to temporarily deposit slashed imbalance before teleporting
pub SlashedImbalanceAccId: AccountId = constants::account::SLASHED_IMBALANCE_ACC_ID.into();
pub RelayTreasuryAccId: AccountId = constants::account::RELAY_TREASURY_PALL_ID.into_account_truncating();
// The number of blocks a member must wait between giving a retirement notice and retiring.
// Supposed to be greater than time required to `kick_member` with alliance motion.
pub const AllianceRetirementPeriod: BlockNumber = (90 * DAYS) + ALLIANCE_MOTION_DURATION;
}

impl pallet_alliance::Config for Runtime {
Expand All @@ -463,6 +467,7 @@ impl pallet_alliance::Config for Runtime {
type Slashed = ToParentTreasury<RelayTreasuryAccId, SlashedImbalanceAccId, Runtime>;
type InitializeMembers = AllianceMotion;
type MembershipChanged = AllianceMotion;
type RetirementPeriod = AllianceRetirementPeriod;
type IdentityVerifier = (); // Don't block accounts on identity criteria
type ProposalProvider = AllianceProposalProvider<Runtime, AllianceCollective>;
type MaxProposals = ConstU32<ALLIANCE_MAX_MEMBERS>;
Expand Down Expand Up @@ -549,8 +554,13 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
Migrations,
>;

// All migrations executed on runtime upgrade as a nested tuple of types implementing `OnRuntimeUpgrade`.
// Included migrations must be idempotent.
type Migrations = (pallet_alliance::migration::Migration<Runtime>,);

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand Down