mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
Benchmarks for offences pallet. (#5851)
* really rough mock runtime * start to work on offences * Make sure to start the session. * Update to latest master. * Add verify. * Fix on_initialize benchmark. * Add grandpa offence. * Add Babe offence benchmarking. * Enable babe test. * Address review grumbles. * Address review grumbles. * Address review grumbles part 1/2 * use currency trait * features * Check events explicitly. * Auto-impl tuple converter. * Removed dead code. * add test feature flag * dont use std Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -456,23 +456,24 @@ impl<T: Trait> pallet_finality_tracker::OnFinalizationStalled<T::BlockNumber> fo
|
||||
|
||||
/// A round number and set id which point on the time of an offence.
|
||||
#[derive(Copy, Clone, PartialOrd, Ord, Eq, PartialEq, Encode, Decode)]
|
||||
struct GrandpaTimeSlot {
|
||||
pub struct GrandpaTimeSlot {
|
||||
// The order of these matters for `derive(Ord)`.
|
||||
set_id: SetId,
|
||||
round: RoundNumber,
|
||||
/// Grandpa Set ID.
|
||||
pub set_id: SetId,
|
||||
/// Round number.
|
||||
pub round: RoundNumber,
|
||||
}
|
||||
|
||||
// TODO [slashing]: Integrate this.
|
||||
/// A grandpa equivocation offence report.
|
||||
struct GrandpaEquivocationOffence<FullIdentification> {
|
||||
pub struct GrandpaEquivocationOffence<FullIdentification> {
|
||||
/// Time slot at which this incident happened.
|
||||
time_slot: GrandpaTimeSlot,
|
||||
pub time_slot: GrandpaTimeSlot,
|
||||
/// The session index in which the incident happened.
|
||||
session_index: SessionIndex,
|
||||
pub session_index: SessionIndex,
|
||||
/// The size of the validator set at the time of the offence.
|
||||
validator_set_count: u32,
|
||||
pub validator_set_count: u32,
|
||||
/// The authority which produced this equivocation.
|
||||
offender: FullIdentification,
|
||||
pub offender: FullIdentification,
|
||||
}
|
||||
|
||||
impl<FullIdentification: Clone> Offence<FullIdentification> for GrandpaEquivocationOffence<FullIdentification> {
|
||||
|
||||
Reference in New Issue
Block a user