-
-
Notifications
You must be signed in to change notification settings - Fork 132
Description
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]