status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
728 stars 245 forks source link

feat: connection health should be shard specific #4628

Open chaitanyaprem opened 7 months ago

chaitanyaprem commented 7 months ago

Problem

While going through the code debugging an issue, i had noticed that connection state is shown purely based on peer connections that are available. This would make sense when a single pubsubTopic is used, but with sharding and communities having their own shards/pubsubTopics or sharing shards, connection state or health should be shown per shard/pubsubTopic.

Towards this end i forsee following changes to be made:

  1. Show peer connection health/status at community level (based on shard/pubsubTopic). e.g : in case of relay each shard/pubsubTopic should have enough healthy peers. Similar is the case with lightNode (i.e Filter and lightpush connections or peers should be available). Otherwise health/status should be shown as not good in community.
  2. Wrt common pubsubTopic that would be used for 1:1 chats or group-chats, health or connection-status should be shown in the appropriate UI screen.

How this health/connection status has to be shown in status-desktop and mobile GUI is upto respective teams. Because this is specific to each community or shard. Also, few points to keep in mind is how to indicate below scenarios such as :

Implementation

status-go shall not rely on individual peer connection or disconnection notification rather depend on peerConnHealth (which would just notify health status for a particular shard/pubsubTopic). We can consider 3 states for peerConnHealth:

The following would indicate the peerConnHealth:

Thoughts @richard-ramos @plopezlpz @kaichaosun @cammellos @vitvly

Note: More details regarding the approach on how reporting would be done shall be included as part of https://github.com/waku-org/go-waku/issues/1021

Acceptance Criteria

TBD - once approach is finalized

richard-ramos commented 7 months ago

Yeah, this is an issue we have now regardless of which approach to follow with sharding. Ideally we should have separate banners of health indicators in the clients with one used for 1:1, group chats, communities with unassigned shards and unprotected shard for requests to join (shards 16/32 and 16/64); and then for each community that has an assigned shard, an specific health check for them.

richard-ramos commented 7 months ago

cc: @iurimatias as desktop changes would be needed too depending on solution proposals

chaitanyaprem commented 7 months ago

Relay mode connection health reporting is already addressed in waku-org/go-waku#1021