waku-org / go-waku

Go implementation of Waku v2 protocol
https://waku.org/
Other
116 stars 43 forks source link

feat: Peer discovery with dynamic shards as dimension #678

Closed chair28980 closed 1 year ago

chair28980 commented 1 year ago

Tracks work necessary to ensure that nodes can filter discovered peers according to the shards the node is currently subscribed to and for the node to update its own discoverable ENR every time its subscription set changes.

Priority: Critical for launch.

richard-ramos commented 1 year ago

I think part of this has been implemented already for WakuRelay since https://github.com/waku-org/go-waku/pull/595 , because anytime Relay().Subscribe is called or a pubsub subscription is closed, the ENR is updated with the new shards. See https://github.com/waku-org/go-waku/blob/master/waku/v2/node/localnode.go#L288-L347

richard-ramos commented 1 year ago

In https://github.com/waku-org/research/issues/3 the following is described:

Task: Peer discovery with dynamic shards as dimension Tracks work necessary to ensure that nodes can filter discovered peers according to the shards the node is currently subscribed to and for the node to update its own discoverable ENR every time its subscription set changes.

This does not mention specific protocols, so I have the following question: should a lightnode doing a filter subscription have its ENR affected as well? cc: @SionoiS

SionoiS commented 1 year ago

@richard-ramos

What I did in Nwaku was to update the ENR (and filter) that discv5 use which is different from the waku_node one but that's impl. details.

This does not mention specific protocols, so I have the following question: should a lightnode doing a filter subscription have its ENR affected as well?

:thinking: probably not since lightnode are not discoverable anyway.

richard-ramos commented 1 year ago

I see, in that case I'd consider this task to be complete.

chaitanyaprem commented 1 year ago

Closing this as per above discussion as it is already addressed. Any new scenarios identified would be taken up as maintenance.