babe, grandpa: set longevity for equivocation report transactions (#8076)

* babe: set longevity for equivocation report transactions

* grandpa: set longevity for equivocation report transaction

* babe, grandpa: fix tests

* node: add ReportLongevity to babe and grandpa modules

* node: bump spec_version
This commit is contained in:
André Silva
2021-02-10 13:51:36 +00:00
committed by GitHub
parent 8481e9a33a
commit c763df4bb1
7 changed files with 70 additions and 23 deletions
+5 -3
View File
@@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 263,
spec_version: 264,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
@@ -319,6 +319,8 @@ impl pallet_scheduler::Config for Runtime {
parameter_types! {
pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS;
pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
pub const ReportLongevity: u64 =
BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get();
}
impl pallet_babe::Config for Runtime {
@@ -339,7 +341,7 @@ impl pallet_babe::Config for Runtime {
)>>::IdentificationTuple;
type HandleEquivocation =
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences, ReportLongevity>;
type WeightInfo = ();
}
@@ -866,7 +868,7 @@ impl pallet_grandpa::Config for Runtime {
)>>::IdentificationTuple;
type HandleEquivocation =
pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences>;
pallet_grandpa::EquivocationHandler<Self::KeyOwnerIdentification, Offences, ReportLongevity>;
type WeightInfo = ();
}