reduce slash defer durations (#1504)

* reduce slash defer durations

* update comments

* tests
This commit is contained in:
Robert Habermeier
2020-07-30 15:25:21 -04:00
committed by GitHub
parent 652ae86afd
commit 64bf3a1e6e
3 changed files with 47 additions and 8 deletions
+16 -3
View File
@@ -90,7 +90,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 2022,
spec_version: 2023,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
@@ -317,8 +317,8 @@ parameter_types! {
pub const SessionsPerEra: SessionIndex = 6;
// 28 eras for unbonding (7 days).
pub const BondingDuration: staking::EraIndex = 28;
// 28 eras in which slashes can be cancelled (7 days).
pub const SlashDeferDuration: staking::EraIndex = 28;
// 27 eras in which slashes can be cancelled (slightly less than 7 days).
pub const SlashDeferDuration: staking::EraIndex = 27;
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxNominatorRewardedPerValidator: u32 = 64;
// quarter of the last session will be for election.
@@ -1337,3 +1337,16 @@ sp_api::impl_runtime_apis! {
}
}
}
#[cfg(test)]
mod tests {
use super::Runtime;
#[test]
fn slash_defer_less_than_bonding_duration() {
assert!(
<Runtime as staking::Trait>::SlashDeferDuration::get()
< <Runtime as staking::Trait>::BondingDuration::get()
);
}
}