Expand description
Records SURB round-trips as network graph edge telemetry. Turns SURB round-trips into edge telemetry for the network graph.
A SURB rides a forward path to reach its destination and carries a return path for the reply to come back on. When the reply arrives, that is proof both legs passed end to end β evidence the graph already wants, produced by traffic a session was sending anyway. Unlike a probe it costs no extra packets and accrues at data rates, which is what lets a dead relayer be noticed in seconds rather than after a probe success rate has moved behind a path cache.
Β§Why one layer owns both directions
Minting and consuming happen at opposite ends of the pipeline, but only together do they mean anything: the mint says what was expected, the reply says what was observed. Wrapping both codec halves keeps the SURB-to-path association private to this module, so nothing below has to carry a path identity it has no other use for.
StructsΒ§
- Silence π
- Per-pair silence bookkeeping, carried between flushes.
- Surb
Round Trip Counters - Expected/observed counts for one pair of legs, accumulated between flushes.
- Surb
Round Trip Registry - Round-trip counts keyed by the legs they were observed over.
- Surb
Telemetry Codec - Wraps a codec so the SURBs it mints and consumes are counted per pair of legs.
EnumsΒ§
- NoPath
Telemetry - Counterpart to
NoPeerTelemetryfor the path half ofrecord_edge. - NoPeer
Telemetry record_edgeis generic over peer and path telemetry that a SURB observation does not carry.
ConstantsΒ§
- FLUSHES_
BETWEEN_ πREPLANS - Flushes a destination must wait before it can be re-planned again.
- ME_
SLOT_ πUNKNOWN me_slotvalue meaning βthis nodeβs slot has not been learned yetβ.- MIN_
EXPECTED_ πFOR_ SILENCE - SURBs a pair must have minted in one flush before its silence counts as evidence.
- PATH_
ID_ πSLOTS - Slots in a [
PathId], and therefore the longest leg that can be reported. - PENDING_
SURB_ πTTL - How long a minted SURB stays eligible to be observed coming back.
- SILENT_
FLUSHES_ πBEFORE_ DEGRADED - Consecutive silent flushes before a pair that used to deliver is called dead.
FunctionsΒ§
- flush_
into - Turns accumulated counts into graph observations.
- no_
path_ slots - A resolver that places no node, so nothing is ever attributed.
- path_id π
- Builds the [
PathId] of a leg from the nodes it visits. - path_
slots_ of - Reads path slots out of a network graph.
- pending_
legs - Builds the shared pending map, bounded by capacity and TTL.
- return_
relayers π - Relayers carrying the reply leg: everything between the destination and ourselves.
- round_
trip_ πpaths - Derives both legs of a round-trip from the routing that produced the SURB.
Type AliasesΒ§
- Path
Slot Resolver - Resolves a node to the slot it occupies in a [
PathId]. - Pending
Legs - Legs each outstanding SURB was minted over, shared between the two codec halves.