OpenGov improvements for Kusama (#6372)

* Tweaks to optimise gov2

* Use new inactive funds

* Introduce migrations

* Fixes

* Fixes

* Fixes

* Some constant updates for Fellowship

* Further tweaks

* Lower floor for whitelisted
This commit is contained in:
Gavin Wood
2022-12-05 16:40:25 +00:00
committed by GitHub
parent e79977e694
commit 053b24ebe5
13 changed files with 134 additions and 57 deletions
@@ -50,7 +50,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -72,7 +72,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -94,7 +94,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -138,7 +138,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -160,7 +160,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -182,7 +182,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -204,7 +204,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -226,7 +226,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -248,7 +248,7 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
prepare_period: 30 * MINUTES,
decision_period: 7 * DAYS,
confirm_period: 30 * MINUTES,
min_enactment_period: 4,
min_enactment_period: 1 * MINUTES,
min_approval: pallet_referenda::Curve::LinearDecreasing {
length: Perbill::from_percent(100),
floor: Perbill::from_percent(50),
@@ -47,7 +47,8 @@ impl pallet_conviction_voting::Config for Runtime {
type Currency = Balances;
type VoteLockingPeriod = VoteLockingPeriod;
type MaxVotes = ConstU32<512>;
type MaxTurnout = frame_support::traits::TotalIssuanceOf<Balances, Self::AccountId>;
type MaxTurnout =
frame_support::traits::tokens::currency::ActiveIssuanceOf<Balances, Self::AccountId>;
type Polls = Referenda;
}
@@ -174,6 +174,7 @@ pub mod pallet_custom_origins {
SmallSpender = 10 * GRAND,
MediumSpender = 100 * GRAND,
BigSpender = 1_000 * GRAND,
Treasurer = 10_000 * GRAND,
}
}
@@ -63,7 +63,7 @@ const SUP_BIG_SPENDER: Curve = Curve::make_reciprocal(20, 28, percent(1), percen
const APP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(16, 28 * 24, percent(96), percent(50), percent(100));
const SUP_WHITELISTED_CALLER: Curve =
Curve::make_reciprocal(1, 28, percent(20), percent(10), percent(50));
Curve::make_reciprocal(1, 28, percent(20), percent(5), percent(50));
const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15] = [
(
@@ -71,9 +71,9 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
pallet_referenda::TrackInfo {
name: "root",
max_deciding: 1,
decision_deposit: 1_000 * GRAND,
prepare_period: 3 * HOURS,
decision_period: 28 * DAYS,
decision_deposit: 100 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 3 * HOURS,
min_approval: APP_ROOT,
@@ -84,10 +84,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
1,
pallet_referenda::TrackInfo {
name: "whitelisted_caller",
max_deciding: 10,
decision_deposit: 10_000 * GRAND,
prepare_period: 3 * HOURS,
decision_period: 28 * DAYS,
max_deciding: 30,
decision_deposit: 100 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 10 * MINUTES,
min_enactment_period: 30 * MINUTES,
min_approval: APP_WHITELISTED_CALLER,
@@ -100,8 +100,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "staking_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_STAKING_ADMIN,
@@ -114,8 +114,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "treasurer",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_TREASURER,
@@ -128,8 +128,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "lease_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_LEASE_ADMIN,
@@ -142,8 +142,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "fellowship_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_FELLOWSHIP_ADMIN,
@@ -156,8 +156,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "general_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_GENERAL_ADMIN,
@@ -170,8 +170,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "auction_admin",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_AUCTION_ADMIN,
@@ -184,8 +184,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "referendum_canceller",
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 7 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 10 * MINUTES,
min_approval: APP_REFERENDUM_CANCELLER,
@@ -198,8 +198,8 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "referendum_killer",
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 10 * MINUTES,
min_approval: APP_REFERENDUM_KILLER,
@@ -212,10 +212,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "small_tipper",
max_deciding: 200,
decision_deposit: 5 * QUID,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 7 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 28 * DAYS,
min_enactment_period: 24 * HOURS,
min_approval: APP_SMALL_TIPPER,
min_support: SUP_SMALL_TIPPER,
},
@@ -226,10 +226,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "big_tipper",
max_deciding: 100,
decision_deposit: 50 * QUID,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 7 * DAYS,
confirm_period: 6 * HOURS,
min_enactment_period: 28 * DAYS,
min_enactment_period: 24 * HOURS,
min_approval: APP_BIG_TIPPER,
min_support: SUP_BIG_TIPPER,
},
@@ -240,10 +240,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "small_spender",
max_deciding: 50,
decision_deposit: 500 * QUID,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 12 * HOURS,
min_enactment_period: 28 * DAYS,
min_enactment_period: 24 * HOURS,
min_approval: APP_SMALL_SPENDER,
min_support: SUP_SMALL_SPENDER,
},
@@ -254,10 +254,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "medium_spender",
max_deciding: 20,
decision_deposit: 1_500 * QUID,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 24 * HOURS,
min_enactment_period: 28 * DAYS,
min_enactment_period: 24 * HOURS,
min_approval: APP_MEDIUM_SPENDER,
min_support: SUP_MEDIUM_SPENDER,
},
@@ -268,10 +268,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
name: "big_spender",
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4,
decision_period: 28 * DAYS,
prepare_period: 4 * HOURS,
decision_period: 14 * DAYS,
confirm_period: 48 * HOURS,
min_enactment_period: 28 * DAYS,
min_enactment_period: 24 * HOURS,
min_approval: APP_BIG_SPENDER,
min_support: SUP_BIG_SPENDER,
},
+8 -2
View File
@@ -109,6 +109,7 @@ use governance::{
old::CouncilCollective, pallet_custom_origins, AuctionAdmin, GeneralAdmin, LeaseAdmin,
StakingAdmin, Treasurer, TreasurySpender,
};
use xcm_config::CheckAccount;
#[cfg(test)]
mod tests;
@@ -1480,6 +1481,11 @@ impl Get<&'static str> for StakingMigrationV11OldPallet {
}
}
pub type Migrations = (
pallet_balances::migration::MigrateToTrackInactive<Runtime, CheckAccount>,
crowdloan::migration::MigrateToTrackInactive<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
@@ -1490,7 +1496,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(),
Migrations,
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
@@ -2071,7 +2077,7 @@ mod tests_fess {
// ensure this number does not change, or that it is checked after each change.
// a 1 MB solution should need around 0.16 KSM deposit
let deposit = SignedDepositBase::get() + (SignedDepositByte::get() * 1024 * 1024);
assert_eq_error_rate!(deposit, UNITS * 16 / 100, UNITS / 100);
assert_eq_error_rate!(deposit, UNITS * 167 / 100, UNITS / 100);
}
}