Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
4566ff6b
Unverified
Commit
4566ff6b
authored
Jul 30, 2020
by
asynchronous rob
Committed by
GitHub
Jul 30, 2020
Browse files
reduce slash defer durations (#1504)
* reduce slash defer durations * update comments * tests
parent
f772196f
Pipeline
#102251
passed with stages
in 24 minutes and 46 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
runtime/kusama/src/lib.rs
View file @
4566ff6b
...
...
@@ -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
:
202
2
,
spec_version
:
202
3
,
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
;
// 2
8
eras in which slashes can be cancelled (7 days).
pub
const
SlashDeferDuration
:
staking
::
EraIndex
=
2
8
;
// 2
7
eras in which slashes can be cancelled (
slightly less than
7 days).
pub
const
SlashDeferDuration
:
staking
::
EraIndex
=
2
7
;
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
()
);
}
}
runtime/polkadot/src/lib.rs
View file @
4566ff6b
...
...
@@ -89,7 +89,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name
:
create_runtime_str!
(
"polkadot"
),
impl_name
:
create_runtime_str!
(
"parity-polkadot"
),
authoring_version
:
0
,
spec_version
:
2
2
,
spec_version
:
2
3
,
impl_version
:
0
,
#[cfg(not(feature
=
"disable-runtime-api"
))]
apis
:
RUNTIME_API_VERSIONS
,
...
...
@@ -329,7 +329,7 @@ parameter_types! {
pub
const
SessionsPerEra
:
SessionIndex
=
6
;
// 28 eras for unbonding (28 days).
pub
const
BondingDuration
:
staking
::
EraIndex
=
28
;
pub
const
SlashDeferDuration
:
staking
::
EraIndex
=
2
8
;
pub
const
SlashDeferDuration
:
staking
::
EraIndex
=
2
7
;
pub
const
RewardCurve
:
&
'static
PiecewiseLinear
<
'static
>
=
&
REWARD_CURVE
;
pub
const
MaxNominatorRewardedPerValidator
:
u32
=
64
;
// last 15 minutes of the last session will be for election.
...
...
@@ -1475,3 +1475,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
()
);
}
}
runtime/westend/src/lib.rs
View file @
4566ff6b
...
...
@@ -86,7 +86,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name
:
create_runtime_str!
(
"westend"
),
impl_name
:
create_runtime_str!
(
"parity-westend"
),
authoring_version
:
2
,
spec_version
:
4
2
,
spec_version
:
4
3
,
impl_version
:
0
,
#[cfg(not(feature
=
"disable-runtime-api"
))]
apis
:
RUNTIME_API_VERSIONS
,
...
...
@@ -294,8 +294,8 @@ parameter_types! {
pub
const
SessionsPerEra
:
SessionIndex
=
6
;
// 28 eras for unbonding (7 days).
pub
const
BondingDuration
:
staking
::
EraIndex
=
28
;
// 2
8
eras in which slashes can be cancelled (7 days).
pub
const
SlashDeferDuration
:
staking
::
EraIndex
=
2
8
;
// 2
7
eras in which slashes can be cancelled (
slightly less than
7 days).
pub
const
SlashDeferDuration
:
staking
::
EraIndex
=
2
7
;
pub
const
RewardCurve
:
&
'static
PiecewiseLinear
<
'static
>
=
&
REWARD_CURVE
;
pub
const
MaxNominatorRewardedPerValidator
:
u32
=
64
;
// quarter of the last session will be for election.
...
...
@@ -1113,3 +1113,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
()
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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