Skip to main content

resend_payload

Function resend_payload 

Source
fn resend_payload<'a>(
    last_request: Option<&'a (Vec<SsaId<HoprPseudonym>>, HoprStartProtocol)>,
    ssa_ids: &[SsaId<HoprPseudonym>],
    processor: &SsaReconstructor<HoprPixSpec>,
) -> ResendDecision<'a>
Expand description

Decides whether ssa_ids can be re-sent, and with what.

Sent only if ssa_ids is exactly the batch of last_request, every member still has a registration, and at least one of them is still waiting for its commitment (a non-empty missing_commitment_runs). A member whose commitment is complete is no reason to refuse: the supervisor re-sends the whole batch until every member has heard from the Entry, because the Entry publishes a batch one member after another and may have been cut short before the later ones, and the Entry’s repeat branch publishes only the members it still owes. It sends the bursts of the others again only when the repeat comes long enough after the batch went out to mean they were lost.

Every member is read, with no early exit, because reading a registration refreshes its idle timer — see SsaReconstructor::missing_commitment_runs — which is what keeps a registration alive across the Entry’s silence. A mismatch is decided before any registration is read, since the batch is not one this driver can send anyway; a missing registration decides before completeness does.