-
Notifications
You must be signed in to change notification settings - Fork 247
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: Improve filter peer management based on shards #4463
Comments
This is indeed a possible improvement, but note that some level of inefficiency can be tolerated here - i.e. if you try to subscribe to a filter service node that doesn't support the shard you're interested in, it will reject your request and you could simply continue to another one until you reach your desired level of redundancy. This is not unlike e.g. relay protocol being pruned by peers for various reasons (e.g. capacity) and having to continue trying to graft to discovered peers until it finds a peer that has slots available. |
My understanding is that when a client decides to subscribe a filter servicer, the filter service should have the capability to gossip messages, and the
In go-waku code comments |
Yes, but it doesn't have to use relay rather it can use another filter node for the same(which inturn does relay). But i guess for status use-case this is fine since the fleets are filter service nodes which also support relay. |
It not only selects a random peer from peer-store rather it filters the peers based on shards they support. Refer these snippets If pubsub topics are passed to peerSelection then peers are selected based on pubsubTopics (which are made of cluster and a shard). But now that i think about it, maybe the selection criteria API can be enhanced to specify just shards itself and internally it can translate to pubsubTopics. In case of status-go, since it already has a filterPeerManager there are two ways to go about it:
Personally i think approach 1 is better, because it would reduce duplication of logic. Approach-2 would be easier to modify and test since it just needs to consider shard as well while doing going through peers in peerstore. |
Problem
While going through filter code in status-go, i had noticed that the way filter subscriptions are done towards peers does not take sharding into consideration.
Referring to below code where filter peers are found, few observations that can be improved are
status-go/wakuv2/filter_manager.go
Lines 303 to 308 in 42cf9fa
Note that point-2 may not impact as of now, because the fleet nodes support all shards. But as communities are created and assigned to different shards where various peers only support a subset of them, this will start causing issues.
Implementation
Explained approaches on how this can be implemented above.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: