Taksh 7e037ee3f3 Bound the per-peer actor map and evict least-recently-used
Each distinct sender ID allocated a coroutine and an unbounded channel that
were released only at shutdown. Peer IDs are ephemeral and rotate, and the
ID is taken straight off the wire, so the map grows without limit in
ordinary use and can be grown deliberately by anyone in radio range.

Cap it at 128 live actors. The map is access-ordered, so the entry dropped
is the peer least recently *used*: evicting by insertion order would
discard a long-lived active peer in favour of a burst of new IDs, which is
the case worth protecting. Eviction closes the channel rather than
cancelling it, so the actor drains what it already holds before finishing.

Two of the four tests fail on main. The concurrency one does not — that
race is timing-dependent — so it is there to hold the fix rather than to
demonstrate the bug.
2026-08-15 12:44:19 +05:30
..
2025-12-14 21:55:41 +07:00
2026-07-29 03:41:16 +02:00