Commit Graph

29 Commits

Author SHA1 Message Date
richΛrd c403388ec2
fix: remove extremely noisy logs (#956) 2023-12-11 11:46:23 -04:00
richΛrd 48ab9e6ce7
fix: number of connected peers per topic (#948) 2023-12-06 09:38:56 -04:00
richΛrd 6ab2cfb53b
fix: take into account the ENR seq to determine if a peer is new or not (#945) 2023-12-06 09:12:48 -04:00
Prem Chaitanya Prathi 9a30c78e1a
fix: add peer api to consider protocols passed (#903) 2023-11-15 20:09:09 +05:30
Prem Chaitanya Prathi 392558ec8e
fix: panic when discv5 is enabled while running service node (#897) 2023-11-14 16:47:49 +05:30
Prem Chaitanya Prathi a5ce5dfaa4
feat: update store client Query API for autosharding (#885) 2023-11-14 04:22:46 +05:30
Prem Chaitanya Prathi 3226def4cf
feat: On Demand Peer Discovery based on shard and service (#834)
* 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>
2023-11-07 22:43:19 +05:30
richΛrd 67d57a36b8
refactor: only log errors different from `ErrNoPeersAvailable` when selecting random peers. (#864)
Includes a minor refactor to not need to use pointers for the peerID
2023-11-03 12:13:38 -04:00
richΛrd c58d0f51e4
fix: race condition in peer connector / manager interaction (#837) 2023-10-25 21:25:56 -04:00
Prem Chaitanya Prathi 6955d01498
Update peer selection options for light protocols (#787)
* Update peer selection options for lightPush

* Update peer selection options for filter

* migrate peer selection functionality from peer manager

Co-authored-by: richΛrd <info@richardramos.me>

---------

Co-authored-by: richΛrd <info@richardramos.me>
2023-10-16 22:12:01 +05:30
Prem Chaitanya Prathi 47c961dcbb
feat: update lightpush API for autosharding (#774)
* 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
2023-09-29 10:43:25 +05:30
Prem Chaitanya Prathi 388f56b43f
feat: Sharded peer management - Relay (#764)
* feat: connect/disconnect to peers based on node topic sub/unsub

* feat: maintain healty relay connections per pubSubTopic

Co-authored-by: richΛrd <info@richardramos.me>

* chore: add config to limit peerstore capacity (#770)
2023-09-27 12:16:37 +05:30
richΛrd 003c90fba8
feat: force unreachability (#753)
Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
2023-09-20 12:24:16 +05:30
Prem Chaitanya Prathi 9b05d48318
Feat : handle dynamic peer topic sub unsub (#751)
* feat: handle dynamic peer join and leave a pubSub topic

Co-authored-by: richΛrd <info@richardramos.me>


---------

Co-authored-by: richΛrd <info@richardramos.me>
2023-09-19 11:35:29 +05:30
harsh jain a650469fae
feat: use CommonService in peerConnector (#737)
* feat(CommonService): add channel and use commonService in discv5

* fix: add mutex to PushToChan

* fix: remove generic functionality

* feat: use CommonService in peerConnector

* fix: remove generic functionality

* nit: add error log
2023-09-19 07:39:39 +07:00
Prem Chaitanya Prathi bfc3083fb1
feat: update WakuPeerStore to store pubSubTopics for a peer (#734)
* feat: update peerStore to store pubSubTopics a peer is linked to

* derive pubSubTopics from ENR

* New API to retrieve peers by shard information
2023-09-14 20:30:06 +05:30
Prem Chaitanya Prathi 8df69279ee
chore:remove duplicate declaration of relay protocol const (#736) 2023-09-14 14:06:08 +05:30
Richard Ramos dcc87cf24f chore(lint): adds `make lint-full` target and fixes some linting errors 2023-09-12 09:54:34 -04:00
Prem Chaitanya Prathi 092811658e
fix: changes as per review comments in #714 and fix test (#717) 2023-09-07 15:01:31 +05:30
Siddarth Kumar 7badb4a37b
Fix panic in peer manager (#714)
* 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
2023-09-07 12:06:43 +05:30
harsh jain 229fb7a970
refactor: peerManager test (#683)
* refactor: peerManager test

* fix: break down and fix peerManager test

* refactor: codeClimate linting for peerManager/ConnectionGater
2023-08-30 21:33:57 +07:00
harsh jain accd9ff3e3
feat: add serviceSlot ds (#684)
* feat: add serviceSlot ds

* test: service slot

* nit: codeClimate related changs

* nit: based on comments

* nit: dont' run getPeers for WakuRelayIDv200
2023-08-30 18:57:22 +07:00
Prem Chaitanya Prathi 67d0b77147
chore: fix frequent logging from poll (#688) 2023-08-28 14:05:59 +05:30
harsh jain 467d1b2ca5
refactor: peerConnector (#665)
* refactor: peerConnector

* fix: code climate and dont waitOn subscriptions PeerData

* fix: check in peerConnector is on outRelay connections

* fix: introduced bug in peerConnector
2023-08-28 13:47:48 +07:00
harsh jain bfbc50eb22
fix: missed passing protocols to addPeer (#682) 2023-08-25 14:42:10 +04:00
Prem Chaitanya Prathi 287d7a014e
fix: fix relay peer calculation (#650) 2023-08-17 18:26:20 +05:30
Prem Chaitanya Prathi 06f027b1a9
feat: implement relay connectivity loop (#642)
* feat: implement relay conenctivity loop

* chore: fix codeclimate issues

* Apply suggestions from code review

Co-authored-by: richΛrd <info@richardramos.me>

* chore:address review comments

---------

Co-authored-by: richΛrd <info@richardramos.me>
2023-08-15 06:57:51 +05:30
Prem Chaitanya Prathi 9f45d271ac
feat: support serviceslots in peermanager (#631)
* feat: support peermanager serviceslots and update store protocol to use serviceslots

* fix: lint errors in test code

* fix: error in nix build due to vendor sha change

* fix: set host in peermanager even if relay is disabled

* chore: fix codeclimate issues

* chore: using common filterPeer function to avoid duplication

* feat:use service slots in other service protocols

* chore: fix codeclimate issues

* chore: move AddPeer to peermanager

* Apply suggestions from code review

Co-authored-by: richΛrd <info@richardramos.me>

* chore:address review comments

* feat: implement RemovePeer #638

* chore: fix test failure

* Support for multiple slots for service peers
Adding discovered peers also moved to peer manager

---------

Co-authored-by: richΛrd <info@richardramos.me>
2023-08-10 18:28:22 +05:30
Prem Chaitanya Prathi 34de2941c7
Feat/peer manager (#596)
* chore: refactor existing code into peer maanger package

* feat: move peer connection related code into peer manager

* feat: in relay peer connection pruning

* feat: add max-connections CLI flag and limit outRelayPeers based on max-connections #621

* tested both in and out relay connection limits

Co-authored-by: richΛrd <info@richardramos.me>

* Review comment, use context to pause connectivity loop during node shutdown.

Co-authored-by: richΛrd <info@richardramos.me>

* address review comments


---------

Co-authored-by: richΛrd <info@richardramos.me>
2023-08-03 21:51:15 +05:30