Skip to main content

advance_covered_bound_before_checkpoint

Function advance_covered_bound_before_checkpoint 

Source
pub fn advance_covered_bound_before_checkpoint(
    covered_checkpoint_bound: Option<u64>,
    incomplete_checkpoint: u64,
    entry_checkpoint: u64,
    options: &QueryOptions,
) -> Option<u64>
Expand description

Advance the inclusive covered bound using a checkpoint that is not itself proven complete. Transactions, events, and scan frontiers can leave more matches within checkpoint C, so the candidate excludes C: C - 1 ascending and C + 1 descending. The adjusted candidate is then merged by max ascending or min descending.

entry_checkpoint is the window’s first checkpoint in scan direction (raised to the serving floor ascending). A candidate strictly before it lies outside the window, and is discarded. Within the window, a candidate counts even before the scan reads its checkpoint’s start: the request’s starting cursor vouches for every position before it.

When the C ∓ 1 adjustment would overflow (C == 0 ascending or u64::MAX descending), the previously covered bound is preserved.