Trait frame_support::traits::EstimateNextNewSession
source · [−]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
fn average_session_length() -> BlockNumber
fn average_session_length() -> BlockNumber
Return the average length of a session.
This may or may not be accurate.