Skip to content

feat(telemetry): sharded compact-binary CXO telemetry leaves (fillable busy-hub Root) - #4190

Merged
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/telemetry-sharded-wire
Aug 25, 2026
Merged

feat(telemetry): sharded compact-binary CXO telemetry leaves (fillable busy-hub Root)#4190
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/telemetry-sharded-wire

Conversation

@0pcom

@0pcom 0pcom commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

What

Replace the N per-transport transports/<uuid>/current JSON telemetry leaves on the visor→TPD CXO telemetry feed (dmsg port 50) with 16 fixed sharded binary leaves at transports/telemetry/<sh> (shard = uuid[0]>>4). A busy hub's ~851 per-transport leaves (~1700 CXO objects) collapse to ≤16 leaves, so TPD's whole-Root fill finishes over its short-lived announce conn instead of undercounting busy-hub telemetry.

Shared codec (no drift)

The byte layout lives in one shared package, pkg/telemetrywire, imported by both the visor publisher (pkg/visor/stats) and the TPD reader (pkg/deployment/tpd/cxoaggregator). Version byte 0x02 gates the format; DecodeShard validates version/shard-range/length strictly. Entries are 53 bytes and carry the transport's passively-observed peak-goodput throughput estimate (ManagedTransport.GetThroughputBps) alongside sent/recv bytes and latency — a capacity metric not derivable from the cumulative counters. TPD records it per-transport (peak-preserving) and overlays it onto Entry.ThroughputBps.

TPD fallback

TPD reads the shard leaves and applies each row exactly as a current snapshot (bandwidth, throughput, latency, per-type uptime heartbeat). It keeps the legacy transports/<uuid>/current path as a fallback for not-yet-upgraded visors, preferring shards when a Root carries any. Deploy is TPD-FIRST: TPD (shards + old-current fallback) must ship before visors switch to shard-only publishing.

tp-list re-consolidation (redo of reverted #4184)

Also re-consolidates the tp-list discovery leaf back onto this telemetry feed so a visor holds one CXO connection to TPD, not two. This is the change reverted in #4189 — safe now because the sharded telemetry is exactly what keeps the combined Root small enough to fill. The dedicated port-69 feed stays available behind Stats.DedicatedTPListFeed as a transitional escape hatch (default off = consolidated).

Tests

New codec round-trip/rejection tests; publish-shape tests proving 800 transports publish ≤16 leaves (hydrate and sampler); shard change-gate (idle shard not re-Put); TPD shard-reconcile + old-current fallback + shard-preference. go build, go vet, and go test green across the codec, pkg/visor/stats, pkg/visor, and the TPD aggregator/store packages.

…e busy-hub Root)

Replace the N per-transport transports/<uuid>/current JSON telemetry
leaves with 16 fixed sharded binary leaves at transports/telemetry/<sh>
(shard = uuid[0]>>4). A busy hub's ~851 per-transport leaves (~1700 CXO
objects) collapse to a handful, so TPD's whole-Root fill completes over
the short announce conn instead of undercounting.

The byte layout lives in a single shared codec (pkg/telemetrywire)
imported by both the visor publisher (pkg/visor/stats) and the TPD reader
(pkg/deployment/tpd/cxoaggregator) so the two sides can't drift. Version
byte 0x02 gates the format; entries are 53 bytes and carry the transport's
passively-observed peak-goodput throughput estimate (GetThroughputBps)
alongside bandwidth/latency, which TPD records per-transport.

TPD reads the shards and applies each row exactly as a current snapshot;
it keeps the old transports/<uuid>/current path as a fallback for
not-yet-upgraded visors, preferring shards when a Root carries them.
Deploy is TPD-FIRST: TPD (shards + old-current fallback) must ship before
visors switch to shard-only publishing.

Also re-consolidates the tp-list discovery leaf onto this telemetry feed
(one visor<->TPD CXO connection), redoing the reverted skycoin#4184 correctly:
the now-small sharded Root is what makes the single combined feed fillable.
The dedicated port-69 feed remains available behind Stats.DedicatedTPListFeed
as a transitional escape hatch.
@0pcom
0pcom merged commit bf83112 into skycoin:develop Aug 25, 2026
11 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant