feat(core): ack send path with custody/broadcast buffers
Buffer pending acks (acks for addressed, bcast_acks for broadcast, ACK_BUFFER_CAP=256, overflow drops oldest), skip a released-duplicate offer in accept(), and emit Ack frames in next_frame after a due summary and before addressed/broadcast traffic, draining up to ACK_IDS_CAP ids per destination and splitting across frames to fit mtu. Release custody on an Ack only when the Ack confirms delivery to the intended recipient: an Ack from a peer that merely holds an epidemic-forwarded copy no longer releases custody, so the local copy stays available to forward toward the recipient once the only contact to it closes.
This commit is contained in:
@@ -40,3 +40,8 @@ pub const EVENT_QUEUE_CAP: usize = 64;
|
||||
/// Cap on the `Exchange` per-peer `bcast_sent` table of broadcast ids
|
||||
/// dispatched to a peer.
|
||||
pub const BCAST_SENT_CAP: usize = 256;
|
||||
|
||||
/// Cap on the number of pending ack ids (`acks` for addressed, `bcast_acks`
|
||||
/// for broadcast) buffered before the next Ack is emitted. Overflow drops
|
||||
/// the oldest pending entry.
|
||||
pub const ACK_BUFFER_CAP: usize = 256;
|
||||
|
||||
Reference in New Issue
Block a user