Expand description
Replay-protected packet receiver — no_std edition.
Mirrors tf-types::constrained::PacketReceiver. The receiver keeps
a sliding window of recently-seen (packet_id, expires_at) pairs:
- On
observe, ifexpires_at < now, returnReject(Expired). - Otherwise, if
packet_idis already in the window, returnReject(Replay). - Otherwise, accept and record. The window evicts FIFO once it reaches its bounded capacity.
With the alloc feature, the cache is backed by a VecDeque /
BTreeSet pair sized at runtime (capacity is still bounded). With
--no-default-features, the cache uses heapless::Deque and a
membership probe over the deque, both with a const-generic N.
Structs§
- Packet
Receiver alloc PacketReceiverwith aVecDeque-backed window. Available with theallocfeature.
Enums§
- Receiver
Decision - Result of
PacketReceiver::observe. - Reject
Reason - Why a
PacketReceiverrejected a packet.
Constants§
- PACKET_
ID_ CAP - Maximum length of a packet ID (per TF-0001 actor-id sizing — packet IDs are short ULIDs / UUIDs but we leave headroom).
- TIMESTAMP_
CAP - Maximum length of an
expires_atISO-8601 timestamp (YYYY-MM-DDTHH:MM:SSZ).