Skip to content

fix: emit UpdateEvent::BroadcastEmitted telemetry events #3622

@sanity

Description

@sanity

Problem

The UpdateEvent::BroadcastEmitted event type is defined in crates/core/src/tracing.rs and has full telemetry serialization support in telemetry.rs, but it is never actually emitted by the protocol code during update broadcasts.

Evidence: The telemetry database has 307,154 update_broadcast_received events and 45,035 update_broadcast_applied events, but zero update_broadcast_emitted events.

Impact

Without broadcast_emitted events, the telemetry dashboard cannot:

  • Trace the actual broadcast tree (who sends to whom)
  • Distinguish between direct broadcasts and indirect propagation
  • Identify bottleneck peers that are slow to forward

The from_peer field is also absent from broadcast_received events (only to_peer is populated), making it impossible to reconstruct the propagation path.

Suggested Fix

Add NetEventLog::route_event calls with UpdateEvent::BroadcastEmitted at the point where update broadcasts are sent to subscribers in the update operation handler. The event type already has:

  • Full field definitions (id, upstream, broadcast_to, broadcasted_to, key, state_hash)
  • Telemetry serialization (telemetry.rs:1208-1219)
  • State verifier support

It just needs to be wired up in the actual broadcast sending code.

[AI-assisted - Claude]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkingArea: Networking, ring protocol, peer discoveryE-easyExperience needed to fix/implement: Easy / not muchP-mediumMedium priorityT-bugType: Something is broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions