Files
Igor SirotinandClaude Opus 4.8 5014bf6725 feat(messaging): add three-state ConnectionStatus; derive Online() from it (#7601)
Prepare status-go for the logos-delivery Messaging API's connection-status
model (waku/api/types.nim ConnectionStatus): Disconnected / PartiallyConnected
/ Connected, where online == status != Disconnected.

- Add ConnectionState enum in the waku layer, re-exported through
  pkg/messaging/types, and surface it on the Waku + messaging API interfaces
  (Waku.ConnectionState(), Transport.ConnectionState(), API.ConnectionStatus()).
  ConnStatus / ConnectionStatus now carry the three-state value.
- Derive the state faithfully (mirroring calculateConnectionState): no peers
  -> Disconnected; relay mesh SufficientlyHealthy on every default shard ->
  Connected; peers but degraded mesh -> PartiallyConnected. This activates the
  previously no-op go-waku TopicHealth channel (supersedes #4628). Light nodes
  report Connected on any connectivity (no relay mesh; per-protocol health TBD).
- Switch Online() to derive from ConnectionState (!= Disconnected) instead of
  raw peer count. Since Disconnected == zero peers, online detection is
  unchanged for the 8 Online() callers; the new states only subdivide 'online'.
- Emit a new EventConnectionStatusChange host signal on state transitions
  (mirrors logos-delivery's connection-status-change; replaces the removed
  wakuv2.peerstats signal).
- Keep Peers() (needed by the discovery functional tests).

Issue: #7466

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 14:46:22 +01:00
..