From fc94fd3faa1dd9aeaeedca00be02e427329379e6 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Fri, 29 Apr 2022 08:10:57 -0400 Subject: [PATCH] Add a few staking params to fast-runtime build --- runtime/kusama/src/lib.rs | 18 +++++++++++++++--- runtime/polkadot/src/lib.rs | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index bd863b427af6..042b2d04562b 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -554,11 +554,23 @@ impl pallet_staking::EraPayout for EraPayout { parameter_types! { // Six sessions in an era (6 hours). - pub const SessionsPerEra: SessionIndex = 6; + pub SessionsPerEra: SessionIndex = prod_or_fast!( + 6, + 6, + "KSM_SESSIONS_PER_ERA" + ); // 28 eras for unbonding (7 days). - pub const BondingDuration: sp_staking::EraIndex = 28; + pub BondingDuration: sp_staking::EraIndex = prod_or_fast!( + 28, + 28, + "DOT_BONDING_DURATION" + ); // 27 eras in which slashes can be cancelled (slightly less than 7 days). - pub const SlashDeferDuration: sp_staking::EraIndex = 27; + pub SlashDeferDuration: sp_staking::EraIndex = prod_or_fast!( + 27, + 27, + "DOT_SLASH_DEFER_DURATION" + ); pub const MaxNominatorRewardedPerValidator: u32 = 256; pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17); // 24 diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 54a31d1d9f90..d6ae017d8e23 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -549,10 +549,22 @@ pallet_staking_reward_curve::build! { parameter_types! { // Six sessions in an era (24 hours). - pub const SessionsPerEra: SessionIndex = 6; + pub SessionsPerEra: SessionIndex = prod_or_fast!( + 6, + 6, + "DOT_SESSIONS_PER_ERA" + ); // 28 eras for unbonding (28 days). - pub const BondingDuration: sp_staking::EraIndex = 28; - pub const SlashDeferDuration: sp_staking::EraIndex = 27; + pub BondingDuration: sp_staking::EraIndex = prod_or_fast!( + 28, + 28, + "DOT_BONDING_DURATION" + ); + pub SlashDeferDuration: sp_staking::EraIndex = prod_or_fast!( + 27, + 27, + "DOT_SLASH_DEFER_DURATION" + ); pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 256; pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);