Trait noble_session::SessionManager[][src]

pub trait SessionManager<ValidatorId> {
    fn new_session(new_index: SessionIndex) -> Option<Vec<ValidatorId>>;
fn end_session(end_index: SessionIndex);
fn start_session(start_index: SessionIndex); }

A trait for managing creation of new validator set.

Required methods

fn new_session(new_index: SessionIndex) -> Option<Vec<ValidatorId>>[src]

Plan a new session, and optionally provide the new validator set.

Even if the validator-set is the same as before, if any underlying economic conditions have changed (i.e. stake-weights), the new validator set must be returned. This is necessary for consensus engines making use of the session module to issue a validator-set change so misbehavior can be provably associated with the new economic conditions as opposed to the old. The returned validator set, if any, will not be applied until new_index. new_index is strictly greater than from previous call.

The first session start at index 0.

new_session(session) is guaranteed to be called before end_session(session-1). In other words, a new session must always be planned before an ongoing one can be finished.

fn end_session(end_index: SessionIndex)[src]

End the session.

Because the session noble can queue validator set the ending session can be lower than the last new session index.

fn start_session(start_index: SessionIndex)[src]

Start the session.

The session start to be used for validation.

Loading content...

Implementations on Foreign Types

impl<A> SessionManager<A> for ()[src]

Loading content...

Implementors

Loading content...