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> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_adapter.py | ||
| test_bridge.py | ||
| test_gossip.py | ||
| test_identity.py | ||
| test_integration.py | ||
| test_link.py | ||
| test_messages.py | ||