Browse Source

runtime config: defaults for staging council, referendum, proposal params

Mokhtar Naamani 3 years ago
parent
commit
c421ff8498
2 changed files with 57 additions and 56 deletions
  1. 5 5
      runtime/src/lib.rs
  2. 52 51
      runtime/src/proposals_configuration/defaults.rs

+ 5 - 5
runtime/src/lib.rs

@@ -507,15 +507,15 @@ pub type CouncilModule = council::Module<Runtime>;
 parameter_types! {
     // referendum parameters
     pub const MaxSaltLength: u64 = 32;
-    pub const VoteStageDuration: BlockNumber = 5;
-    pub const RevealStageDuration: BlockNumber = 7;
+    pub const VoteStageDuration: BlockNumber = 100;
+    pub const RevealStageDuration: BlockNumber = 50;
     pub const MinimumVotingStake: u64 = 10000;
 
     // council parameteres
     pub const MinNumberOfExtraCandidates: u64 = 1;
-    pub const AnnouncingPeriodDuration: BlockNumber = 15;
-    pub const IdlePeriodDuration: BlockNumber = 27;
-    pub const CouncilSize: u64 = 3;
+    pub const AnnouncingPeriodDuration: BlockNumber = 200;
+    pub const IdlePeriodDuration: BlockNumber = 400;
+    pub const CouncilSize: u64 = 5;
     pub const MinCandidateStake: u64 = 11000;
     pub const ElectedMemberRewardPeriod: BlockNumber = 10;
     pub const DefaultBudgetIncrement: u64 = 1000;

+ 52 - 51
runtime/src/proposals_configuration/defaults.rs

@@ -5,7 +5,7 @@ use crate::{Balance, BlockNumber, ProposalParameters};
 // Proposal parameters for the 'Set Max Validator Count' proposal
 pub(crate) fn set_max_validator_count_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 66,
         approval_threshold_percentage: 80,
@@ -19,8 +19,8 @@ pub(crate) fn set_max_validator_count_proposal() -> ProposalParameters<BlockNumb
 // Proposal parameters for the 'Runtime Upgrade' proposal
 pub(crate) fn runtime_upgrade_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 72000,
+        voting_period: 200,
+        grace_period: 200,
         approval_quorum_percentage: 80,
         approval_threshold_percentage: 100,
         slashing_quorum_percentage: 60,
@@ -33,13 +33,13 @@ pub(crate) fn runtime_upgrade_proposal() -> ProposalParameters<BlockNumber, Bala
 // Proposal parameters for the 'Signal' proposal
 pub(crate) fn signal_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(25000),
+        required_stake: Some(25_000),
         constitutionality: 1,
     }
 }
@@ -47,13 +47,13 @@ pub(crate) fn signal_proposal() -> ProposalParameters<BlockNumber, Balance> {
 // Proposal parameters for the 'Funding Request' proposal
 pub(crate) fn funding_request_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(25000),
+        required_stake: Some(25_000),
         constitutionality: 1,
     }
 }
@@ -61,7 +61,7 @@ pub(crate) fn funding_request_proposal() -> ProposalParameters<BlockNumber, Bala
 pub(crate) fn create_working_group_lead_opening_proposal(
 ) -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
@@ -76,13 +76,13 @@ pub(crate) fn create_working_group_lead_opening_proposal(
 pub(crate) fn fill_working_group_lead_opening_proposal() -> ProposalParameters<BlockNumber, Balance>
 {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -90,13 +90,13 @@ pub(crate) fn fill_working_group_lead_opening_proposal() -> ProposalParameters<B
 // Proposal parameters for the 'Update Working Group Budget' proposal
 pub(crate) fn update_working_group_budget_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -105,13 +105,13 @@ pub(crate) fn update_working_group_budget_proposal() -> ProposalParameters<Block
 pub(crate) fn decrease_working_group_lead_stake_proposal(
 ) -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -119,13 +119,13 @@ pub(crate) fn decrease_working_group_lead_stake_proposal(
 // Proposal parameters for the 'Slash Working Group Lead' proposal
 pub fn slash_working_group_lead_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -133,13 +133,13 @@ pub fn slash_working_group_lead_proposal() -> ProposalParameters<BlockNumber, Ba
 // Proposal parameters for the 'Set Working Group Lead Reward' proposal
 pub(crate) fn set_working_group_lead_reward_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -147,7 +147,7 @@ pub(crate) fn set_working_group_lead_reward_proposal() -> ProposalParameters<Blo
 // Proposal parameters for the 'Terminate Working Group Lead' proposal
 pub(crate) fn terminate_working_group_lead_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 66,
         approval_threshold_percentage: 80,
@@ -161,14 +161,14 @@ pub(crate) fn terminate_working_group_lead_proposal() -> ProposalParameters<Bloc
 // Proposal parameters for the 'Amend Constitution' proposal
 pub(crate) fn amend_constitution_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72200,
-        grace_period: 72200,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 80,
         approval_threshold_percentage: 100,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
         required_stake: Some(1_000_000),
-        constitutionality: 1,
+        constitutionality: 2,
     }
 }
 
@@ -176,13 +176,13 @@ pub(crate) fn amend_constitution_proposal() -> ProposalParameters<BlockNumber, B
 pub(crate) fn cancel_working_group_lead_opening_proposal(
 ) -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -190,13 +190,13 @@ pub(crate) fn cancel_working_group_lead_opening_proposal(
 // Proposal parameters for the 'Set Membership Price' proposal
 pub(crate) fn set_membership_price_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50000),
+        required_stake: Some(50_000),
         constitutionality: 1,
     }
 }
@@ -204,8 +204,8 @@ pub(crate) fn set_membership_price_proposal() -> ProposalParameters<BlockNumber,
 // Proposal parameters for the 'Set Council Budget Increment' proposal
 pub(crate) fn set_council_budget_increment_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 43200,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 66,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
@@ -218,14 +218,14 @@ pub(crate) fn set_council_budget_increment_proposal() -> ProposalParameters<Bloc
 // Proposal parameters for the 'Set Councilor Reward' proposal
 pub(crate) fn set_councilor_reward_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
+        voting_period: 200,
         grace_period: 201600, // A council term
         approval_quorum_percentage: 66,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
         required_stake: Some(200_000),
-        constitutionality: 1,
+        constitutionality: 2,
     }
 }
 
@@ -233,8 +233,8 @@ pub(crate) fn set_councilor_reward_proposal() -> ProposalParameters<BlockNumber,
 pub(crate) fn set_initial_invitation_balance_proposal() -> ProposalParameters<BlockNumber, Balance>
 {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 43200,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
@@ -263,8 +263,8 @@ pub(crate) fn set_membership_lead_invitation_quota_proposal(
 // Proposal parameters for the 'Set Referral Cut' proposal
 pub(crate) fn set_referral_cut_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 43200,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
@@ -277,8 +277,8 @@ pub(crate) fn set_referral_cut_proposal() -> ProposalParameters<BlockNumber, Bal
 // Proposal parameters for the 'Set Initial Invitation Count' proposal
 pub(crate) fn set_invitation_count_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 43200,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 75,
         slashing_quorum_percentage: 60,
@@ -291,13 +291,13 @@ pub(crate) fn set_invitation_count_proposal() -> ProposalParameters<BlockNumber,
 // Proposal parameters for the 'Create Blog Post' proposal
 pub(crate) fn create_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(25000),
+        required_stake: Some(25_000),
         constitutionality: 1,
     }
 }
@@ -305,13 +305,13 @@ pub(crate) fn create_blog_post_proposal() -> ProposalParameters<BlockNumber, Bal
 // Proposal parameters for the 'Edit Blog Post' proposal
 pub(crate) fn edit_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(25000),
+        required_stake: Some(25_000),
         constitutionality: 1,
     }
 }
@@ -319,13 +319,13 @@ pub(crate) fn edit_blog_post_proposal() -> ProposalParameters<BlockNumber, Balan
 // Proposal parameters for the 'Lock Blog Post' proposal
 pub(crate) fn lock_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(25000),
+        required_stake: Some(25_000),
         constitutionality: 1,
     }
 }
@@ -333,13 +333,13 @@ pub(crate) fn lock_blog_post_proposal() -> ProposalParameters<BlockNumber, Balan
 // Proposal parameters for the 'Unlock Blog Post' proposal
 pub(crate) fn unlock_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72000,
-        grace_period: 14400,
+        voting_period: 200,
+        grace_period: 100,
         approval_quorum_percentage: 60,
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(25000),
+        required_stake: Some(25_000),
         constitutionality: 1,
     }
 }
@@ -347,7 +347,8 @@ pub(crate) fn unlock_blog_post_proposal() -> ProposalParameters<BlockNumber, Bal
 // Proposal parameters for the 'Veto Proposal' proposal
 pub(crate) fn veto_proposal_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
-        voting_period: 72200, // The longest grace period
+        // Doesn't make sense to be longer than longest grace period of all other proposals?
+        voting_period: 200,
         grace_period: 0,
         approval_quorum_percentage: 75,
         approval_threshold_percentage: 80,