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§
sourcefn punish_for_invalid(
session: SessionIndex,
candidate_hash: CandidateHash,
losers: impl IntoIterator<Item = ValidatorIndex>,
backers: impl IntoIterator<Item = ValidatorIndex>,
)
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.
sourcefn punish_against_valid(
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>, )
Punish a series of validators who were against a valid parablock. This is expected to be a minor punishment.
sourcefn initializer_initialize(now: BlockNumber) -> Weight
fn initializer_initialize(now: BlockNumber) -> Weight
Called by the initializer to initialize the slashing pallet.
sourcefn initializer_finalize()
fn initializer_finalize()
Called by the initializer to finalize the slashing pallet.
sourcefn initializer_on_new_session(session_index: SessionIndex)
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.