32 Commits

Author SHA1 Message Date
Danish Arora
477c2a5918
feat!: protocols filter peers as per configured shard (#1756)
* merge: master

* fix: tests

* update: interfafces

* rm: comments

* metadata: store peerIdStr instead of peerId

* chore(utils): move fast-utils to dev deps

* fix: allow autosharding nodes to get peers (#1785)

* fix: merge

* fix: build

* fix: failing tests from master merge

---------

Co-authored-by: Arseniy Klempner <arseniyk@status.im>
2024-01-19 20:42:52 +05:30
Arseniy Klempner
ae7bc3eeec
chore: bump all libp2p packages to latest version 2024-01-17 11:59:08 -08:00
Danish Arora
bbd372120a
chore: update all references of shard info to RFC terminology (#1740)
* update all references of shard info to RFC terminology

* bump nwaku to v0.22.0 (#1741)
2023-11-29 17:37:59 +05:30
Danish Arora
0f7d63ef93
feat: Logger with log levels (#1672)
* setup a custom Logger with log level support

* refactor codebase for to use new Logger with log levels

* disallow usage of `debug` directly / only allow usage in/through custom Logger

* remove `debug` from logger
2023-10-20 16:36:47 +05:30
Danish Arora
124a29ebba
feat(static-sharding): filter peer connections per shards (#1626)
* add interface for `ShardInfo`

* enr: add deserialization logic & setup getters

* add sharding related utils

* utils: add shard<-> bytes conversion helpers

* pass `pubSubTopics` to `Waku`

* add `rs`/`rsv` details during discovery

* connection-manager: discard irrelevant peers

* add tests for static sharding - peer exchange

* update `ConnectionManager` tests to account for topic validity

* add js suffix to import

* address some comments

* move shardInfo encoding to ENR

* test: update for new API

* enr: add tests for serialisation & deserialisation

* address comment

* update test

* move getPeershardInfo to ConnectionManager and return ShardInfo instead of bytes

* update encoding and decoding relay shards to also factor for shards>64

* relay shard encoding decoding: use DataView and verbose spec tests

* improve tests for relay shard encoding decoding

* rm: only

* improve log message for unconfigured pubsub topic

* minor improvement

* fix: buffer <> Uint8array problems with shard decoding

* fix: test

* rm: only
2023-10-10 20:18:02 +05:30
Danish Arora
87717981eb
chore: upgrade libp2p and related deps (#1482)
* chore: update noise

* update: package.lock

* update: @chainsafe/libp2p-gossipsub

* rm unwanted libp2p interface deps & bump up libp2p

* refactor code for new deps

* update: new package.lock

* setup prettier, refactor eslint  and rm trailing commas

* update package.lock

* fix build

* import type for interface

* fix imports for merge

* update typedoc exports

* add: CustomEvent import

* use new libp2p interface

* add aegir as dev dep for tests
2023-08-16 20:18:13 +05:30
Sasha
51f9261a16
chore: update dependencies (#1460)
* update to latest prettier

* fix with prettier: added trailing comma

* remove deps from test package, add sinon types, fix type hack in a test, update esling prettier config

* update typescript eslint plugins

* update package-locks
2023-08-11 15:14:02 +02:00
Danish Arora
376bcf2a0a
chore: new eslint rules (#1416)
* add new eslint rules

* remove eslint scripts for build-utils

* refactor all files to fix breaking changes with new rules

* add a basic eslintrc for build-utils

* test

* fix more linting errors

* test

* update package.lock

* update stopping container

* update px node spec

* enable tests

* fix: conn manager events

* fix: peer exchange

* increase timeout on px test
2023-07-24 16:04:24 +05:30
fryorcraken.eth
94940411b0
fix: ensure that websocket multiaddrs are returned from ENR (#1275)
Closes: #1271

Co-authored-by: Danish Arora <35004822+danisharora099@users.noreply.github.com>
2023-03-28 22:44:03 +05:30
Danish Arora
a30b2bd747
chore!: add exports map to @waku/utils (#1201)
* add exports map

* merge: master

* export  subdir with default export path

* import according to the export path
2023-03-14 10:10:38 +05:30
fryorcraken.eth
b3228a2dfe
chore: refactor delete undefined logic 2023-03-14 11:07:57 +11:00
fryorcraken.eth
5a8de54d50
chore: remove some code duplication 2023-03-14 11:07:57 +11:00
fryorcraken.eth
1181eadcf8
doc: fix references in comments 2023-03-10 10:23:39 +11:00
fryorcraken.eth
81ad14cad3
chore: segregate basic access to fields and more advanced logic
Move basic access to ENR fields (with conversion) to `RawEnr`

`ENR` inherits from `RawEnr` and add a layer of logic.
2023-03-10 10:23:39 +11:00
fryorcraken.eth
6dbcde041a
chore!: directly convert from ENR to PeerInfo, remove unneeded utility 2023-03-10 10:23:39 +11:00
fryorcraken.eth
84f114bfa4
chore: extract and simplify getLocationMultiaddr
Using switch/case when appropriate.
2023-03-10 10:23:39 +11:00
fryorcraken.eth
af5c5733a5
chore: split functions 2023-03-10 10:23:39 +11:00
fryorcraken.eth
22ffcf571a
chore!: extract encoder code
Separation of concerns by moving encoding logic in new class.
2023-03-10 10:23:39 +11:00
fryorcraken.eth
130c49b636
chore!: extract decoder code
Separation of concerns by moving decoding logic in new class.
2023-03-10 10:23:38 +11:00
fryorcraken.eth
8fd1455122
chore: extract test code
createFrom* functions are only used in test.
By extracting them in different class it should help
bundlers.
2023-03-10 10:23:38 +11:00
fryorcraken.eth
031f4c0c21
chore: improve function name
By describe why one would use it.
2023-03-10 10:23:38 +11:00
fryorcraken.eth
a513087637
chore: remove functions not used in prod 2023-03-10 10:23:38 +11:00
fryorcraken.eth
93ba160791
chore: remove unused keypair api 2023-03-10 10:23:38 +11:00
fryorcraken.eth
46a020c6b4
chore: split function as one part was only used in test 2023-03-10 10:23:38 +11:00
fryorcraken.eth
05b122e646
chore: remove unnecessary functions 2023-03-10 10:23:38 +11:00
fryorcraken.eth
6f3a6d00d8
chore: fix dependencies for @waku/enr 2023-02-09 19:31:12 +11:00
Danish Arora
b33306655a
chore: move libp2p and byte utils to a single utils package (#1149)
* move libp2p and byte utils to a single `utils`
package

* set package version to 0.0.1
2023-02-06 11:22:36 +05:30
fryorcraken.eth
f48278adce
chore: remove waku dep from @waku/interfaces by defining IEnr
@waku packages are expected to (dev)depend on @waku/interfaces to
implement them. Hence, to avoid possible cyclic (dev)dependency, define
IEnr interface and use it as a type across @waku/packages.
2022-12-21 15:40:34 +11:00
fryorcraken.eth
88c6ec6ef4
chore: add '.js' extensions to local import
As per ESM standard.
2022-12-02 15:54:30 +11:00
fryorcraken.eth
d78a40f273
chore: fix dns-discovery build 2022-11-03 21:37:55 +11:00
fryorcraken.eth
9cc32c1032
tests: fix karma 2022-11-03 14:24:08 +11:00
fryorcraken.eth
f7f28f03b0
feat!: extract dns discovery and enr from core 2022-11-03 14:24:08 +11:00