referrerpolicy=no-referrer-when-downgrade
pub trait DisputesHandler<BlockNumber: Ord> {
    // Required methods
    fn is_frozen() -> bool;
    fn filter_dispute_data(
        statement_set: DisputeStatementSet,
        post_conclusion_acceptance_period: BlockNumber,
    ) -> Option<CheckedDisputeStatementSet>;
    fn process_checked_multi_dispute_data(
        statement_sets: &CheckedMultiDisputeStatementSet,
    ) -> Result<Vec<(SessionIndex, CandidateHash)>, DispatchError>;
    fn note_included(
        session: SessionIndex,
        candidate_hash: CandidateHash,
        included_in: BlockNumber,
    );
    fn included_state(
        session: SessionIndex,
        candidate_hash: CandidateHash,
    ) -> Option<BlockNumber>;
    fn concluded_invalid(
        session: SessionIndex,
        candidate_hash: CandidateHash,
    ) -> bool;
    fn initializer_initialize(now: BlockNumber) -> Weight;
    fn initializer_finalize();
    fn initializer_on_new_session(
        notification: &SessionChangeNotification<BlockNumber>,
    );

    // Provided method
    fn deduplicate_and_sort_dispute_data(
        statement_sets: &mut MultiDisputeStatementSet,
    ) -> Result<(), ()> { ... }
}
Expand description

Hook into disputes handling.

Allows decoupling parachains handling from disputes so that it can potentially be disabled when instantiating a specific runtime.

Required Methods§

source

fn is_frozen() -> bool

Whether the chain is frozen, if the chain is frozen it will not accept any new parachain blocks for backing or inclusion.

source

fn filter_dispute_data( statement_set: DisputeStatementSet, post_conclusion_acceptance_period: BlockNumber, ) -> Option<CheckedDisputeStatementSet>

Filter a single dispute statement set.

Used in cases where more granular control is required, i.e. when accounting for maximum block weight.

source

fn process_checked_multi_dispute_data( statement_sets: &CheckedMultiDisputeStatementSet, ) -> Result<Vec<(SessionIndex, CandidateHash)>, DispatchError>

Handle sets of dispute statements corresponding to 0 or more candidates. Returns a vector of freshly created disputes.

source

fn note_included( session: SessionIndex, candidate_hash: CandidateHash, included_in: BlockNumber, )

Note that the given candidate has been included.

source

fn included_state( session: SessionIndex, candidate_hash: CandidateHash, ) -> Option<BlockNumber>

Retrieve the included state of a given candidate in a particular session. If it returns Some, then we have a local dispute for the given candidate_hash.

source

fn concluded_invalid( session: SessionIndex, candidate_hash: CandidateHash, ) -> bool

Whether the given candidate concluded invalid in a dispute with supermajority.

source

fn initializer_initialize(now: BlockNumber) -> Weight

Called by the initializer to initialize the disputes pallet.

source

fn initializer_finalize()

Called by the initializer to finalize the disputes pallet.

source

fn initializer_on_new_session( notification: &SessionChangeNotification<BlockNumber>, )

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

Provided Methods§

source

fn deduplicate_and_sort_dispute_data( statement_sets: &mut MultiDisputeStatementSet, ) -> Result<(), ()>

Remove dispute statement duplicates and sort the non-duplicates based on local (lower indices) vs remotes (higher indices) and age (older with lower indices).

Returns Ok(()) if no duplicates were present, Err(()) otherwise.

Unsorted data does not change the return value, while the node side is generally expected to pass them in sorted.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<BlockNumber: Ord> DisputesHandler<BlockNumber> for ()

source§

fn is_frozen() -> bool

source§

fn deduplicate_and_sort_dispute_data( statement_sets: &mut MultiDisputeStatementSet, ) -> Result<(), ()>

source§

fn filter_dispute_data( _set: DisputeStatementSet, _post_conclusion_acceptance_period: BlockNumber, ) -> Option<CheckedDisputeStatementSet>

source§

fn process_checked_multi_dispute_data( _statement_sets: &CheckedMultiDisputeStatementSet, ) -> Result<Vec<(SessionIndex, CandidateHash)>, DispatchError>

source§

fn note_included( _session: SessionIndex, _candidate_hash: CandidateHash, _included_in: BlockNumber, )

source§

fn included_state( _session: SessionIndex, _candidate_hash: CandidateHash, ) -> Option<BlockNumber>

source§

fn concluded_invalid( _session: SessionIndex, _candidate_hash: CandidateHash, ) -> bool

source§

fn initializer_initialize(_now: BlockNumber) -> Weight

source§

fn initializer_finalize()

source§

fn initializer_on_new_session( _notification: &SessionChangeNotification<BlockNumber>, )

Implementors§

source§

impl<T: Config> DisputesHandler<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where BlockNumberFor<T>: Ord,