Repository navigation
feat(ingestor): store uplink pings (/uplink) - #20
Merged
Merged
Conversation
CoreDrive RX v1.21.0 sends "cdrx <tag>" on a hashtag channel (#coredrive), listens for repeaters re-broadcasting it, and reports the ping as UPLINK_PING on /uplink. This stores it, so the server can later tell per place whether a repeater heard the companion (echo) and whether an observer received the ping (arrival). - case "uplink" in the client topic switch, gated on clientUplink.enabled (default off). - handleClientUplink (cmd/ingestor/client_uplink.go): tag must be 8 hex, pkt_hash 16 hex or dropped, echoes validated and capped at 32, GPS optional. Table client_uplink_pings, UNIQUE(rx_pubkey, tag), with the distinct first hops kept for the map. - Without an echo the companion has no packet hash. The ingestor then learns it itself: noteUplinkTransmission decrypts GRP_TXT on the ping channel's hash byte (0x76 for #coredrive, shared with unrelated channels, so the MAC and the "cdrx <tag>" text decide) and stores tag -> hash in client_uplink_tx. The channel key is derived once from clientUplink.channel and is not added to the channel list. - Retention retention.clientUplinkDays for both tables. - Contract in docs/client-rx-coverage.md, keys in config.example.json. Tests: handler with echoes, no-echo, rejects/sanitising, idempotency, firmware channel hash (0x76 as seen on air), tag -> hash linking against a packet encrypted like the firmware does, config default, gate on/off, prune. Full ingestor suite passes. Field data: the beta ping cdrx 78277c0e, hash b76c6a2777f9b0e9, received by 15 observers. Server endpoint and map layer follow in a separate PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ingestor side of uplink pings, so the data starts accumulating while the map layer is being built (separate PR). CoreDrive RX v1.21.0 sends
cdrx <tag>on#coredrive, listens for repeaters re-broadcasting it, and reportsUPLINK_PINGonmeshcore/client/{pk}/uplink.uplinksubtopic, gated onclientUplink.enabled(default off), stored in tableclient_uplink_pings(UNIQUE(rx_pubkey, tag)).tagmust be 8 hex characters.pkt_hashmust be 16 hex characters, otherwise it is dropped.client_uplink_tx.cdrx <tag>text decide.clientUplink.channeland never added to the channel list.retention.clientUplinkDayscovers both tables.docs/client-rx-coverage.md, keys inconfig.example.json.Performance
noteUplinkTransmissionruns on the observer packet path only for GRP_TXT on hash byte 0x76 that the ingestor could not decrypt. That is one HMAC per such packet; on live there were dozens per hour on that byte. Everything else returns after a field compare.Test plan
go test ./...incmd/ingestor: pass. New tests inclient_uplink_test.go.#coredrivegives hash byte 0x76, as seen on air in the beta field test (transmissionb76c6a2777f9b0e9, 15 observers).clientUplink.enabledon, then a drive with CoreDriveuplinkPingon.🤖 Generated with Claude Code