Browse Source

change parameters, and fix tests

bwhm 4 years ago
parent
commit
832fa90ae4

+ 1 - 1
Cargo.lock

@@ -2053,7 +2053,7 @@ dependencies = [
 
 [[package]]
 name = "joystream-node-runtime"
-version = "7.9.0"
+version = "7.11.0"
 dependencies = [
  "frame-benchmarking",
  "frame-executive",

+ 4 - 4
pioneer/packages/joy-proposals/src/validationSchema.ts

@@ -32,8 +32,8 @@ const RATIONALE_MAX_LENGTH = 3000;
 const FILE_SIZE_BYTES_MIN = 1;
 
 // Set Election Parameters
-const ANNOUNCING_PERIOD_MAX = 43200;
 const ANNOUNCING_PERIOD_MIN = 14400;
+const ANNOUNCING_PERIOD_MAX = 43200;
 const VOTING_PERIOD_MIN = 14400;
 const VOTING_PERIOD_MAX = 28800;
 const REVEALING_PERIOD_MIN = 14400;
@@ -42,10 +42,10 @@ const MIN_COUNCIL_STAKE_MIN = 1;
 const MIN_COUNCIL_STAKE_MAX = 100000;
 const NEW_TERM_DURATION_MIN = 14400;
 const NEW_TERM_DURATION_MAX = 432000;
-const CANDIDACY_LIMIT_MIN = 25;
+const CANDIDACY_LIMIT_MIN = 50;
 const CANDIDACY_LIMIT_MAX = 100;
-const COUNCIL_SIZE_MAX = 20;
 const COUNCIL_SIZE_MIN = 4;
+const COUNCIL_SIZE_MAX = 40;
 const MIN_VOTING_STAKE_MIN = 1;
 const MIN_VOTING_STAKE_MAX = 100000;
 
@@ -55,7 +55,7 @@ const TOKENS_MAX = 5000000;
 
 // Set Validator Count
 const MAX_VALIDATOR_COUNT_MIN = 4;
-const MAX_VALIDATOR_COUNT_MAX = 100;
+const MAX_VALIDATOR_COUNT_MAX = 300;
 
 // Add Working Group Leader Opening Parameters
 // TODO: Discuss the actual values

+ 3 - 3
runtime-modules/proposals/codex/src/lib.rs

@@ -85,13 +85,13 @@ const WORKING_GROUP_MINT_CAPACITY_MAX_VALUE: u32 = 5_000_000;
 // Max allowed value for 'spending' proposal
 const MAX_SPENDING_PROPOSAL_VALUE: u32 = 5_000_000_u32;
 // Max validator count for the 'set validator count' proposal
-const MAX_VALIDATOR_COUNT: u32 = 100;
+const MAX_VALIDATOR_COUNT: u32 = 300;
 // council_size min value for the 'set election parameters' proposal
 const ELECTION_PARAMETERS_COUNCIL_SIZE_MIN_VALUE: u32 = 4;
 // council_size max value for the 'set election parameters' proposal
-const ELECTION_PARAMETERS_COUNCIL_SIZE_MAX_VALUE: u32 = 20;
+const ELECTION_PARAMETERS_COUNCIL_SIZE_MAX_VALUE: u32 = 40;
 // candidacy_limit min value for the 'set election parameters' proposal
-const ELECTION_PARAMETERS_CANDIDACY_LIMIT_MIN_VALUE: u32 = 25;
+const ELECTION_PARAMETERS_CANDIDACY_LIMIT_MIN_VALUE: u32 = 50;
 // candidacy_limit max value for the 'set election parameters' proposal
 const ELECTION_PARAMETERS_CANDIDACY_LIMIT_MAX_VALUE: u32 = 100;
 // min_voting_stake min value for the 'set election parameters' proposal

+ 1 - 1
runtime-modules/proposals/codex/src/proposal_types/mod.rs

@@ -317,7 +317,7 @@ impl Default for ProposalsConfigParameters {
             set_validator_count_proposal_voting_period: 43200u32,
             set_validator_count_proposal_grace_period: 0u32,
             runtime_upgrade_proposal_voting_period: 72000u32,
-            runtime_upgrade_proposal_grace_period: 72000u32,
+            runtime_upgrade_proposal_grace_period: 28800u32,
             text_proposal_voting_period: 72000u32,
             text_proposal_grace_period: 0u32,
             set_election_parameters_proposal_voting_period: 72000u32,

+ 3 - 3
runtime-modules/proposals/codex/src/proposal_types/parameters.rs

@@ -10,7 +10,7 @@ pub(crate) fn set_validator_count_proposal<T: crate::Trait>(
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(<BalanceOf<T>>::from(100_000_u32)),
+        required_stake: Some(<BalanceOf<T>>::from(500_000_u32)),
     }
 }
 
@@ -24,7 +24,7 @@ pub(crate) fn runtime_upgrade_proposal<T: crate::Trait>(
         approval_threshold_percentage: 100,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(<BalanceOf<T>>::from(1_000_000_u32)),
+        required_stake: Some(<BalanceOf<T>>::from(5_000_000_u32)),
     }
 }
 
@@ -51,7 +51,7 @@ pub(crate) fn set_election_parameters_proposal<T: crate::Trait>(
         approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(<BalanceOf<T>>::from(200_000_u32)),
+        required_stake: Some(<BalanceOf<T>>::from(1_000_000_u32)),
     }
 }
 

+ 9 - 9
runtime-modules/proposals/codex/src/tests/mod.rs

@@ -187,7 +187,7 @@ fn create_text_proposal_codex_call_fails_with_incorrect_text_size() {
 #[test]
 fn create_runtime_upgrade_common_checks_succeed() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 5000000);
+        increase_total_balance_issuance_using_account_id(1, 10000000);
 
         let proposal_fixture = ProposalTestFixture {
             insufficient_rights_call: || {
@@ -226,7 +226,7 @@ fn create_runtime_upgrade_common_checks_succeed() {
                     1,
                     b"title".to_vec(),
                     b"body".to_vec(),
-                    Some(<BalanceOf<Test>>::from(1_000_000_u32)),
+                    Some(<BalanceOf<Test>>::from(5_000_000_u32)),
                     b"wasm".to_vec(),
                 )
             },
@@ -272,7 +272,7 @@ fn create_upgrade_runtime_proposal_codex_call_fails_with_incorrect_wasm_size() {
 #[test]
 fn create_set_election_parameters_proposal_common_checks_succeed() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 500000);
+        increase_total_balance_issuance_using_account_id(1, 2000000);
 
         let proposal_fixture = ProposalTestFixture {
             insufficient_rights_call: || {
@@ -311,7 +311,7 @@ fn create_set_election_parameters_proposal_common_checks_succeed() {
                     1,
                     b"title".to_vec(),
                     b"body".to_vec(),
-                    Some(<BalanceOf<Test>>::from(200_000_u32)),
+                    Some(<BalanceOf<Test>>::from(1_000_000_u32)),
                     get_valid_election_parameters(),
                 )
             },
@@ -348,7 +348,7 @@ fn get_valid_election_parameters() -> ElectionParameters<u64, u64> {
         voting_period: 14400,
         revealing_period: 14400,
         council_size: 4,
-        candidacy_limit: 25,
+        candidacy_limit: 50,
         new_term_duration: 14400,
         min_council_stake: 1,
         min_voting_stake: 1,
@@ -358,7 +358,7 @@ fn get_valid_election_parameters() -> ElectionParameters<u64, u64> {
 #[test]
 fn create_set_election_parameters_call_fails_with_incorrect_parameters() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 500000);
+        increase_total_balance_issuance_using_account_id(1, 1500000);
 
         let mut election_parameters = get_valid_election_parameters();
         election_parameters.council_size = 2;
@@ -367,7 +367,7 @@ fn create_set_election_parameters_call_fails_with_incorrect_parameters() {
             Error::<Test>::InvalidCouncilElectionParameterCouncilSize.into(),
         );
 
-        election_parameters.council_size = 21;
+        election_parameters.council_size = 41;
         assert_failed_election_parameters_call(
             election_parameters,
             Error::<Test>::InvalidCouncilElectionParameterCouncilSize.into(),
@@ -566,7 +566,7 @@ fn create_spending_proposal_call_fails_with_incorrect_balance() {
 #[test]
 fn create_set_validator_count_proposal_common_checks_succeed() {
     initial_test_ext().execute_with(|| {
-        increase_total_balance_issuance_using_account_id(1, 500000);
+        increase_total_balance_issuance_using_account_id(1, 1000000);
 
         let proposal_fixture = ProposalTestFixture {
             insufficient_rights_call: || {
@@ -605,7 +605,7 @@ fn create_set_validator_count_proposal_common_checks_succeed() {
                     1,
                     b"title".to_vec(),
                     b"body".to_vec(),
-                    Some(<BalanceOf<Test>>::from(100_000_u32)),
+                    Some(<BalanceOf<Test>>::from(500_000_u32)),
                     4,
                 )
             },

+ 1 - 1
runtime/Cargo.toml

@@ -4,7 +4,7 @@ edition = '2018'
 name = 'joystream-node-runtime'
 # Follow convention: https://github.com/Joystream/substrate-runtime-joystream/issues/1
 # {Authoring}.{Spec}.{Impl} of the RuntimeVersion
-version = '7.9.0'
+version = '7.11.0'
 
 [dependencies]
 # Third-party dependencies

+ 1 - 1
runtime/src/constants.rs

@@ -18,7 +18,7 @@ pub const MILLISECS_PER_BLOCK: Moment = 6000;
 pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000;
 
 pub const SLOT_DURATION: Moment = 6000;
-pub const BONDING_DURATION: u32 = 24;
+pub const BONDING_DURATION: u32 = 24 * 7;
 
 pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES;
 pub const EPOCH_DURATION_IN_SLOTS: u64 = {

+ 2 - 2
runtime/src/lib.rs

@@ -75,7 +75,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
     spec_name: create_runtime_str!("joystream-node"),
     impl_name: create_runtime_str!("joystream-node"),
     authoring_version: 7,
-    spec_version: 9,
+    spec_version: 11,
     impl_version: 0,
     apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS,
     transaction_version: 1,
@@ -553,7 +553,7 @@ parameter_types! {
     pub const ProposalRejectionFee: u64 = 5000;
     pub const ProposalTitleMaxLength: u32 = 40;
     pub const ProposalDescriptionMaxLength: u32 = 3000;
-    pub const ProposalMaxActiveProposalLimit: u32 = 5;
+    pub const ProposalMaxActiveProposalLimit: u32 = 12;
 }
 
 impl proposals_engine::Trait for Runtime {

+ 4 - 4
runtime/src/tests/proposals_integration/mod.rs

@@ -507,7 +507,7 @@ where
             setup_members(15);
             setup_council();
 
-            increase_total_balance_issuance_using_account_id(account_id.clone().into(), 500000);
+            increase_total_balance_issuance_using_account_id(account_id.clone().into(), 1000000);
         }
 
         assert_eq!((self.successful_call)(), Ok(()));
@@ -610,7 +610,7 @@ fn set_election_parameters_proposal_execution_succeeds() {
             voting_period: 14400,
             revealing_period: 14400,
             council_size: 4,
-            candidacy_limit: 25,
+            candidacy_limit: 50,
             new_term_duration: 14400,
             min_council_stake: 1,
             min_voting_stake: 1,
@@ -623,7 +623,7 @@ fn set_election_parameters_proposal_execution_succeeds() {
                 member_id as u64,
                 b"title".to_vec(),
                 b"body".to_vec(),
-                Some(<BalanceOf<Runtime>>::from(200_000_u32)),
+                Some(<BalanceOf<Runtime>>::from(1_000_000_u32)),
                 election_parameters,
             )
         });
@@ -648,7 +648,7 @@ fn set_validator_count_proposal_execution_succeeds() {
                 member_id as u64,
                 b"title".to_vec(),
                 b"body".to_vec(),
-                Some(<BalanceOf<Runtime>>::from(100_000_u32)),
+                Some(<BalanceOf<Runtime>>::from(500_000_u32)),
                 new_validator_count,
             )
         });

+ 4 - 0
testnets/joy-testnet-4.json

@@ -12,6 +12,10 @@
     [
       "/dns/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F",
       0
+    ],
+    [
+      "/dns/telemetry.joystream.org/tcp/443/x-parity-wss/%2Fsubmit%2F",
+      0
     ]
   ],
   "protocolId": "/joy/testnet/4",