Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

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

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,23 @@ impl pallet_staking::EraPayout<Balance> 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
Expand Down
18 changes: 15 additions & 3 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down