[][src]Trait tendermint_light_client::components::scheduler::Scheduler

pub trait Scheduler: Send + Sync {
    pub fn __contracts_impl_schedule(
        &self,
        light_store: &dyn LightStore,
        current_height: Height,
        target_height: Height
    ) -> Height; pub fn schedule(
        &self,
        light_store: &dyn LightStore,
        current_height: Height,
        target_height: Height
    ) -> Height { ... } }

The scheduler decides what block to verify next given the current and target heights.

The scheduler is given access to the light store, in order to optionally improve performance by picking a next block that has already been fetched.

Required methods

pub fn __contracts_impl_schedule(
    &self,
    light_store: &dyn LightStore,
    current_height: Height,
    target_height: Height
) -> Height
[src]

Loading content...

Provided methods

pub fn schedule(
    &self,
    light_store: &dyn LightStore,
    current_height: Height,
    target_height: Height
) -> Height
[src]

Decides what block to verify next.

Precondition

  • The light store contains at least one verified block. [LCV-SCHEDULE-PRE.1]

Postcondition

  • The resulting height must be valid according to valid_schedule. [LCV-SCHEDULE-POST.1]

Contracts

Pre-condition: light_store . latest_trusted_or_verified() . is_some()

Post-condition: valid_schedule(ret, target_height, current_height, light_store)

Loading content...

Implementors

impl<F: Send + Sync> Scheduler for F where
    F: Fn(&dyn LightStore, Height, Height) -> Height
[src]

Loading content...