Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor peerManager for lightProtocols #1114

Open
1 of 3 tasks
chaitanyaprem opened this issue May 29, 2024 · 7 comments
Open
1 of 3 tasks

feat: refactor peerManager for lightProtocols #1114

chaitanyaprem opened this issue May 29, 2024 · 7 comments
Assignees

Comments

@chaitanyaprem
Copy link
Collaborator

chaitanyaprem commented May 29, 2024

Background

Some tasks i can think of. Need to analyze more on this.

  • No need to take relayPeerConfig if relay is not enabled. feat: modify peer-manager to consider relay target peers  #1135
  • Report peer or connectivity health on topictopicHealthStatusChan which is already done in case of relay based on logic explained here.
  • Need to maintain connectivity and available peersList for Filter and LightPush based on subscriptions.
    - [ ] Peer Scoring and bad peers. Options for upper layers to indicate the scoring based on which peers are selected/maintained ?

TBD

@chaitanyaprem
Copy link
Collaborator Author

chaitanyaprem commented Jul 2, 2024

For topicHealth of lightClients following should be the approach:

  1. For each pubsubTopic/shard health should be reported separately.
  2. Health should be a combination of active Filter-subscriptions and lightpush peers connected. If every Filter subscription (from application) has atleast 1 corresponding subscription to a FilterServiceNode/peer - we can consider that sufficiently healthy based on number of filters subscribed by user/application and
  3. Here is how health status can be identified/reported:
  • UnHealthy
  • If there are no active filter subscriptions towards peers at all or no lightpush peers connected/available
  • Partially healthy
  • If there is no redundancy for filter subscriptions (i.e any of the filters have less than 2 subscriptions) are active out of all application subscriptions or only 1 lightpush peer is available
  • Sufficiently Healthy
  • all filters have 2 active subscriptions 2 or more lightpush peer is available/connected

Note: As of now, i am not considering case of multiple peer subscriptions since we have regular store queries in status-go that take care of any missed messages. But ideally that should also be taken into consideration while determining health status of Filter.

cc @weboko @richard-ramos @jm-clius @fryorcraken @danisharora099 Please provide comments for above thoughts regarding topic/shard health for lightClients.

@jm-clius
Copy link

jm-clius commented Jul 2, 2024

Thanks for this - from Waku's perspective I see health more as a binary healthy/unhealthy. A single subscription is the combination of all content topics subscribed to by the filter client. If any part of the filter criteria within this subscription (i.e. one or more content topics) fail to receive messages, the subscription is a failure for Waku - for all we know critical application logic is spread across multiple content topics. Of course, an application may happily continue functioning with some missing messages, but in terms of defensive Waku-level logic I see the subscription simply as unhealthy.

@chaitanyaprem
Copy link
Collaborator Author

Thanks for this - from Waku's perspective I see health more as a binary healthy/unhealthy. A single subscription is the combination of all content topics subscribed to by the filter client. If any part of the filter criteria within this subscription (i.e. one or more content topics) fail to receive messages, the subscription is a failure for Waku - for all we know critical application logic is spread across multiple content topics. Of course, an application may happily continue functioning with some missing messages, but in terms of defensive Waku-level logic I see the subscription simply as unhealthy.

OK. But in case of status we normally end up with more than 1 subscription per client since there are a lot of content-topics as of now in use. So, in that case if we at Waku layer identify failed subscription we can mark that pubsubTopic as unhealthy eventhough other subscriptions are still active for it?

Note that there is a possibility that different Filter peers are used for different contentTopics as of now due to the fact that close to 200 content-topics are being subscribed to. They get batched into different subscriptions and subscribed to different peers (based on random selection)

@jm-clius
Copy link

jm-clius commented Jul 2, 2024

Right! I apologise - I read this as a summary of the health of a subscription and not as a report on pubsub topic health. Indeed, I think partially healthy makes sense if speaking about the health of a pubsub topic if only subset of subscriptions on that pubsub topic is healthy. Disregard my previous comment. :)

@fryorcraken
Copy link
Collaborator

How is the app supposed to behave when it's "partially healthy"? I think that would help drive the definition of this state.

The fact that some subscription are failing, is really not ideal, borderline unhealthy.

I would expect partially healthy to be "we don't have redundancy". rather than explicitely knowing that messages for some topic won't be received.

@chaitanyaprem
Copy link
Collaborator Author

I would expect partially healthy to be "we don't have redundancy". rather than explicitely knowing that messages for some topic won't be received.

Agreed that this sounds better in considering health of a topic.
So, if there is no active subscription for any filter then topic can be considered as unhealthy.
If there is atleast 1 active subscription for all filters, then we can consider it partially healthy.

@chaitanyaprem
Copy link
Collaborator Author

How is the app supposed to behave when it's "partially healthy"? I think that would help drive the definition of this state.

In case of status the app can just indicate the health status in case of partially healthy/unhealthy so that user is aware there would be possible issues in reliability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants