[−][src]Function tendermint_light_client::components::scheduler::valid_schedule
pub fn valid_schedule(
scheduled_height: Height,
target_height: Height,
current_height: Height,
light_store: &dyn LightStore
) -> bool
Checks whether the given scheduled_height
is a valid schedule according to the
following specification.
-
i) If
latest_verified_height == current_height
andlatest_verified_height < target_height
thencurrent_height < scheduled_height <= target_height
. -
ii) If
latest_verified_height < current_height
andlatest_verified_height < target_height
thenlatest_verified_height < scheduled_height < current_height
. -
iii) If
latest_verified_height = target_height
thenscheduled_height == target_height
.
Note
- Case i. captures the case where the light block at height
current_height
has been verified, and we can choose a height closer to thetarget_height
. As we get thelight_store
as parameter, the choice of the next height can depend on thelight_store
, e.g., we can pick a height for which we have already downloaded a light block. - In Case ii. the header at
current_height
could not be verified, and we need to pick a lesser height. - In Case iii. is a special case when we have verified the
target_height
.
Implements
- [LCV-SCHEDULE-POST.1]