Trait frame_support::traits::EstimateNextNewSession[][src]

pub trait EstimateNextNewSession<BlockNumber> {
    fn average_session_length() -> BlockNumber;
fn estimate_next_new_session(
        _: BlockNumber
    ) -> (Option<BlockNumber>, Weight); }
Expand description

Something that can estimate at which block scheduling of the next session will happen (i.e when we will try to fetch new validators).

This only refers to the point when we fetch the next session details and not when we enact them (for enactment there’s EstimateNextSessionRotation). With pallet-session this should be triggered whenever SessionManager::new_session is called.

For example, if we are using a staking module this would be the block when the session module would ask staking what the next validator set will be, as such this must always be implemented by the session module.

Required methods

Return the average length of a session.

This may or may not be accurate.

Return the block number at which the next new session is estimated to happen.

None should be returned if the estimation fails to come to an answer.

Implementations on Foreign Types

Implementors