Commit Graph

385 Commits

Author SHA1 Message Date
Sasha 0263cb80c5
fix: improve node bootstrapping (#2121)
* fix: improve node bootstrapping

* implement dns discovery on failed dials

* update const to match RFC

* up
2024-09-06 01:10:54 +02:00
Sasha f4b6bb04b3
fix: temporarily remove peer cross dependencies (#2123)
* chore: temporarily remove peer cross dependencies

* up lock

* add missing dep
2024-09-06 00:44:59 +02:00
Sasha f9361bf774
chore: release master (#2066) 2024-08-29 11:49:04 +02:00
Sasha a022433851
feat(lightpush)!: return new error messages (#2115)
* feat: return new error messages

* fix test, remove unused

* up

* up

* rollback

* up test
2024-08-29 11:20:19 +02:00
Sasha eadb85ab83
feat: offline state recovery for Filter subscription (#2049)
* up

* fix window reference

* add tests

* up

* add e2e renew test

* address comments

* remove unused

* add test

* try

* remove only

* up test

* up

* remove only

* add tmp logs, use before/after hooks

* up

* fix check

* remove only

* fix test

* up
2024-08-28 18:00:18 +02:00
Danish Arora 69b6612ec9
chore: upgrade node to LTS 20 (#2110)
* chore: upgrade nodejs to new LTS 20

* chore: update other references
2024-08-23 15:57:20 +05:30
Danish Arora 409642d7d3
chore: upgrade libp2p and related packages (#2084)
* chore: upgrade libp2p and related packages

* fix: public key on peer id can now be undefined

* chore: upgrade remainder packages

* chore: fix tests

* chore: address comments

* chore: upgrade playwright and proto
2024-08-14 04:23:04 +05:30
Danish Arora 5ce36c8f18
feat!: deprecate named pubsub topics and use static/auto sharding (#2097)
* feat: deprecate named sharding & protocols adhere
simplify network config type, all protocols use pubsub topic internally

* chore: update tests

* tests: rm application info

* chore: use static sharding and auto sharding terminologies

* chore: update docs for network config

* chore: update interfaces

* tests: update tests error message

* chore: remove `ShardingParams` type and fix test
2024-08-13 05:23:20 +05:30
Danish Arora 86f730f958
feat!: store v3 (#2036)
* feat: write proto

* chore: move store v2 to a subdir

* chore: update v3 proto

* feat: create custom RPC

* feat: implement storev3 core

* chore: set store v3 as default

* chore: move v2 related code

* chore: update v2 imports

* feat: add store-v3 sdk implementation

* fix: rebase

* chore: add ts-doc for store query request params

* chore: update tests for new API

* fix: use nanoseconds instead of millisecond for timerange

* chore: improve store

* chore: remove store v2

* chore: update tests

* chore: fix legacy imports & proto

* tests: remove manual reversal as its part of the API, update incorrect cursor error msg

* chore: update default page size

* chore: account for MAX_PAGE_SIZE from nwaku

* fix: test

* fix: sorting tests
2024-08-06 12:06:37 +05:30
Danish Arora d464af3645
feat: node and protocols health (#2080)
* feat: introduce HealthManager

* feat: make health accessible on Waku object

* feat: update health from protocols

* chore: add access modifiers to healthmanager

* feat: use a HealthManager singleton

* chore: add tests for Filter, LightPush and Store

* feat: add overall node health

* chore: update protocol health to consider Store protocol

* chore: setup generic test utils instead of using filter utils

* tests: add a health status matrix check from 0-3

* chore: increase timeout for failing tests in CI
tests pass locally without an increased timeout, but fail in CI

* chore: move name inference to HealthManager

* tests: abstract away node creation and teardown utils

* fix: import
2024-07-27 18:27:54 +05:30
Danish Arora 169a09d552
chore: enforce access modifiers (#2068)
* feat: introduce eslint flag

* chore: update logger

* chore: update enr

* chore: update core

* chore: update sdk

* chore: update relay

* chore: update discovery

* chore: update message-encryption

* chore: update tests

* chore: fix modifiers

* chore(tests): fix access modifiers

* chore: fix rebase
2024-07-19 15:58:17 +05:30
Danish Arora 9b0f1e855a
feat: validate messages for individual filter nodes & perform renewals (#2057)
* feat: validate messages for individual filter nodes & perform renewals

* chore: fix spell check

* chore: use a max threshold before peer renewal

* chore: switch from a validation cycle timer to adhoc validation

* chore: add test

* fix: test

* chore: address comments

* fix: renewal without a new peer available

* chore: validating messages should be non-blocking

* chore: minor improvements

* chore: rm only

* chore: fix test
2024-07-18 00:41:21 +05:30
Sasha 00635b7afe
feat: fix peer renewal, change Filter keep alive (#2065)
* move util, create stream manager folder

* change default keep alive, improve peer renewal

* address nit
2024-07-16 18:35:24 +02:00
Sasha 09a81302c1
chore: bump @waku peer dependencies (#2062) 2024-07-16 12:00:36 +02:00
dependabot[bot] c0c2907131
chore(deps)(deps): bump fast-check from 3.17.1 to 3.19.0 (#2060)
Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.17.1 to 3.19.0.
- [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.19.0/packages/fast-check)

---
updated-dependencies:
- dependency-name: fast-check
  dependency-type: direct:production
  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>
2024-07-11 23:51:25 +05:30
Sasha ccdf84e593
chore: release master (#2004)
reliability improvements
2024-07-10 17:25:22 +02:00
Danish Arora 93e78c3b87
feat(lightpush): peer management for protocols (#2003)
* chore: make `dropConnection` to be a public function

* feat: peers are maintained for protocols
- passes `ConnectionManager` to ProtocolSDK to allow disconnecting from within protocol
- maintains `numPeersToUse` for each protocol within BaseProtocolSDK

* fix: pass options to protocols

* chore: update interfaces to allow public access

* chore: improve logging on protocol

* fix: renew peer upon failure

* chore(tests): allow DefaultPubsubTopic

* feat(lightpush): write peer management tests

* chore: rename test

* feat: add lock to `maintainPeers()` to handle parallelisation of requests
fixes parallelisation of lightpush.send() requests

* fix: concurrent lightpush requests

* fix: test & improve peers fetching

* chore: use getter

* address comments

* chore: smaller improvements

* feat: attempt to improve time for first lightpush.send()

* chore: use `window.interval` for type-safety

* chore: remove delays

* feat: add autoRetry

* feat: `forceUseAllPeers` to wait for all connected peers to be resoled
2024-06-19 01:52:16 -04:00
Danish Arora 984fb94b5b
fix: failing `node_optional` check (#2025)
* chore: remove predefine nodes list

* remove import

* chore: update & fix test

* chore: remove console logs
2024-06-18 13:43:22 -04:00
gabrielmer 2311a595b2
fix: increasing maxInboundStreams for lightpush from 32 to 100 (#2021)
* increasing maxInboundStreams for lightpush from 32 to 100

* allowing test to fail
2024-05-30 13:58:50 +05:30
Danish Arora e49e7289ae
chore: improve StreamManager (#1994)
* chore: improve stream manager

* chore: some cleaning

* chore: update API

* chore: rename `getConnectionStatus` to `isConnected`

* chore: use throw/catch

* chore: remove await

* remove redundant function and rename

* chore: increase test timeout
2024-05-14 16:31:38 +05:30
Danish Arora 4eb06c64eb
feat(filter)!: return error codes instead of throwing errors (#1971)
* move protocol result type to interfaces

* chore: update type names for verbosity

* feat(filter-core): convert error throws to return types

* chore: update types & imports

* update Filter API

* chore: update createSubscription

* chore: update imports & rename

* chore: update all tests

* chore: resolve conflicts & merge (2/n)

* chore: resolve conflicts & merge (3/n)

* chore: resolve conflicts & merge (4/n)

* chore: resolve conflicts & merge (5/n)

* chore: resolve conflicts & merge (6/n)

* chore: use idiomatic approach

* chore: fix tests

* chore: address comments

* chore: fix test

* rm: only
2024-05-09 16:51:08 +05:30
Sasha 3d92f194a7
chore: release master (#1957) 2024-04-30 17:50:00 +02:00
Arseniy Klempner fb34b7262a
fix: only override ping metadata in peer store (#1984)
Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
2024-04-30 00:39:02 +02:00
Sasha f3627c46a4
feat!: use ShardingParams on subscriptions, make Decoder/Encoder auto sharding friendly by default (#1958)
* fix: use pubsubTopic from current ones if not set

* fix: improve type on dial method

* enforce same pubusb on filter.subscribe, make content topic to pubsub mapping default for decoder / encoder

* fix mapping problem

* update tests

* add error handling

* fix typo

* up lock

* rm lock

* up lock

* remove only

* fix content topic

* fix ephemeral test

* fix filter unsubscribe test

* up utils

* fix subscribe test

* up interfaces and filter api

* remove only

* up ping test

* fix subscribe test

* fix push test

* fix lightPush

* fix multiple pubsub

* remove only, fix subscribe filter test

* remove only

* fix cluster ID selection and named sharding subscription test

* fix unsubscribe test

* fix light push test

* fix light push test

* fix push test

* fix relay publish

* create runNode and fix relay tests

* generalize runNodes, fix some tests

* fix store tests

* fix toAsyncIterator tests

* remove only

* fix lightPush

* use generics

* try fix test

* run failing tests

* remove only

* address failed tests, remove DefaultPubsubTopic dependency in some tests
2024-04-28 11:15:17 +02:00
Arseniy Klempner 9514653428
fix: use correct shard index when creating encoder 2024-04-24 18:40:17 -07:00
Danish Arora 5fb100602b
chore(lightpush)!: move protocol implementation to `@waku/sdk` (1/n) (#1964)
* chore: decouple `Filter` between `core` and `sdk`
moves `SubscriptionManager` to `sdk` side

* chore: update package dependencies
also update peer deps in sdk

* chore: update imports

* chore: update tests

* chore(side-change): update lightpush

* chore: update size-limit import

* chore(sdk): update dependencies
2024-04-19 17:20:34 +05:30
Sasha 01a99ce33c
chore: release master (#1950) 2024-04-09 14:11:20 +03:00
Anton Iakimov 9f2c0ed6b5
chore: switch wakuv2 fleet to waku (#1910)
* chore: switch from decomissioned wakuv2 fleet

* chore: minor fixes + CI

* chore: fix eslint

* fix: eslint

* chore: fix test

---------

Co-authored-by: danisharora099 <danisharora099@gmail.com>
2024-04-07 15:21:00 +03:00
dependabot[bot] 0b54d2e3d7
chore(deps)(deps-dev): bump cspell from 8.6.0 to 8.6.1 (#1930)
Bumps [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) from 8.6.0 to 8.6.1.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v8.6.1/packages/cspell)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 16:42:51 +03:00
Danish Arora bf42c8f53a
chore(store)!: move protocol implementation opinions to `@waku/sdk` (#1913)
* refactor the Store protocol into Core and SDK, simplify `queryGenerator()`

* update imports & types

* chore: `@noble/hashes` moves to `sdk`

* chore: update tests

* chore: update size-limit import path

* fix: cursor tests, use `Cursor` type from `proto.Index` instead of redefining

* export wakuStore from sdk

* fix: imports

* chore: use specific version for package

* chore: handle error for peer access

* use type instead of interface

* rm: comment

* add TODO

* chore!: remove deprecated function definition

* chore: improve logging
2024-04-01 16:47:47 +05:30
dependabot[bot] 0a8382e7a2
chore(deps)(deps): bump p-event from 6.0.0 to 6.0.1 (#1931)
Bumps [p-event](https://github.com/sindresorhus/p-event) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/sindresorhus/p-event/releases)
- [Commits](https://github.com/sindresorhus/p-event/compare/v6.0.0...v6.0.1)

---
updated-dependencies:
- dependency-name: p-event
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 22:34:20 +01:00
dependabot[bot] cb8921e4a2
chore(deps)(deps-dev): bump cspell from 8.3.2 to 8.6.0 (#1927)
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 8.3.2 to 8.6.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v8.3.2...v8.6.0)

---
updated-dependencies:
- dependency-name: cspell
  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>
2024-03-22 23:50:36 +01:00
Danish Arora 877fe1dc1d
feat: peer-exchange uses error codes (#1907)
* setup a generic protocol result type (DRY)

* metadata: use generic

* lightpush: use generic

* peer-exchange: use error codes + generic + update tests

* add issue link to skipped test

* tests: improve while loop readability
2024-03-13 19:33:50 +05:30
Danish Arora 1882023c58
feat(metadata): use error codes (#1904) 2024-03-12 16:40:08 +05:30
Sasha 8f867404e3
feat: add cross peer dependency for @waku packages (#1889)
* move core package

* move dns-discovery

* move enr

* move local discovery

* move message encryption

* move message encryption[2]

* move message-hash

* move peer exchange

* move relay

* move sdk

* move utils
2024-03-12 02:18:40 +01:00
Danish Arora 8deab11890
chore(lightpush)!: move protocol implementation opinions to `@waku/sdk` (#1887)
* chore: restructure @waku/sdk

* chore: introduce `BaseProtocolCore` and `BaseProtocolSDK`

* chore: introduce `LightPushCore` and `LightPushSDK`

* chore: update `relay` for new types

* chore(sdk): update structure

* chore(filter): add `numPeersToUse`

* chore: update tests

* update: size-limit

* chore: update more tests

* attach issue link to TODOs
2024-03-11 18:50:34 +05:30
dependabot[bot] fb41f4c723
chore(deps)(deps): bump @libp2p/ping from 1.0.11 to 1.0.12 (#1892)
Bumps [@libp2p/ping](https://github.com/libp2p/js-libp2p) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/libp2p/js-libp2p/releases)
- [Changelog](https://github.com/libp2p/js-libp2p/blob/main/.release-please.json)
- [Commits](https://github.com/libp2p/js-libp2p/compare/ping-v1.0.11...ping-v1.0.12)

---
updated-dependencies:
- dependency-name: "@libp2p/ping"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 23:10:37 +01:00
Sasha 8eb5703a27
chore: release master (#1881) 2024-03-05 00:11:44 +01:00
dependabot[bot] 4f2c0bcb9e
chore(deps)(deps-dev): bump rollup from 4.9.5 to 4.12.0 (#1870)
Bumps [rollup](https://github.com/rollup/rollup) from 4.9.5 to 4.12.0.
- [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/v4.9.5...v4.12.0)

---
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>
2024-02-29 01:16:50 +01:00
Arseniy Klempner ee2d4176f8
feat: create node and subscription by content topic 2024-02-27 15:37:57 -08:00
Danish Arora 199f6ab2ff
feat: local discovery (#1811)
* initialise the new package

* feat: implement LocalStorageDiscovery

* add: Startable to cspell

* add compliance test

* add: discovery tests

* rm: browser tests script

* address comments

* add type safety to getting peers from local

* only dispatch peer if it does not exist

* move ws ma extraction to utils

* chore: update package name to local-discovery

* fix: add compliance test with no external deps on service node

* use peer:identify instead of peer:update

* add: unit tests & remove sdk dependency

* move tests to self package

* update cspell + remove unrequired deps

* add types

* maintain in-memory peers for localstorage

* address comments

* chore: rename

* use name from options

* fix: saving peers

* rm: only
2024-02-16 20:06:27 +05:30
dependabot[bot] a787e306b9
chore(deps)(deps): bump @libp2p/ping from 1.0.9 to 1.0.11 (#1851)
Bumps [@libp2p/ping](https://github.com/libp2p/js-libp2p) from 1.0.9 to 1.0.11.
- [Release notes](https://github.com/libp2p/js-libp2p/releases)
- [Changelog](https://github.com/libp2p/js-libp2p/blob/main/.release-please.json)
- [Commits](https://github.com/libp2p/js-libp2p/compare/ping-v1.0.9...ping-v1.0.11)

---
updated-dependencies:
- dependency-name: "@libp2p/ping"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-15 19:35:23 +01:00
dependabot[bot] 275499c315
chore(deps)(deps-dev): bump mocha from 10.2.0 to 10.3.0 (#1847)
Bumps [mocha](https://github.com/mochajs/mocha) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v10.2.0...v10.3.0)

---
updated-dependencies:
- dependency-name: mocha
  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>
2024-02-13 22:21:57 +05:30
dependabot[bot] a717708f37
chore(deps)(deps): bump fast-check from 3.15.0 to 3.15.1 (#1837)
Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.15.0 to 3.15.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.15.1/packages/fast-check)

---
updated-dependencies:
- dependency-name: fast-check
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-09 00:06:00 +01:00
Arseniy Klempner e138b4f5c4
feat: decouple sharding params out of core 2024-02-08 08:42:47 -08:00
dependabot[bot] 1c5a359463
chore(deps)(deps-dev): bump @types/uuid from 9.0.7 to 9.0.8 (#1833)
Bumps [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid) from 9.0.7 to 9.0.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

---
updated-dependencies:
- dependency-name: "@types/uuid"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-07 17:07:27 +01:00
dependabot[bot] 749d84d5e4
chore(deps)(deps-dev): bump cspell from 7.3.6 to 8.3.2 (#1825)
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 7.3.6 to 8.3.2.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v7.3.6...v8.3.2)

---
updated-dependencies:
- dependency-name: cspell
  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>
2024-02-05 22:57:20 +01:00
dependabot[bot] 3c0806b224
chore(deps)(deps-dev): bump @types/mocha from 10.0.1 to 10.0.6 (#1824)
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 10.0.1 to 10.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 22:41:46 +01:00
Arseniy Klempner 68d3229644
feat: make ShardingParams optional in sdk, required internally 2024-01-24 07:36:00 -08:00
Danish Arora 7affbe222d
feat: lightpush & filter send requests to multiple peers (#1779)
* feat: lightpush & filter send requests to multiple peers

* build message-hash before core

* chore: restructure folder heirrarchy

* fix: imports

* chore: move @waku/core to dev deps

* feat: create a new `ServiceNodes` wrapper class to encapsulate service node and message collector with redundancy accounted for

* chore(filter): move tests against single service node to a subdir

* feat: support relay, add strict checking, add tests

* fix(filter): handle errors

* chore(tests): add tests for ping

* add tests for push

* chore: abstract redundancy

* feat: add unsubscribe tests

* fix: tests

* add lightpush tests

* fix: imports

* fix: merge & add warning

* merge: master

* fix: breaking tests with master

* address comments

* make num peers configurable

* fix: typo
2024-01-24 18:24:03 +05:30