referrerpolicy=no-referrer-when-downgrade
pub trait SlashingHandler<BlockNumber> {
    // Required methods
    fn punish_for_invalid(
        session: SessionIndex,
        candidate_hash: CandidateHash,
        losers: impl IntoIterator<Item = ValidatorIndex>,
        backers: impl IntoIterator<Item = ValidatorIndex>,
    );
    fn punish_against_valid(
        session: SessionIndex,
        candidate_hash: CandidateHash,
        losers: impl IntoIterator<Item = ValidatorIndex>,
        backers: 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>, backers: 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>, backers: 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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<BlockNumber> SlashingHandler<BlockNumber> for ()

source§

fn punish_for_invalid( _: SessionIndex, _: CandidateHash, _: impl IntoIterator<Item = ValidatorIndex>, _: impl IntoIterator<Item = ValidatorIndex>, )

source§

fn punish_against_valid( _: SessionIndex, _: CandidateHash, _: impl IntoIterator<Item = ValidatorIndex>, _: impl IntoIterator<Item = ValidatorIndex>, )

source§

fn initializer_initialize(_now: BlockNumber) -> Weight

source§

fn initializer_finalize()

source§

fn initializer_on_new_session(_: SessionIndex)

Implementors§

source§

impl<T> SlashingHandler<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for SlashValidatorsForDisputes<Pallet<T>>
where T: Config<KeyOwnerIdentification = IdentificationTuple<T>>,