srml: babe: add expected block time and epoch duration constants (#3241)

* srml: babe: add expected block time constant

* srml: babe: expose epoch duration constant

* node: bump spec_version

* core: don't use moment type in test-runtime

* babe: add docs regarding c parameter
This commit is contained in:
André Silva
2019-07-30 06:39:33 +01:00
committed by Gavin Wood
parent 20eb52d6bb
commit 483ad60379
5 changed files with 27 additions and 6 deletions
@@ -104,7 +104,10 @@ pub struct BabeConfiguration {
/// A constant value that is used in the threshold calculation formula.
/// Expressed as a fraction where the first member of the tuple is the
/// numerator and the second is the denominator.
/// numerator and the second is the denominator. The fraction should
/// represent a value between 0 and 1.
/// In the threshold formula calculation, `1 - c` represents the probability
/// of a slot being empty.
pub c: (u64, u64),
/// The minimum number of blocks that must be received before running the
+2
View File
@@ -362,10 +362,12 @@ impl srml_timestamp::Trait for Runtime {
parameter_types! {
pub const EpochDuration: u64 = 6;
pub const ExpectedBlockTime: u64 = 10_000;
}
impl srml_babe::Trait for Runtime {
type EpochDuration = EpochDuration;
type ExpectedBlockTime = ExpectedBlockTime;
}
/// Adds one to the given input and returns the final result.