Skip to main content

validate_early_recovery_threshold

Function validate_early_recovery_threshold 

Source
fn validate_early_recovery_threshold(
    threshold: f64,
) -> Result<(), ValidationError>
Expand description

Rejects an early-recovery fraction that is not a finite value in 0.0..=1.0.

A range validator does not cover this. Every IEEE comparison against NaN is false, so NaN satisfies min = 0.0, max = 1.0 untouched — and it does not stay inert downstream: SsaBuilder::check_early_threshold computes (threshold * num_polys).ceil() as usize, and casting a NaN float to an integer saturates to zero in Rust. The early-recovery signal then fires on the very first reconstructed polynomial rather than at 85 % of them, which is the earliest instant the Exit can possibly ask for its next batch — and the Entry’s successor gate, which exists to refuse exactly that, drops the request and leaves the Session to die on its commitment deadline.