* refactor discovery and common service to separate package to remove package inter-dependencies
* relay on-demand discovery ,use proto to enr field mapping
* chore: no need to dial discovered peers as peermanager already does that
* on demand discovery for service peers during peer selection
* identify supported protocols for discovered peers and add to service slots
* fix: tests to use proper static sharding topics
* fix: random selection with default pubsubTopic
---------
Co-authored-by: richΛrd <info@richardramos.me>
* fix: using relay without bcaster should consume and drop messages
* update relay api usage
* move subscription to broadcaster
* move filter logic under subscription
* Support more than 1 relay subscription for a pubSubTopic
* modify relay Publish API to derive pubSubTopic based on autosharding
* implement relay RPC methods for autosharding
* remove relay msgChannel and relay on pubsub buffersize for subscription
Co-authored-by: richΛrd <info@richardramos.me>
* handle relay subscribe with noConsumer and address issue reported in code review
* chore: reorg relay code
---------
Co-authored-by: richΛrd <info@richardramos.me>
* feat: update lightpush API to make pubSubTopic optional as per autosharding
* Extract contentFilter and subscriptions out of filter to reuse in relay (#779)
* chore: extract contentFilter outside filter package
* chore: move subscription outside of filter so that it can be modified and reused for relay
* Feat: filter select peer for sharding (#783)
* update selectPeer to support pubsubTopic based selection
* fix: and optimising fetching membership events
* fix: start from lastProcessedBlock+1
* test: fetching membership logic
* refactor: usage of rlnInstance,rootTracker,groupManager
rlnInstance, rootTrack were previously created while creating rlnRelay
but were assigned to groupManager on Start of rlnRelay. This created
unncessary dependency of passing them to static and dynamic group
manager.
Web3Config uses interface EthClientI for client, so that we can pass
mock client for testing MembershipFetcher.
* fix: failing test
* fix: lint error
* fix: account for PR suggestions
* fix: failing race test
* fix: dont' increase fromBlock on error
* nit: fix naming and add comments
* refactor: peerConnector
* fix: code climate and dont waitOn subscriptions PeerData
* fix: check in peerConnector is on outRelay connections
* fix: introduced bug in peerConnector