diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 6366e2fa21..d43198eb28 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -260,6 +260,7 @@ pub fn testnet_genesis( .collect(), invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(), slash_reward_fraction: Perbill::from_percent(10), + history_depth: 336, ..Default::default() }), pallet_sudo: Some(SudoConfig { key: root_key }), diff --git a/runtime/src/constants.rs b/runtime/src/constants.rs index b6c32ae829..ac29651144 100644 --- a/runtime/src/constants.rs +++ b/runtime/src/constants.rs @@ -18,6 +18,7 @@ pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000; pub const SLOT_DURATION: Moment = 6000; +pub const BONDING_DURATION: u32 = 24; pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES; pub const EPOCH_DURATION_IN_SLOTS: u64 = { diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2dbd8757d3..adcf7e5b96 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -296,8 +296,8 @@ parameter_types! { parameter_types! { pub const SessionsPerEra: sp_staking::SessionIndex = 6; - pub const BondingDuration: pallet_staking::EraIndex = 24; - pub const SlashDeferDuration: pallet_staking::EraIndex = 6; // 1/4 the bonding duration. + pub const BondingDuration: pallet_staking::EraIndex = BONDING_DURATION; + pub const SlashDeferDuration: pallet_staking::EraIndex = BONDING_DURATION - 1; // 'slightly less' than the bonding duration. pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE; pub const MaxNominatorRewardedPerValidator: u32 = 64; pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;