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 checkpoint containing the effective interval’s first position in scan direction (fixed at range-resolution time). A candidate strictly before it proves nothing — the scan is still inside its first checkpoint — and is discarded, keeping the wire checkpoint field unset until the scan’s first checkpoint is fully covered, as the proto contract requires.

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