Commit Graph

334 Commits

Author SHA1 Message Date
Richard Ramos dcc87cf24f chore(lint): adds `make lint-full` target and fixes some linting errors 2023-09-12 09:54:34 -04:00
Richard Ramos db3a2d53b3 fix: log enr only after it has been setup 2023-09-08 17:37:23 -04:00
Richard Ramos cc28267951 feat: append RLN proofs when posting messages in REST/RPC 2023-09-08 14:42:33 -04:00
Richard Ramos be982d8617 chore: add tls/ws to address factory 2023-09-08 12:25:14 -04:00
Richard Ramos 8783cd2f45 chore(rln-relay): use the only key from keystore if only 1 exists 2023-09-08 12:05:32 -04:00
harsh jain 08cabab41f
fix: and optimising fetching membership events (#706)
* 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
2023-09-07 23:23:48 +07:00
Richard Ramos 84fa332e1c fix: allow mixing named and static shards 2023-09-04 10:10:49 -04:00
Richard Ramos e8bd38a023 fix: add back to peerstore dns4 addresses removed by go-libp2p identify 2023-09-01 16:53:07 -04:00
Richard Ramos 9c0bebc859 refactor: use a map to store credentials instead of an array 2023-08-31 15:42:45 -04:00
Richard Ramos 0854edaf3d refactor: keystore as a data type 2023-08-31 15:42:45 -04:00
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 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
Richard Ramos cb3f5da322 feat: rln metrics 2023-08-24 11:26:37 -04:00
Richard Ramos ddb08adbbd chore: set limit to 5000 to not choke eth1 node and start rln before relay 2023-08-24 10:48:22 -04:00
Richard Ramos 624fe1bb2f chore(rln): run rln in all relay pubsubtopics + remove cli flags 2023-08-24 10:48:22 -04:00
Richard Ramos 0b943caaa8 refactor: remove credential registering from waku 2023-08-24 10:37:54 -04:00
Prem Chaitanya Prathi 8a9c4d68e3
feat: register for local node's reachability change (#651)
* feat:Register for reachability change and log status

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

---------

Co-authored-by: richΛrd <info@richardramos.me>
2023-08-20 18:06:35 +05:30
Richard Ramos 2818c3d394 refactor: add libp2p metrics, and make each protocol responsable for defining its own metrics 2023-08-18 13:56:43 -04:00
richΛrd 387ee5f9ac
feat: merkle tree persistence
- use atomic operations API
- resume onchain sync from persisted tree db
- close eth client and db connection appropriately
- pass in the path to the tree db
- fix nwaku compatibility issues
2023-08-18 09:59:37 -04:00
Prem Chaitanya Prathi f263be4a74
fix: race condition in peermgt initialization reported by race detector (#646) 2023-08-16 17:55:58 +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
Vitaliy Vlasov 419adcb6a8
chore(filter2): test updates 2023-08-14 16:29:00 -04:00
Richard Ramos 9e52e09dd5 chore: keepAlive will not immediatly disconnect peers when waking up from sleep, but do it only if pinging the peer fails 2023-08-10 11:16:02 -04:00
Richard Ramos e0e4a2fa87 refactor: remove unused function and simplify code related to creating db and migrations 2023-08-10 10:37:22 -04:00
Richard Ramos ee2af4646c feat: sqlite vacuum and optional migrations 2023-08-10 10:29:40 -04:00
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
Richard Ramos 33344c2ae0 refactor: use uint instead of int for RLN indexes 2023-08-03 11:17:50 -04:00
Richard Ramos a4b038730c feat(rln-relay): pass in index to keystore credentials 2023-08-03 11:17:50 -04:00
Richard Ramos 55ec2347a8 fix: RLN
- subscription to topic is not required for registering RLN validator
- check for duplication msg within same epoch was incorrect
- added an example on how to use RLN
2023-08-01 09:19:38 -04:00
Richard Ramos 8b3f42310d fix: code review 2023-08-01 09:17:11 -04:00
Richard Ramos 76961f2bd8 fix: code review 2023-08-01 09:17:11 -04:00
Richard Ramos bc6a305759 chore: extract `EncapsulatePeerID` 2023-07-07 12:04:05 -04:00
Richard Ramos a124c48b4e fix: add peerID to multiaddr 2023-07-07 12:04:05 -04:00
Richard Ramos 55a7d7b332 fix: reduce timeout and increase minimum backoff time 2023-07-07 12:04:05 -04:00
Richard Ramos 8cac406a4c fix: warning message format when using static shards and named shards at same time 2023-07-07 10:35:12 -04:00
Richard Ramos b26859fc6a refactor: make discovery connector subscribe to discovery services 2023-07-07 09:47:46 -04:00
Richard Ramos 5ca26ef897 fix: allow wakunodes to be restarted without error 2023-07-07 09:47:46 -04:00
Richard Ramos 6ece3c483b feat: subscribe to shards with --topic and refactors
- Shards in same cluster are advertised on ENR
- Store().Resume() was moved to app layer
- NoDefaultWakuTopic() was removed since it's the app that must determine whether it subscribes to the default waku topic
- Removed `Publish` from WakuNode (not really used and easy to implement in app layer if needed)
2023-07-06 11:18:29 -04:00
Richard Ramos cd358c7bd6 refactor: rendezvous 2023-06-28 09:01:41 -04:00
Vitaliy Vlasov f0f3543df8 Modify isOnline setting when LightMode is on and Relay is off 2023-06-22 15:38:40 -04:00
Richard Ramos 76186e5477 refactor: store ENR 2023-06-09 14:57:43 -04:00
Richard Ramos 52ac8e3740 refactor: various
- Limit inbound connections to 10 per IP
- Expose gossipsub parameters on WakuRelay
- New peerstore
2023-06-09 14:57:43 -04:00
Richard Ramos 1bffa35dfa fix: enodeToMultiaddress when using ipv6
Fixes #560
2023-06-01 14:02:18 -04:00
Richard Ramos b66c19ad8f
fix: set autorelay interval to 2 seconds 2023-05-18 12:10:37 -04:00
frank 898f433d2c
fix: dead loop after calling WakuNode.Stop() 2023-05-18 11:22:19 -04:00
Richard Ramos 8d6b2cd721 refactor: add `--ext-ip` and `--dns4-domain-name` values to the list of node multiaddressess 2023-05-15 17:39:58 -04:00
Richard Ramos 9594e54d36 feat: use circuit relay in service node 2023-05-14 13:10:56 -04:00
Richard Ramos ceed9c7d59
feat: v0.6.0 2023-05-12 12:27:14 -04:00
Richard Ramos 25562d6240 feat: add peer connection notif channel and allow dialing peers with the peer.AddrInfo 2023-05-12 09:09:08 -04:00
Richard Ramos e14c55c263 refactor: enr builder 2023-05-09 17:30:26 -04:00
Richard Ramos d9a12bf079 fix: gossipsub parameters, and cancel() execution in wakunode2 2023-05-09 16:42:24 -04:00
Richard Ramos 9b7ad40b06 feat: ext-ip 2023-05-08 11:59:46 -04:00
harsh-98 31c8035589 feat: safe broadcaster 2023-05-08 08:31:19 -04:00
Richard Ramos 966cbba4c4 feat: utils for handling shards in enr 2023-04-25 10:54:59 -04:00
Richard Ramos 2c3566377a refactor: inject host on node start 2023-04-17 11:09:05 -04:00
Richard Ramos fbd58df2e8 refactor: initialize broadcaster on Start 2023-04-17 10:19:08 -04:00
Richard Ramos 0b01e4bb16 refactor: rename filter to legacy filter and set filterv2 as filter 2023-04-17 10:07:15 -04:00
Richard Ramos e74f60f173 feat: enable webstransport 2023-04-14 12:34:47 -04:00
Richard Ramos 801ec92c11 refactor: loading credentials and chat2 2023-04-11 10:39:07 -04:00
Richard Ramos 42c0e123d9 refactor: credentials 2023-04-11 10:39:07 -04:00
Richard Ramos 04c90657cd refactor: dynamic rln 2023-04-11 10:39:07 -04:00
Richard Ramos 9c5d1e88b1 refactor: proof generation and merkleroot tracking 2023-04-04 14:20:41 -04:00
Richard Ramos be09f3f550 refactor: static RLN relay 2023-04-04 14:20:41 -04:00
Richard Ramos 7c56ceb139 chore: remove swap protocol 2023-03-30 12:12:41 -04:00
Richard Ramos dd9261c981 fix: simplify code by using mutex instead of channels 2023-03-30 12:00:19 -04:00
Richard Ramos c5faf8b9e9 fix: race condition deleting items from cache 2023-03-30 12:00:19 -04:00
Richard Ramos ca20eb4a79 feat: connect to discovered peers 2023-03-29 08:59:36 -04:00
Richard Ramos 2b30726c14 feat: rendezvous client 2023-03-29 08:59:36 -04:00
RichΛrd 8826e2df66
feat: rendezvous server 2023-03-09 11:48:25 -04:00
Richard Ramos 4b52983fc4 fix: limit number of subscribers and criteria 2023-03-08 09:51:26 -04:00
Richard Ramos 3bba1a86f1 feat(message): added waku message deterministic hashing 2023-03-08 09:08:08 -04:00
Richard Ramos cedaa670c7
fix: logLevel 2023-02-24 12:02:00 -04:00
RichΛrd 042521e00b
fix: set a max length for the multiaddr field (#474) 2023-02-23 19:43:04 -04:00
Richard Ramos f0eaa84aad chore: upgrade dependencies 2023-02-16 12:22:47 -04:00
Richard Ramos 335f7b6771 test: filterv2 2023-02-15 17:36:30 -04:00
Richard Ramos 52f7c8d86e feat: improvements on filter protocol (client) 2023-02-15 17:36:30 -04:00
Richard Ramos f255adffd9 feat: improvements on filter protocol (server) 2023-02-15 17:36:30 -04:00
Richard Ramos eb9e727b1b feat: advertise custom multiaddresses
This replaces the flag `--advertise-address` with `--ext-multiaddr`
2023-02-12 11:01:11 -04:00
RichΛrd c55a979af4
fix: close channel after waiting for goroutines to stop (#444) 2023-02-09 09:03:05 -04:00
Richard Ramos cce85913e6 fix: enr exceeds 300 bytes 2023-02-07 09:51:55 -04:00
Richard Ramos c3b5ab95ab fix: try to include as many multiaddr as possible without exceeding max enr size 2023-02-01 21:11:16 -04:00
Richard Ramos 676a1ab361 fix: adding circuit relay information to enr 2023-02-01 21:11:16 -04:00
Richard Ramos 61cba076bb feat: set zap core when using `WithLogger` 2023-02-01 19:38:04 -04:00
Anthony Laibe 5ff87d8e65 fix: add lock when deleting peer 2023-01-30 07:28:41 -04:00
Richard Ramos 2936a98923 fix: only lock keepAlive mutex when necessary 2023-01-26 16:16:34 -04:00
Richard Ramos 6c989fb178 refactor(c-bindings): do not subscribe automatically to default waku topic 2023-01-25 17:46:32 -04:00
Richard Ramos e0ccdbe966 refactor: peer discovery management for discv5 and peer exchange 2023-01-17 17:40:48 -04:00
Richard Ramos 6e7c3b6183 feat: update localnode ENR without having to restart discv5 2023-01-14 10:35:24 -04:00
Richard Ramos c87da46ce6 feat: use backedoff connector and discovery 2023-01-12 17:35:04 -04:00
Richard Ramos 7d2a0ac0e2 fix: discv5 was not being registered as discovery mechanism 2023-01-10 08:46:57 -04:00
Richard Ramos 69636fa263
fix: simplify addr factory 2023-01-08 17:12:29 -04:00
Richard Ramos 607bf07198 refactor: remove some duplication and unneeded code 2023-01-08 14:35:32 -04:00
Richard Ramos 40675ff204 refactor: service interface 2023-01-07 11:25:32 -04:00
Richard Ramos f10b1b0d7a feat: postgresql support 2023-01-05 13:25:15 -04:00
Richard Ramos ea6d5bc7b8 fix: enable store only when `WithWakuStore` is used 2023-01-03 11:26:23 -04:00
Richard Ramos e69d6e61dd fix: nil msg 2022-12-21 14:59:29 -04:00
Richard Ramos 5740a6d571 refactor: move payload handling to its own package 2022-12-15 21:55:14 -04:00
Richard Ramos 83fd53d432 refactor: use context instead of quit channel 2022-12-10 11:51:08 -04:00
Richard Ramos d64c4aedc4
fix: examples and making resume nodes optional 2022-12-09 14:28:08 -04:00