mirror of
https://github.com/thatSFguy/reticulum-group-chat
synced 2026-08-29 23:48:28 -04:00
Lifts the 295-byte cap on outbound forwarded messages by routing oversized
sends through a Reticulum Link automatically. Was: opportunistic-only;
now: opportunistic for short, link for long, transparent to callers.
Also fixes the bug where /users silently failed once the roster reply
exceeded the opportunistic packet size — full list now returns regardless.
PR1 — outbound link initiator (rns + lxmf)
- Transport.SendOverLink: lazy handshake, encrypt link DATA, await proof
- Transport.handleLinkProof: validate responder's long-term Ed25519 sig,
signal pending waiter
- Link.{initiatorEd25519Priv, peerEd25519Pub, pendingProofs, activatedCh,
AwaitActive, registerProofWaiter, signalProof}
- StartLinkAsInitiator retains ephemeral Ed25519 priv on the Link
- HandleLRProof caches responder pub + closes activatedCh
- Delivery.Send routes opportunistic vs link by ErrPayloadTooLarge fall-
through; new Delivery.LinkSendTimeout (default 30s)
- Sentinels: ErrLinkPeerUnknown, ErrLinkHandshakeTimeout,
ErrLinkProofTimeout, ErrLinkSendFailed
PR2 — initiator-side return-data proofs
- handleLinkData signs responder-side with long-term Ed25519 (existing)
AND initiator-side with stored ephemeral Ed25519 (new). Bidirectional
traffic on outbound links no longer triggers infinite responder
retransmits.
PR3 — lifecycle, multi-hop, KEEPALIVE
- Transport.RunLinkSweeper(ctx) + sweepLinks(): closes idle links
(default 15m), emits KEEPALIVE on active outbound (default 4m).
Configurable via SetLinkLifetime.
- applyMultihopRouting promotes LINKREQUEST + link DATA + KEEPALIVE to
HEADER_2 + transport_id when the responder's KnownIdentity carries one
(announce came via a relay). HashablePart-invariance under
HEADER_1<->HEADER_2 means link_id derivation stays consistent.
- service.Run starts the sweeper alongside Transport.Run.
/users uncapped
- Dispatcher.MaxReplyContentBytes wired to 0 (unlimited) in service.New.
Truncation helper still available for callers that want a per-command
cap, but production wiring lets list replies fall through to link
delivery via Delivery.Send routing.
Tests
- 19 new pure-Go E2E scenarios in internal/lxmf/link_send_e2e_test.go
covering opportunistic-vs-link routing, link reuse, bidirectional
large sends, sweeper close + keepalive, and negative paths
(handshake/proof timeouts, peer-unknown, bad-sig, concurrent sends).
- New byte-level Python interop test (internal/rns/link_send_interop_test.go
+ scripts/gen_link_data.py) drives RNS 1.2.4 to emit a deterministic
link DATA wire packet; our LinkTokenEncrypt + BuildLinkDataPacket must
produce byte-identical output and decrypt upstream's bytes back.
- internal/rns/testing_hooks.go exposes SetLink{LastActivity,State},
SweepLinksForTest, TestDispatchRaw to cross-package tests.
- All existing tests still pass against rns 1.2.4 / lxmf 0.9.7.
Service plumbing
- service.openLogWriter + service.LogPath config option (carry-over from
v1.0.4 work that landed in this commit): tee daemon log to a file for
troubleshooting. Inbox emits structured cmd from=… / cmd reply sent: …
events.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| build-all.sh | ||
| build-rpi.sh | ||
| gen_ifac_packet.py | ||
| gen_link_data.py | ||
| gen_link_proof.py | ||
| live_ifac_test.sh | ||