diff --git a/runtimes/common/src/constants.rs b/runtimes/common/src/constants.rs index 9bc7afa2f..f2e1036e6 100644 --- a/runtimes/common/src/constants.rs +++ b/runtimes/common/src/constants.rs @@ -255,10 +255,7 @@ pub mod staking { #[cfg(not(feature = "fast-gov"))] pub const DEFAULT_BLOCKS_PER_ROUND: BlockNumber = 2 * HOURS; - #[cfg(feature = "fast-gov")] - pub const STAKE_DURATION: BlockNumber = 30; - #[cfg(not(feature = "fast-gov"))] - pub const STAKE_DURATION: BlockNumber = 7 * DAYS; + pub const STAKE_DURATION: BlockNumber = 1; #[cfg(feature = "fast-gov")] pub const MIN_COLLATORS: u32 = 4; @@ -289,7 +286,7 @@ pub mod staking { /// Minimum 16 collators selected per round, default at genesis and minimum forever after pub const MinCollators: u32 = MIN_COLLATORS; /// At least 4 candidates which cannot leave the network if there are no other candidates. - pub const MinRequiredCollators: u32 = 4; + pub const MinRequiredCollators: u32 = 0; /// We only allow one delegation per round. pub const MaxDelegationsPerRound: u32 = 1; /// Maximum 25 delegators per collator at launch, might be increased later diff --git a/runtimes/peregrine/src/system/mod.rs b/runtimes/peregrine/src/system/mod.rs index 05320eead..13731b2d0 100644 --- a/runtimes/peregrine/src/system/mod.rs +++ b/runtimes/peregrine/src/system/mod.rs @@ -17,8 +17,8 @@ // If you feel like getting in touch with us, you can do so at use frame_support::{ - parameter_types, - traits::{AsEnsureOriginWithArg, Everything, PrivilegeCmp}, + match_types, parameter_types, + traits::{AsEnsureOriginWithArg, EverythingBut, PrivilegeCmp}, weights::Weight, }; use frame_system::EnsureRoot; @@ -55,6 +55,15 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } +match_types! { + pub type IncreaseStakingCalls: impl Contains = { + RuntimeCall::ParachainStaking(parachain_staking::Call::::join_candidates { .. }) | + RuntimeCall::ParachainStaking(parachain_staking::Call::::join_delegators { .. }) | + RuntimeCall::ParachainStaking(parachain_staking::Call::::delegator_stake_more { .. }) | + RuntimeCall::ParachainStaking(parachain_staking::Call::::candidate_stake_more { .. }) + }; +} + impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; @@ -87,7 +96,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = weights::rocksdb_weights::constants::RocksDbWeight; - type BaseCallFilter = Everything; + type BaseCallFilter = EverythingBut; type SystemWeightInfo = crate::weights::frame_system::WeightInfo; type BlockWeights = BlockWeights; type BlockLength = BlockLength; diff --git a/runtimes/spiritnet/src/system/mod.rs b/runtimes/spiritnet/src/system/mod.rs index 011c867b2..72db53e62 100644 --- a/runtimes/spiritnet/src/system/mod.rs +++ b/runtimes/spiritnet/src/system/mod.rs @@ -17,8 +17,8 @@ // If you feel like getting in touch with us, you can do so at use frame_support::{ - parameter_types, - traits::{AsEnsureOriginWithArg, Everything, PrivilegeCmp}, + match_types, parameter_types, + traits::{AsEnsureOriginWithArg, EverythingBut, PrivilegeCmp}, weights::Weight, }; use frame_system::EnsureRoot; @@ -55,6 +55,15 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; } +match_types! { + pub type IncreaseStakingCalls: impl Contains = { + RuntimeCall::ParachainStaking(parachain_staking::Call::::join_candidates { .. }) | + RuntimeCall::ParachainStaking(parachain_staking::Call::::join_delegators { .. }) | + RuntimeCall::ParachainStaking(parachain_staking::Call::::delegator_stake_more { .. }) | + RuntimeCall::ParachainStaking(parachain_staking::Call::::candidate_stake_more { .. }) + }; +} + impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; @@ -87,7 +96,7 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type DbWeight = weights::rocksdb_weights::constants::RocksDbWeight; - type BaseCallFilter = Everything; + type BaseCallFilter = EverythingBut; type SystemWeightInfo = crate::weights::frame_system::WeightInfo; type BlockWeights = BlockWeights; type BlockLength = BlockLength;