Expand description
Common acknowledgement verification helper shared by acknowledgement processors.
Both the acknowledge_shares method on crate::ExitAcknowledgementShareProcessor and the
HoprUnacknowledgedTicketProcessor::acknowledge_tickets over in hopr-protocol-hopr
need to perform the very same steps when an incoming batch of [Acknowledgement]s
arrives from a peer:
- Check that some state is awaited from the given peer (i.e. that the local awaiting-acks cache contains the peer entry) without bumping its popularity estimator so that the entry can be evicted normally on inactivity.
- Verify all acknowledgements (using either per-acknowledgement verification or the more efficient batch verification algorithm) and translate the resulting half-keys to their challenges.
The post-processing of the verified acknowledgements is specific to each caller and is therefore left out of this helper.
Functionsยง
- verify_
expected_ acknowledgements - Checks whether an acknowledgement from
peeris currently expected (by looking at theawaiting_ackscache) and, if so, verifies all incomingacks.