Add a few staking params to fast-runtime build (#5424)

Co-authored-by: Squirrel <gilescope@gmail.com>
This commit is contained in:
moh-eulith
2022-11-10 08:40:45 -05:00
committed by GitHub
parent 20965b4e64
commit de7acfac5b
2 changed files with 22 additions and 4 deletions
+11 -2
View File
@@ -548,10 +548,19 @@ impl pallet_staking::EraPayout<Balance> for EraPayout {
parameter_types! { parameter_types! {
// Six sessions in an era (6 hours). // Six sessions in an era (6 hours).
pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1); pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);
// 28 eras for unbonding (7 days). // 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). // 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 = 512; pub const MaxNominatorRewardedPerValidator: u32 = 512;
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17); pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
// 24 // 24
+11 -2
View File
@@ -534,9 +534,18 @@ pallet_staking_reward_curve::build! {
parameter_types! { parameter_types! {
// Six sessions in an era (24 hours). // Six sessions in an era (24 hours).
pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1); pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);
// 28 eras for unbonding (28 days). // 28 eras for unbonding (28 days).
pub const BondingDuration: sp_staking::EraIndex = 28; pub BondingDuration: sp_staking::EraIndex = prod_or_fast!(
pub const SlashDeferDuration: sp_staking::EraIndex = 27; 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 RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxNominatorRewardedPerValidator: u32 = 512; pub const MaxNominatorRewardedPerValidator: u32 = 512;
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17); pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);