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

OpenGov improvements for Kusama #6372

Merged
merged 12 commits into from
Dec 5, 2022
Prev Previous commit
Next Next commit
Further tweaks
  • Loading branch information
gavofyork committed Dec 4, 2022
commit 49c016940ccd42a8c9bc255eb7aec25f26c1776a
4 changes: 2 additions & 2 deletions runtime/kusama/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub mod currency {
pub const EXISTENTIAL_DEPOSIT: Balance = 1 * CENTS;

pub const UNITS: Balance = 1_000_000_000_000;
pub const CENTS: Balance = UNITS / 30_000;
pub const QUID: Balance = CENTS * 100;
pub const QUID: Balance = UNITS / 30;
pub const CENTS: Balance = QUID / 100;
gavofyork marked this conversation as resolved.
Show resolved Hide resolved
pub const GRAND: Balance = QUID * 1_000;
pub const MILLICENTS: Balance = CENTS / 1_000;

Expand Down
32 changes: 16 additions & 16 deletions runtime/kusama/src/governance/tracks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 1,
decision_deposit: 100 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 3 * HOURS,
min_approval: APP_ROOT,
Expand All @@ -84,10 +84,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
1,
pallet_referenda::TrackInfo {
name: "whitelisted_caller",
max_deciding: 10,
max_deciding: 30,
decision_deposit: 100 * GRAND,
Copy link
Contributor

@brenzi brenzi Dec 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this. But doesn't this setup now mean that one can maliciously jam this track with just 10*100 GRAND, which is only 3.33k KSM. Or is there a "decision gate" requiring the whitlelisting to be done to enter deciding?
Why not set max_deciding to 1000? Thanks to the fellowship we can always filter referenda on this track by whitelisting status

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root track would have the same issue then. I wonder if the better option is to set the Root track to a high decision deposit and also allow the WhitelistOrigin to remove proposals from the WhitelistedCaller track, essentially saying "we're not going to Whitelist this call so there's no need for a Whitelist track referendum".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated QUID and increased the max_deciding so this is now 100 kKSM to jam it. With ReferendumKiller origin, we can remove spam and slash the spammer's deposits.

prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 10 * MINUTES,
min_enactment_period: 30 * MINUTES,
min_approval: APP_WHITELISTED_CALLER,
Expand All @@ -101,7 +101,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder why min_enactment_period of the staking admin track would be less than of the root?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root is hugely dangerous, so we're being a bit more conservative on the enactment time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expressed it wrong, the root min_enactment_period less than staking_admin now.
root 3 hours vs staking_admin 2 days

min_approval: APP_STAKING_ADMIN,
Expand All @@ -115,7 +115,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_TREASURER,
Expand All @@ -129,7 +129,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_LEASE_ADMIN,
Expand All @@ -143,7 +143,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_FELLOWSHIP_ADMIN,
Expand All @@ -157,7 +157,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_GENERAL_ADMIN,
Expand All @@ -171,7 +171,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 2 * DAYS,
min_approval: APP_AUCTION_ADMIN,
Expand All @@ -185,7 +185,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 7 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 10 * MINUTES,
min_approval: APP_REFERENDUM_CANCELLER,
Expand All @@ -199,7 +199,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 1_000,
decision_deposit: 50 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 10 * MINUTES,
min_approval: APP_REFERENDUM_KILLER,
Expand All @@ -213,7 +213,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 200,
decision_deposit: 5 * QUID,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 7 * DAYS,
confirm_period: 3 * HOURS,
min_enactment_period: 24 * HOURS,
min_approval: APP_SMALL_TIPPER,
Expand All @@ -227,7 +227,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 100,
decision_deposit: 50 * QUID,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 7 * DAYS,
confirm_period: 6 * HOURS,
min_enactment_period: 24 * HOURS,
min_approval: APP_BIG_TIPPER,
Expand All @@ -241,7 +241,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 50,
decision_deposit: 500 * QUID,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 12 * HOURS,
min_enactment_period: 24 * HOURS,
min_approval: APP_SMALL_SPENDER,
Expand All @@ -255,7 +255,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 20,
decision_deposit: 1_500 * QUID,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 24 * HOURS,
min_enactment_period: 24 * HOURS,
min_approval: APP_MEDIUM_SPENDER,
Expand All @@ -269,7 +269,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo<Balance, BlockNumber>); 15
max_deciding: 10,
decision_deposit: 5 * GRAND,
prepare_period: 4 * HOURS,
decision_period: 28 * DAYS,
decision_period: 14 * DAYS,
confirm_period: 48 * HOURS,
min_enactment_period: 24 * HOURS,
min_approval: APP_BIG_SPENDER,
Expand Down