pub fn min_emission_for_early_recovery(
params: &PixParams,
early_threshold: f64,
) -> u64Expand description
Fewest shares that can be emitted for a cycle before an Exit’s early-recovery signal can fire.
An Entry uses this to tell a legitimate request for the next batch from one that arrives before
the current batch has been earned. Nothing below the returned count can have produced an honest
SsaReconstructorConfig::early_recovery_threshold
signal, at any dimensions, on a lossless link — and loss only pushes the real signal later.
§Why it is not early_threshold × shares_per_cycle
Two independent reasons, and they pull the answer up, so the naive estimate is unsafe rather than merely imprecise.
The Exit’s threshold counts reconstructed polynomials, not shares — check_early_threshold
tests received_indices.len() against ceil(threshold × num_polys). A polynomial reconstructs on
its threshold-th useful share and its surplus is emitted afterwards, so shares and polynomials
do not advance in proportion.
And emission is windowed: SHARE_EMISSION_WINDOW polynomials advance in lockstep, and a
window emits its entire surplus before the next window starts. So every window before the one
holding the boundary has already spent threshold + surplus per polynomial, not threshold.
At the deployed 8192 × 64 (+16) that is 27 whole windows — 552 960 shares — plus 63 full passes and 52 shares of the 64th in the 28th window, i.e. 86.8 % of the cycle. Dividing the Exit’s 0.85 by the 1.25× surplus factor gives 68 %, and admitting there would hand out the next deposit roughly 171 MiB of quota before it could possibly have been earned.
§Which threshold to pass
MIN_EARLY_RECOVERY_THRESHOLD, not the caller’s own
early_recovery_threshold. The value that decides when the request actually goes out belongs to
the peer and does not travel on the wire, and the direction of a mismatch is unforgiving: a peer
configured lower asks earlier than a gate built on the local value admits, and its one-shot
request is dropped with no retry path. Computing the gate at the protocol floor admits every
conforming peer, and the floor is what makes “conforming” checkable locally.