-
Notifications
You must be signed in to change notification settings - Fork 57
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
bug: metadata protocol will disconnect light clients #2491
Comments
Light nodes don't use discovery, so the easy fix it to trigger a shard update in Waku Metadata when using filter subscribe. Does it make sense to also update ENRs when a node uses Relay AND Filter as client? 🤔 is that even a valid use case? |
Something else to take into account: When using lightmode, peer exchange will be used instead of discv5 to retrieve peers. At that point no subscription to filter protocol has happened yet, so a shard update triggered by filter subscribe will not have happened. Peer exchange also does not use shard data at all so we can't trigger an update when doing a request, can we? 🤔 |
mm unsure if bug or feature. even light clients should have some identifier (eg mounted waku metadata) because otherwise they may be interacting with nodes in other networks. so i would say light clients should mount waku metadata (which is dead simple). |
Light clients (using go-waku) already mount waku metadata, and the logic that deals with the clusterID is executed correctly (I assume by network you mean nodes sharing the same clusterID?). The issue described here happens due to this code nwaku/waku/node/peer_manager/peer_manager.nim Lines 360 to 362 in 55ff667
It assumes that the nodes will have a list of shards at all times, yet this is an undefined behaviour for light clients as they do not update their ENR nor are discoverable, and you can see here how metadata protocol is instantiated using the node's own ENR as well as the list of topics you subscribe to in relay (both of these not really available while using light protocols). Line 191 in 55ff667
|
Would there be any problem having light nodes support all shards by default? They don't use relay anyway. |
I believe a light client would want to be connected to a service node that support the shard they are interested in. |
That's not the problem. If a node is not interested any shards then it can't connect to any other nodes because they have no shard in common. No being able to connect to other nodes before you select shards is bad UX IMO. |
Per Nwaku meet today we decided to only check shards in common for Relay connections. We keep the cluster id check for every connection. |
Problem
The function
proc onPeerMetadata(pm: PeerManager, peerId: PeerId) {.async.}
uses the metadata protocol to determine whether a connected peer supports a shard or not, and disconnect the peer otherwise.This works fine for nodes that support relay. However in the case of nodes that support only light protocols (like mobile on status, which only consumes lightpush/filter/peerexchange, it will fail.
The metadata protocol relies on the ENR containing the shards, yet in the case of request/response protocols, the ENR is not updated at all, so the peer get disconnected
The text was updated successfully, but these errors were encountered: