radicle-reticulum/tests
Maciek "mab122" Bator d7b124e830 fix: chunk RNS packets to ENCRYPTED_MDU (383 B) — unblocks real LoRa use
bridge.py:
- _send_over_link: splits TCP data into RNS.Packet.ENCRYPTED_MDU-sized chunks
  before sending. RNS.Packet.pack() raises IOError on oversized data; a 32 KB
  TCP read would silently kill the tunnel on any LoRa or constrained interface.
  Order is safe — link is point-to-point, single sender per tunnel.
- Renamed RNS_BUFFER_SIZE → TCP_READ_SIZE (reads stay large for TCP efficiency;
  only outbound RNS direction is chunked).

gossip.py:
- _build_ref_payloads: packs refs into JSON payloads that each fit within
  ENCRYPTED_MDU. For >5 refs (>383 B), produces multiple packets. The receiver
  handles each independently — each triggers a change check and potential sync.
- _broadcast and _send_initial_refs now use _build_ref_payloads instead of
  building a single possibly-oversized payload.

tests:
- test_integration: set mock_pkt_cls.ENCRYPTED_MDU=383 so chunk size is correct
  under patch; assert single-packet delivery for small payloads
- test_gossip: TestBuildRefPayloads — small fits in 1 packet, 20 refs split
  across multiple packets all ≤ MDU, delta flag propagated to all chunks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 14:42:35 +02:00
..
__init__.py feat: initial implementation of radicle-reticulum bridge 2026-04-21 12:14:57 +02:00
test_adapter.py feat: initial implementation of radicle-reticulum bridge 2026-04-21 12:14:57 +02:00
test_bridge.py feat: initial implementation of radicle-reticulum bridge 2026-04-21 12:14:57 +02:00
test_gossip.py fix: chunk RNS packets to ENCRYPTED_MDU (383 B) — unblocks real LoRa use 2026-04-23 14:42:35 +02:00
test_identity.py feat: initial implementation of radicle-reticulum bridge 2026-04-21 12:14:57 +02:00
test_integration.py fix: chunk RNS packets to ENCRYPTED_MDU (383 B) — unblocks real LoRa use 2026-04-23 14:42:35 +02:00
test_link.py feat: initial implementation of radicle-reticulum bridge 2026-04-21 12:14:57 +02:00
test_messages.py feat: initial implementation of radicle-reticulum bridge 2026-04-21 12:14:57 +02:00