pub trait SlashingHandler<BlockNumber> {
    // Required methods
    fn punish_for_invalid(
        session: SessionIndex,
        candidate_hash: CandidateHash,
        losers: impl IntoIterator<Item = ValidatorIndex>
    );
    fn punish_against_valid(
        session: SessionIndex,
        candidate_hash: CandidateHash,
        losers: impl IntoIterator<Item = ValidatorIndex>
    );
    fn initializer_initialize(now: BlockNumber) -> Weight;
    fn initializer_finalize();
    fn initializer_on_new_session(session_index: SessionIndex);
}
Expand description

Punishment hooks for disputes.

Required Methods§

source

fn punish_for_invalid( session: SessionIndex, candidate_hash: CandidateHash, losers: impl IntoIterator<Item = ValidatorIndex> )

Punish a series of validators who were for an invalid parablock. This is expected to be a major punishment.

source

fn punish_against_valid( session: SessionIndex, candidate_hash: CandidateHash, losers: impl IntoIterator<Item = ValidatorIndex> )

Punish a series of validators who were against a valid parablock. This is expected to be a minor punishment.

source

fn initializer_initialize(now: BlockNumber) -> Weight

Called by the initializer to initialize the slashing pallet.

source

fn initializer_finalize()

Called by the initializer to finalize the slashing pallet.

source

fn initializer_on_new_session(session_index: SessionIndex)

Called by the initializer to note that a new session has started.

Implementations on Foreign Types§

source§

impl<BlockNumber> SlashingHandler<BlockNumber> for ()

Implementors§

source§

impl<T> SlashingHandler<<T as Config>::BlockNumber> for SlashValidatorsForDisputes<Pallet<T>>where T: Config<KeyOwnerIdentification = IdentificationTuple<T>>,