* Chore(filter v2) test updates (#811)
* test: Test incorrect protocol identifiers
* fix: return errors in FilterSubscribeOption
* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated
* test: Test Ping failure after unsubscription
* test: Test PubSub with single content topic
* test: Simplify test PubSub with single content topic
* test: Test with single pubsub and multiple content topics
* test: Test with multiple PubSub and multiple contentTopic
* test: Test with multiple overlaping contentTopics
- test contentTopics limit
* test: refactor tests to fix concurrent run errors
* test: Test subscription refresh
* test: Test error handling for subscribe
* test: Test subscription to multiple full nodes
* update test to fix#804
* Update waku/v2/protocol/filter/filter_test.go
Combine log messages
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Delete commented - temporary code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
fmt.Sprintf instead of "+" suffix => more performance and beauty
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Adjust comment with code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Combine multiple related log entries into one.
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Align comment with the code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Use fmt.Sprintf() instead of "+" for more beauty and speed
Co-authored-by: richΛrd <info@richardramos.me>
* test: refactor tests with prepareData()
* test: Test incorrect protocol identifiers
* chore: rebase onto latest master
* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated
* test: Test Ping failure after unsubscription
* test: Test PubSub with single content topic
* test: Simplify test PubSub with single content topic
* test: Test with single pubsub and multiple content topics
* test: Test with multiple PubSub and multiple contentTopic
* test: Test with multiple overlaping contentTopics
- test contentTopics limit
* test: refactor tests to fix concurrent run errors
* test: Test subscription refresh
* test: Test error handling for subscribe
* test: Test subscription to multiple full nodes
* update test to fix#804
* Update waku/v2/protocol/filter/filter_test.go
Combine log messages
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Delete commented - temporary code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
fmt.Sprintf instead of "+" suffix => more performance and beauty
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Adjust comment with code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Combine multiple related log entries into one.
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Align comment with the code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Use fmt.Sprintf() instead of "+" for more beauty and speed
Co-authored-by: richΛrd <info@richardramos.me>
* test: refactor tests with prepareData()
* test: Test incorrect protocol identifiers
* fix: return errors in FilterSubscribeOption
* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated
* test: Test Ping failure after unsubscription
* test: Test PubSub with single content topic
* test: Simplify test PubSub with single content topic
* test: Test with single pubsub and multiple content topics
* test: Test with multiple PubSub and multiple contentTopic
* test: Test with multiple overlaping contentTopics
- test contentTopics limit
* test: refactor tests to fix concurrent run errors
* test: Test subscription refresh
* test: Test error handling for subscribe
* test: Test subscription to multiple full nodes
* update test to fix#804
* Update waku/v2/protocol/filter/filter_test.go
Combine log messages
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Delete commented - temporary code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
fmt.Sprintf instead of "+" suffix => more performance and beauty
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Adjust comment with code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Combine multiple related log entries into one.
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Align comment with the code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Use fmt.Sprintf() instead of "+" for more beauty and speed
Co-authored-by: richΛrd <info@richardramos.me>
* test: refactor tests with prepareData()
* Fix error during rebase
* Sync filter tests with latest master
* Refactor context initialization for test
* test: Incorrect Subscribe Identifier refactored with custom subscribe
* test: refactor into multiple files
* test: Subscribe with multiple light nodes to one full node
* test: shared mode for full node creation
- test preview Subscribe fullNode to fullNode
* test: test Subscribe fullNode to fullNode
---------
Co-authored-by: Richard Ramos <info@richardramos.me>
Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
* test: unsubscribe all without content topics
* test: unsubscribe all without any filter specification
* test: move unsubscribe all tests to unsubscribe file
---------
Co-authored-by: Richard Ramos <info@richardramos.me>
Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
* 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>
* update relay REST API's to remove duplicate message cache, fix relay tests and admin test
* chore: enable REST and RPC unit tests
* update lightpush rest api to match yaml
* fix: filter rest unit test failures
* skipping legacy filter tests
* chore: add unit tests for autosharding relay REST API, fix success response (#868)
* Chore(filter v2) test updates (#811)
* test: Test incorrect protocol identifiers
* fix: return errors in FilterSubscribeOption
* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated
* test: Test Ping failure after unsubscription
* test: Test PubSub with single content topic
* test: Simplify test PubSub with single content topic
* test: Test with single pubsub and multiple content topics
* test: Test with multiple PubSub and multiple contentTopic
* test: Test with multiple overlaping contentTopics
- test contentTopics limit
* test: refactor tests to fix concurrent run errors
* test: Test subscription refresh
* test: Test error handling for subscribe
* test: Test subscription to multiple full nodes
* update test to fix#804
* Update waku/v2/protocol/filter/filter_test.go
Combine log messages
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Delete commented - temporary code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
fmt.Sprintf instead of "+" suffix => more performance and beauty
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Adjust comment with code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Combine multiple related log entries into one.
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Align comment with the code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Use fmt.Sprintf() instead of "+" for more beauty and speed
Co-authored-by: richΛrd <info@richardramos.me>
* test: refactor tests with prepareData()
* test: Test incorrect protocol identifiers
* chore: rebase onto latest master
* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated
* test: Test Ping failure after unsubscription
* test: Test PubSub with single content topic
* test: Simplify test PubSub with single content topic
* test: Test with single pubsub and multiple content topics
* test: Test with multiple PubSub and multiple contentTopic
* test: Test with multiple overlaping contentTopics
- test contentTopics limit
* test: refactor tests to fix concurrent run errors
* test: Test subscription refresh
* test: Test error handling for subscribe
* test: Test subscription to multiple full nodes
* update test to fix#804
* Update waku/v2/protocol/filter/filter_test.go
Combine log messages
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Delete commented - temporary code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
fmt.Sprintf instead of "+" suffix => more performance and beauty
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Adjust comment with code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Combine multiple related log entries into one.
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Align comment with the code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Use fmt.Sprintf() instead of "+" for more beauty and speed
Co-authored-by: richΛrd <info@richardramos.me>
* test: refactor tests with prepareData()
* test: Test incorrect protocol identifiers
* fix: return errors in FilterSubscribeOption
* test: Test incorrect push identifier added
- test incorrect subscribe identifier separated
* test: Test Ping failure after unsubscription
* test: Test PubSub with single content topic
* test: Simplify test PubSub with single content topic
* test: Test with single pubsub and multiple content topics
* test: Test with multiple PubSub and multiple contentTopic
* test: Test with multiple overlaping contentTopics
- test contentTopics limit
* test: refactor tests to fix concurrent run errors
* test: Test subscription refresh
* test: Test error handling for subscribe
* test: Test subscription to multiple full nodes
* update test to fix#804
* Update waku/v2/protocol/filter/filter_test.go
Combine log messages
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Delete commented - temporary code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
fmt.Sprintf instead of "+" suffix => more performance and beauty
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Adjust comment with code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Combine multiple related log entries into one.
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Align comment with the code
Co-authored-by: richΛrd <info@richardramos.me>
* Update waku/v2/protocol/filter/filter_test.go
Use fmt.Sprintf() instead of "+" for more beauty and speed
Co-authored-by: richΛrd <info@richardramos.me>
* test: refactor tests with prepareData()
* Fix error during rebase
* Sync filter tests with latest master
* Refactor context initialization for test
* test: Incorrect Subscribe Identifier refactored with custom subscribe
* test: refactor into multiple files
* test: Subscribe with multiple light nodes to one full node
* test: shared mode for full node creation
- test preview Subscribe fullNode to fullNode
* test: test Subscribe fullNode to fullNode
---------
Co-authored-by: Richard Ramos <info@richardramos.me>
Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
* test: unsubscribe with single contentTopic
* test: extend test - unsubscribe with single contentTopic
* test: unsubscribe with multiple contentTopic
* test: unsubscribe with multiple pubSub/contentTopic
* test: refactor back to use waitForTimeout()
* test: unsubscribe error handling
---------
Co-authored-by: Richard Ramos <info@richardramos.me>
Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
* fix: modify store test to not depend on order of msgs
Co-authored-by: richΛrd <info@richardramos.me>
---------
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
* feat: update filter client to support autosharding
* chore: add filter tests for autoshard
* chore:update filter API docs for autosharding
* chore: docs changes to indicate sharding impact on pubSubTopic
* fix: handle partial errors during subscribe and return failed content-topic details
* 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
* fix: slice error for index out of bounds
this commit fixes slicing `notConnectedPeers` array with 0 to a negative value of `numPeersToConnect` by first checking if `numPeersToConnect` are greater than 0
* chore: add shard choice simulation test
* feat: add new flags for pubsub and contentTopics and deprecate topic flag
* chore: remove store-resume-peer config and comment out functionality until redesign of store is done
* chore: fix code to use contentTopics value
* fix: use default waku topic only if no other topics are provided in the config