Skip to content

Tracing adapter based on generic CBOR observation - #39

Draft
plaidfinch wants to merge 5 commits into
cbor-legible-wirefrom
tracing-adapter
Draft

Tracing adapter based on generic CBOR observation#39
plaidfinch wants to merge 5 commits into
cbor-legible-wirefrom
tracing-adapter

Conversation

@plaidfinch

Copy link
Copy Markdown
Collaborator

No description provided.

A new workspace crate bridging the observation hook into the tracing
ecosystem: one INFO session span per observed session (kind, protocol,
ordinal), a role-elected event when the election is decided, one DEBUG
stream span per directed stream, and one DEBUG event per wire item
carrying its exact length and an RFC 8949 diagnostic-notation-style
rendering — structure unfolded, embedded-CBOR tags shown as <<...>>,
the registered atom tags named, every dimension of the rendering
bounded by constants rather than by the input. Message events are
stamped from a session-scoped atomic counter, dogfooding the hook's
documented interleaving-reconstruction pattern.

The core crate's dependency surface is untouched: the adapter lives in
crates/rumors-tracing and consumes only the public API. The README is
derived via tools/readme, which gains the crate in its roster.
The hook's session identity deliberately carries no ordinal (session
numbering is consumer-side, like message interleaving), so the adapter
counts the sessions it observes itself and stamps each session span
from that internal counter; emitted vocabulary and field names are
unchanged. Merges the ruling commits from the wire lane.

Owner-ruled (rumors#35 follow-up rulings, 2026-08-19).
…ndaries

Three review-driven changes, all local to the adapter crate:

- The crate doc's cost sentence now states the full disabled-target
  cost: the enabled check plus one relaxed atomic increment (the
  message ordinal must advance even unobserved, or enabling a
  subscriber mid-session would emit colliding ordinals). README
  re-derived from the rustdoc.

- A concurrent-sessions test: two counterparties gossip with clones
  of one observed peer's handle inside one tokio::join! on a
  current-thread runtime, so the sessions interleave at await points.
  It pins that the two session spans carry ordinals {0, 1} as a set
  and that each session's message ordinals stay dense from 0 --
  session numbering under genuine concurrency, not only sequentially.

- An unfold-budget boundary test: tag-24 embedded CBOR nested one
  level past UNFOLD_BUDGET renders the innermost embedded byte string
  as raw hex, pinning that the budget spans embedded-CBOR boundaries
  rather than resetting at each re-parse.

Both new tests were held against their known-bad mechanisms before
landing: a budget that resets per boundary and a session counter that
stops advancing each fail the respective test.
Public crate rustdoc must not point at source-only items; the
parenthetical already states why the ordinal advances unobserved.
Rumors::send is fallible: admission runs the receiver's decode and can
reject. The tests now assert the sends they depend on were admitted,
instead of discarding the verdict they were built to observe.
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