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

Commit

Permalink
Add a few staking params to fast-runtime build (#5424)
Browse files Browse the repository at this point in the history
Co-authored-by: Squirrel <gilescope@gmail.com>
  • Loading branch information
moh-eulith and gilescope authored Nov 10, 2022
1 parent 3711c6f commit 597b1d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,19 @@ impl pallet_staking::EraPayout<Balance> for EraPayout {
parameter_types! {
// Six sessions in an era (6 hours).
pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);

// 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 = 512;
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
// 24
Expand Down
13 changes: 11 additions & 2 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,18 @@ pallet_staking_reward_curve::build! {
parameter_types! {
// Six sessions in an era (24 hours).
pub const SessionsPerEra: SessionIndex = prod_or_fast!(6, 1);

// 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 = 512;
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
Expand Down

0 comments on commit 597b1d2

Please sign in to comment.