Unverified Commit c55af370 authored by Joshy Orndorff's avatar Joshy Orndorff Committed by GitHub
Browse files

rename EPOCH_DURATION_IN_BLOCKS -> EPOCH_DURATION_IN_SLOTS (#2674)

parent 31acae0e
Pipeline #134149 failed with stages
in 18 minutes and 1 second
...@@ -37,11 +37,11 @@ pub mod time { ...@@ -37,11 +37,11 @@ pub mod time {
// pub const MILLISECS_PER_BLOCK: Moment = 1000; // pub const MILLISECS_PER_BLOCK: Moment = 1000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
// Kusama // Kusama
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 1 * HOURS; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 1 * HOURS;
// Mainnet // Mainnet
// pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 4 * HOURS; // pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 4 * HOURS;
// Testnet // Testnet
// pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES; // pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 10 * MINUTES;
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
......
...@@ -180,7 +180,7 @@ impl pallet_scheduler::Config for Runtime { ...@@ -180,7 +180,7 @@ impl pallet_scheduler::Config for Runtime {
} }
parameter_types! { parameter_types! {
pub const EpochDuration: u64 = EPOCH_DURATION_IN_BLOCKS as u64; pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
pub const ReportLongevity: u64 = pub const ReportLongevity: u64 =
BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get();
...@@ -311,7 +311,7 @@ impl pallet_session::historical::Config for Runtime { ...@@ -311,7 +311,7 @@ impl pallet_session::historical::Config for Runtime {
parameter_types! { parameter_types! {
// no signed phase for now, just unsigned. // no signed phase for now, just unsigned.
pub const SignedPhase: u32 = 0; pub const SignedPhase: u32 = 0;
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;
// fallback: run election on-chain. // fallback: run election on-chain.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
......
...@@ -33,7 +33,7 @@ pub mod time { ...@@ -33,7 +33,7 @@ pub mod time {
use primitives::v0::{Moment, BlockNumber}; use primitives::v0::{Moment, BlockNumber};
pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 4 * HOURS; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 4 * HOURS;
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
......
...@@ -194,7 +194,7 @@ impl pallet_scheduler::Config for Runtime { ...@@ -194,7 +194,7 @@ impl pallet_scheduler::Config for Runtime {
} }
parameter_types! { parameter_types! {
pub const EpochDuration: u64 = EPOCH_DURATION_IN_BLOCKS as u64; pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
pub const ReportLongevity: u64 = pub const ReportLongevity: u64 =
BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get();
...@@ -321,7 +321,7 @@ impl pallet_session::historical::Config for Runtime { ...@@ -321,7 +321,7 @@ impl pallet_session::historical::Config for Runtime {
parameter_types! { parameter_types! {
// no signed phase for now, just unsigned. // no signed phase for now, just unsigned.
pub const SignedPhase: u32 = 0; pub const SignedPhase: u32 = 0;
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;
// fallback: run election on-chain. // fallback: run election on-chain.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
......
...@@ -31,7 +31,7 @@ pub mod time { ...@@ -31,7 +31,7 @@ pub mod time {
pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
// 30 seconds for now // 30 seconds for now
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = MINUTES / 2; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = MINUTES / 2;
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
......
...@@ -162,7 +162,7 @@ impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where ...@@ -162,7 +162,7 @@ impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
} }
parameter_types! { parameter_types! {
pub storage EpochDuration: u64 = EPOCH_DURATION_IN_BLOCKS as u64; pub storage EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
pub storage ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; pub storage ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
} }
......
...@@ -33,7 +33,7 @@ pub mod time { ...@@ -33,7 +33,7 @@ pub mod time {
use primitives::v0::{Moment, BlockNumber}; use primitives::v0::{Moment, BlockNumber};
pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 1 * HOURS; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 1 * HOURS;
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
......
...@@ -172,7 +172,7 @@ impl pallet_scheduler::Config for Runtime { ...@@ -172,7 +172,7 @@ impl pallet_scheduler::Config for Runtime {
} }
parameter_types! { parameter_types! {
pub const EpochDuration: u64 = EPOCH_DURATION_IN_BLOCKS as u64; pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64;
pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
pub const ReportLongevity: u64 = pub const ReportLongevity: u64 =
BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get();
...@@ -337,7 +337,7 @@ impl pallet_session::historical::Config for Runtime { ...@@ -337,7 +337,7 @@ impl pallet_session::historical::Config for Runtime {
parameter_types! { parameter_types! {
// no signed phase for now, just unsigned. // no signed phase for now, just unsigned.
pub const SignedPhase: u32 = 0; pub const SignedPhase: u32 = 0;
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;
// fallback: run election on-chain. // fallback: run election on-chain.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment