Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
c55af370
Unverified
Commit
c55af370
authored
Apr 12, 2021
by
Joshy Orndorff
Committed by
GitHub
Apr 12, 2021
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
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
runtime/kusama/src/constants.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
:
BlockNumber
=
1
*
HOURS
;
pub
const
EPOCH_DURATION_IN_
S
LO
T
S
:
BlockNumber
=
1
*
HOURS
;
// Mainnet
// Mainnet
// pub const EPOCH_DURATION_IN_
B
LO
CK
S: BlockNumber = 4 * HOURS;
// pub const EPOCH_DURATION_IN_
S
LO
T
S: BlockNumber = 4 * HOURS;
// Testnet
// Testnet
// pub const EPOCH_DURATION_IN_
B
LO
CK
S: BlockNumber = 10 * MINUTES;
// pub const EPOCH_DURATION_IN_
S
LO
T
S: 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
);
...
...
runtime/kusama/src/lib.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
as
u64
;
pub
const
EpochDuration
:
u64
=
EPOCH_DURATION_IN_
S
LO
T
S
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_
B
LO
CK
S
/
4
;
pub
const
UnsignedPhase
:
u32
=
EPOCH_DURATION_IN_
S
LO
T
S
/
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
=
...
...
runtime/polkadot/src/constants.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
:
BlockNumber
=
4
*
HOURS
;
pub
const
EPOCH_DURATION_IN_
S
LO
T
S
:
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
);
...
...
runtime/polkadot/src/lib.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
as
u64
;
pub
const
EpochDuration
:
u64
=
EPOCH_DURATION_IN_
S
LO
T
S
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_
B
LO
CK
S
/
4
;
pub
const
UnsignedPhase
:
u32
=
EPOCH_DURATION_IN_
S
LO
T
S
/
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
=
...
...
runtime/test-runtime/src/constants.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
:
BlockNumber
=
MINUTES
/
2
;
pub
const
EPOCH_DURATION_IN_
S
LO
T
S
:
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
);
...
...
runtime/test-runtime/src/lib.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
as
u64
;
pub
storage
EpochDuration
:
u64
=
EPOCH_DURATION_IN_
S
LO
T
S
as
u64
;
pub
storage
ExpectedBlockTime
:
Moment
=
MILLISECS_PER_BLOCK
;
pub
storage
ExpectedBlockTime
:
Moment
=
MILLISECS_PER_BLOCK
;
}
}
...
...
runtime/westend/src/constants.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
:
BlockNumber
=
1
*
HOURS
;
pub
const
EPOCH_DURATION_IN_
S
LO
T
S
:
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
);
...
...
runtime/westend/src/lib.rs
View file @
c55af370
...
@@ -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_
B
LO
CK
S
as
u64
;
pub
const
EpochDuration
:
u64
=
EPOCH_DURATION_IN_
S
LO
T
S
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_
B
LO
CK
S
/
4
;
pub
const
UnsignedPhase
:
u32
=
EPOCH_DURATION_IN_
S
LO
T
S
/
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
=
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment