Skip to content

ingestor: accept minimised raw packets (payload removed) on the client RX topic #284

Description

@dborup

Background

A mobile client RX uploader (meshcore/client/{PUBLIC_KEY}/packets, see docs/client-rx-coverage.md) may send a minimised raw packet to limit what it shares:

  • non-advert packets: header, transport codes (for TRANSPORT_* routes) and path only, with the payload removed;
  • adverts: sent whole, because the heard key is the advertiser's pubkey.

Coverage only needs the directly-heard node:

  • path[last] for FLOOD routes with ≥ 2-byte hashes;
  • or the 0-hop advert pubkey (see "Capture HARD RULE" in the docs).

Question

Does the ingestor's client path (handleClientPacket → DecodePacket → deriveHeardKey) accept such a minimised packet? Or does DecodePacket reject the truncated payload, so the reception is silently dropped?

Task

  1. Tests through the real handleClientPacket path. Write a test for each case:
    • FLOOD non-advert with a 2-byte and a 3-byte path and the payload removed. Expected: one client_receptions row with heard_key = path[last].
    • TRANSPORT_FLOOD with transport codes, the path and no payload. Same expectation.
    • The same packets whole (control).
    • Whole adverts (0-hop, and with a path).
    • DIRECT and TRACE minimised packets. Expected: still not attributable, so no row.
    • Malformed input: a path length byte that claims more bytes than are present. Expected: drop without a panic.
  2. If the minimised form is rejected, make the client path decode only what coverage needs (header, transport codes, path) when the payload is absent, without changing the observer path. Keep the HARD RULE unchanged.
  3. Document in docs/client-rx-coverage.md that a minimised raw packet is accepted and what it must contain.

Acceptance

  • The tests pin the behaviour for every case above. A mutant that requires a payload for non-adverts fails them.
  • The observer path and DecodePacket behaviour for full packets are unchanged.
  • cmd/server is untouched or read-only. No new map[string]interface{}.

Activity

  1. added a commit that references this issue on Oct 6, 2026
  2. dborup commented on Oct 6, 2026

    @dborup
    OwnerAuthor

    Resolved by #298 (merged as 22589f05): minimised raw packets are already accepted on the client RX topic; #298 pins the behaviour with tests and docs. Review nits are tracked in a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions