Commit Graph

254 Commits

Author SHA1 Message Date
Danish Arora 785df528fe
fix: improve connection manager error handling + edge cases (#1450)
* increase TTL on discovery classes

* refactor dialPeer to handle edge cases

* address comment
2023-08-02 13:49:48 +05:30
Danish Arora 0b8936f1f1
feat: ConnectionManager extends EventEmitter & exposed on the Waku interface (& minor improvements) (#1447)
* move KeepAliveOptions to dedicated interface file

* update export for KeepAlive

* expose `ConnectionManager` on the waku node

* update ConnectionManager test to use the exposed API

* rm: only for the test
2023-07-31 13:54:39 +05:30
balag3 30fcacea84
fix: Refactors message decoding to abort as soon as a suitable decoder found (#1414)
* Refactors message decoding to abort as soon as a suitable decoder found. #1369

* fix: return from the function

* improve readability

---------

Co-authored-by: Danish Arora <35004822+danisharora099@users.noreply.github.com>
Co-authored-by: danisharora099 <danisharora099@gmail.com>
2023-07-28 13:09:11 +05:30
dependabot[bot] 89392dbfdf
chore(deps)(deps-dev): bump karma-chrome-launcher from 3.1.1 to 3.2.0 (#1441)
Bumps [karma-chrome-launcher](https://github.com/karma-runner/karma-chrome-launcher) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/karma-runner/karma-chrome-launcher/releases)
- [Changelog](https://github.com/karma-runner/karma-chrome-launcher/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma-chrome-launcher/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: karma-chrome-launcher
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-28 00:42:12 +05:30
fryorcraken.eth 92238136de
chore: release master (#1410) 2023-07-26 21:47:04 +02:00
Danish Arora 6ce898d771
feat: enable event emission for peer discovery/connection in ConnectionManager (#1438)
* disable libp2p autodial

* improve logs for peer-exchange

* add a function to fetch discovered and connected peers by discovery

* connection-manager: introduce event emissions by discovery

* write a spec test for events

* minor code improvement for peer-exchange

* rm: comment

* rename peer event result interface

* switch to using libp2p EventEmitter

* rename variables for readability

* reset peer-exchange spec file

* address review

* test: minor refactor

* fix: failing test

* increase peer IDs to test against for attemptDial

* improve structuring
2023-07-26 22:51:55 +05:30
Danish Arora 96b111d07d
disable libp2p autodial (#1437) 2023-07-26 12:20:51 +05:30
Danish Arora d483644a4b
chore!: remove filter v1 (#1433)
* rm: v1

* fix v2 imports

* remove tests for filter v1

* set filter v1 as default and rm v2 completely

* change import name for filter v2

* rename FilterV2 to Filter completely

* fix run check
2023-07-26 11:30:48 +05:30
Sasha 420e6c698d
feat!: upgrade to libp2p@0.45 (#1400)
* upgrade libp2p version, partially update protocols, rename to IBaseProtocol

* complete transition for protocols

* complete transition of connection maanger

* finish sdk

* complete core

* complete relay

* complete peer-exchange

* complete dns-discovery

* add components field to Libp2p interface and use it in core

* add type hack for Libp2p creation:

* finish waku node test

* complete relay test

* complete peer exchange

* complete dns peer discovery test

* add missing dependency to relay

* fix new peer store integration

* improve initialization of pubsub

* add catch for missing peer

* update test and remove extra dependency

* prevent error throw

* fix edge case with peerStore

* fix peer exchange

* fix protocols used

* fix test with another evnet

* bump libp2p and interfaces

* add missing package

* fix peer-exchange problem

* prefer libp2p peerDiscovery for integration tests

* fix import

* increate timeout

* return test against Test fleet

* remove await for peer:update

* increase timeout

* add await for peerStore

* comment event for testing

* fix lint

* remove bind

* fix stub

* decouple to separate test case

* move back to explicit build

* remove only

* do not test event
2023-07-25 02:17:52 +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
Danish Arora d2f675d690
feat: spec test for connection manager (#1417)
* add sinon

* use new API for libp2p to attach event listener

* add a test for event emitter/listening

* add tests to check peer dials happen as expected for bootstrap peers

* add tests for peer-exchange

* remove only and run all tests

* chore: rm extra packages

* chore(deps): revert temp

* chore(deps): revert temp

* add sinon

---------

Co-authored-by: jacques metevier <jmetevier@gmail.com>
2023-07-24 12:08:54 +05:30
Danish Arora 2cd04a1315
Merge branch 'master' into chore--rm-extra-packages 2023-07-15 17:57:12 +02:00
Danish Arora cae38fdab4
update fleet nodes port to use 8000 (#1420) 2023-07-06 15:31:55 +01:00
fryorcraken.eth 614893ca98
chore: release master (#1393) 2023-06-17 01:26:12 +02:00
jacques metevier 0d0b25ae75 chore(deps): revert temp 2023-06-08 12:05:22 -07:00
jacques metevier 5f927a7243 chore: rm extra packages 2023-06-08 11:52:27 -07:00
Danish Arora f32d7d9fe0
feat: allow passing of multiple ENR URLs to DNS Discovery & dial multiple peers in parallel (#1379)
* allow passing of multiple ENRs to DNS Discovery

* add test for >1 ENR to DNS Disc

* address comments

* feat: dial multiple peers in parallel (#1380)

* ensure discovered peers are dialed in parallel

* cap parallel dials

* drop connection to bootstrap peer if >set connected

* switch to american english

* improve promises and error logging
2023-06-08 14:26:29 +02:00
fryorcraken.eth 44496f0158
chore: bump eslint to 8.41.0
Also ensures that eslint is present in packages that uses it and removed
from packages not using it.
2023-06-06 16:07:49 +10:00
dependabot[bot] d51030719c
chore(deps)(deps): bump it-all from 3.0.1 to 3.0.2
Bumps [it-all](https://github.com/achingbrain/it) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/achingbrain/it/releases)
- [Commits](https://github.com/achingbrain/it/compare/it-all-v3.0.1...it-all-v3.0.2)

---
updated-dependencies:
- dependency-name: it-all
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 16:07:51 +00:00
Danish Arora 951ebdac9d
feat!: rename package from @waku/create to @waku/sdk (#1386)
* feat!(@waku/sdk): rename package from @waku/create to @waku/sdk

* feat: proxy @waku/core and @waku/utils through @waku/sdk

* address comments

* update package-lock

* Update .size-limit.cjs

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* integrate to release please

---------

Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
Co-authored-by: Sasha <oleksandr@status.im>
2023-06-05 13:40:13 +02:00
dependabot[bot] 9e9fbc9b0a
chore(deps)(deps): bump it-pipe from 2.0.5 to 3.0.1
Bumps [it-pipe](https://github.com/alanshaw/it-pipe) from 2.0.5 to 3.0.1.
- [Release notes](https://github.com/alanshaw/it-pipe/releases)
- [Changelog](https://github.com/alanshaw/it-pipe/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alanshaw/it-pipe/compare/v2.0.5...v3.0.1)

---
updated-dependencies:
- dependency-name: it-pipe
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-02 16:05:51 +00:00
dependabot[bot] 81c34eb3ba
chore(deps)(deps-dev): bump @typescript-eslint/parser (#1387)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.54.1 to 5.59.8.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.59.8/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-02 01:41:19 +05:30
fryorcraken.eth 24811e4ffc
chore: release master (#1376) 2023-06-01 21:50:52 +02:00
dependabot[bot] be5dde787b
chore(deps)(deps-dev): bump puppeteer from 19.8.2 to 20.4.0 (#1383)
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 19.8.2 to 20.4.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.8.2...puppeteer-v20.4.0)

---
updated-dependencies:
- dependency-name: puppeteer
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-26 13:44:24 +05:30
fryorcraken.eth 3b31004eb9
chore: removed unused pretest scripts 2023-05-24 10:44:08 +10:00
Danish Arora 8d0e647966
feat!: filter v2 (#1332)
* implement proto

* implement filter v2

* add tests

* minor improvements
- make unsubscribe functions private in
filter
- enable all tests

* enable all tests

* readd multiaddrinput

* address comment removals

* unsubscribe based on contentFilters passed

* update unsubscribe function parameters in test

* reset interfaces & filter v1

* refactor filterv2 into 2 classes
- removes generics from types on filter which means
manual typecasting to filter version is required on
consumer side
- defaults to filterv2
- splits filterv2 into 2 classes:
  - one to create the subscription object with a
peer which returns the second class
  - the other to manage all subscription functions

* updates filter tests for the new API
- also fixes an interface import

* update `toAsyncIterator` test for Filter V1

* implement IReceiver on FilterV2

* remove return values from subscription functions

* update `to_async_iterator`

* address variable naming

* add tsdoc comments for hidden function

* address minor comments

* update docs to default to filter v2

* address comments

* rename `wakuFilter` to `wakuFilterV1`

* chore: Remove static variables (#1371)

* chore: Remove static variables

- Remove internal types from `@core/interfaces`
- Remove data being redundantly stored (pubsub topic)
- Remove usage of static variables
- Clean up callbacks and decoders when using `unsubscribe`
- Clean up callbacks and decoders when using `unsubscribeAll`

* fix setting activeSubscription

---------

Co-authored-by: danisharora099 <danisharora099@gmail.com>

* make activeSub getter and setter private

* update size-limit

---------

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
2023-05-23 16:06:46 +05:30
fryorcraken.eth b25f7e0acf
chore: release master (#1343) 2023-05-19 13:38:52 +02:00
Sasha 72f97d4545
feat: add 1MB restriction to LightPush and Relay (#1351)
* add 1MB restriction to LightPush and Relay

* fix condition

* improve lightPush test

* update test

* add isomorphic-webcrypto

* import module

* add errors to SendResult and tests

* fix lint
2023-05-17 23:40:52 +02:00
dependabot[bot] 27657e45a1
chore(deps)(deps-dev): bump typescript from 4.9.5 to 5.0.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.5 to 5.0.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.5...v5.0.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-17 05:58:36 +00:00
Stuart 97d5659c47
chore: update ecmascript version (#1352)
* updates to ES2022

* 🚿 cleanup
2023-05-16 14:19:44 +05:30
Danish Arora 50c2c2540f
feat!: @waku/relay (#1316)
* move constants & core's func to @waku/utils

* setup @waku/relay

* use @waku/relay for create

* address: principal review

* fix: size-limit

* move all constants to @waku/core

* move TopicOnlyDecoder to relay

* merge: master

* fix: tests

* Move constants out of core (#1340)

* update package.lock

* change constants folder into a ts file

* use dependency version as * instead of version number

* add constants import from @waku/core

* add empty changelog file for relay

---------

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
2023-05-11 14:08:00 +05:30
Danish Arora f4e31019e1
fix: improve logging for connection manager (#1303)
* merge: master

* fix: CI

* use: js script instead of shell script to run precheck and mocha

* improve logging when dial fails

* use hashmap for errors instead of redeclaring variable
2023-05-11 13:35:58 +05:30
fryorcraken.eth 55ed6e3765
chore: fix import 2023-05-11 15:04:23 +10:00
fryorcraken.eth af927933a9
chore: release master (#1296) 2023-05-09 20:54:20 +02:00
Sasha 7daa9d05bf
feat: toSubscriptionIterator impl for IReceiver (#1307) 2023-05-09 20:15:37 +02:00
dependabot[bot] df8e68ff36
chore(deps)(deps): bump it-length-prefixed from 8.0.4 to 9.0.1
Bumps [it-length-prefixed](https://github.com/alanshaw/it-length-prefixed) from 8.0.4 to 9.0.1.
- [Release notes](https://github.com/alanshaw/it-length-prefixed/releases)
- [Changelog](https://github.com/alanshaw/it-length-prefixed/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alanshaw/it-length-prefixed/compare/v8.0.4...v9.0.1)

---
updated-dependencies:
- dependency-name: it-length-prefixed
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-06 14:07:05 +10:00
fryorcraken.eth c9e7af470d
fix: enum used from this dependency 2023-05-06 13:25:34 +10:00
dependabot[bot] 26c0500d79
chore(deps)(deps-dev): bump fast-check from 3.7.1 to 3.8.1
Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.7.1 to 3.8.1.
- [Release notes](https://github.com/dubzzz/fast-check/releases)
- [Changelog](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/CHANGELOG.md)
- [Commits](https://github.com/dubzzz/fast-check/commits/v3.8.1/packages/fast-check)

---
updated-dependencies:
- dependency-name: fast-check
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-06 03:19:13 +00:00
Sasha 4615b51568
feath: use sha256 for Relay msgIdFn (#1322) 2023-05-05 18:26:54 +02:00
dependabot[bot] f1c63ee069
chore(deps)(deps-dev): bump prettier from 2.8.7 to 2.8.8
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.7 to 2.8.8.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.7...2.8.8)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-04 16:24:58 +00:00
dependabot[bot] e4e719e29b
chore(deps)(deps-dev): bump rollup from 3.19.1 to 3.21.3 (#1324)
Bumps [rollup](https://github.com/rollup/rollup) from 3.19.1 to 3.21.3.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.19.1...v3.21.3)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-04 11:29:08 +05:30
dependabot[bot] 52eb7bbe74
chore(deps)(deps-dev): bump @rollup/plugin-node-resolve
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 15.0.1 to 15.0.2.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/node-resolve-v15.0.2/packages/node-resolve)

---
updated-dependencies:
- dependency-name: "@rollup/plugin-node-resolve"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-27 16:04:28 +00:00
dependabot[bot] 8e7e5dfbb2
chore(deps)(deps): bump it-all from 2.0.1 to 3.0.1
Bumps [it-all](https://github.com/achingbrain/it) from 2.0.1 to 3.0.1.
- [Release notes](https://github.com/achingbrain/it/releases)
- [Commits](https://github.com/achingbrain/it/compare/it-all-v2.0.1...it-all-v3.0.1)

---
updated-dependencies:
- dependency-name: it-all
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-26 16:04:20 +00:00
Sasha 763dc0125d
feat: add mapping function to multiaddr of peerid (#1306)
* feat: add mapping function to multiaddr of peerid

* remove unused
2023-04-19 20:03:27 +02:00
Danish Arora dc3774c0ed
feat: use nwaku/go-waku docker images instead of building binaries (#1259)
* merge: master

* fix: CI

* use: js script instead of shell script to run precheck and mocha

* use `console.log` instead of `debug.log` for `run-tests.js`
2023-04-17 10:29:36 +05:30
dependabot[bot] 49dedfbd5b
chore(deps)(deps-dev): bump prettier from 2.8.4 to 2.8.7
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.4 to 2.8.7.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.4...2.8.7)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 05:01:50 +00:00
fryorcraken.eth bd9d07394f
feat: ensure content topic is defined
Waku Messages are considered invalid if the content topic is undefined
or an empty string.

Avoid user error by throwing.
2023-04-04 14:56:59 +10:00
Sasha 6abee4880f
chore: use root .prettierignore (#1285)
* use root .prettierignore for fix and check
2023-04-03 23:39:59 +02:00
fryorcraken.eth 17ae7e5312 chore: release master 2023-04-03 16:15:39 +10:00
Sasha e11e5b4870
feat!: add and implement IReceiver (#1219)
- remove extend Relay by GossipSub and use it as public property;
- detach GossipSub initialisation;
2023-03-31 03:17:41 +02:00