Commit Graph

114 Commits

Author SHA1 Message Date
Sasha 8f56d90cf1
fix: import of base_protocol and networkConfig type guard (#2109)
* bug: fix import

* fix type guard
2024-08-23 11:44:55 +02:00
Sasha 2beb359cef
chore: enabile back filterAll if set by consumer (#2103) 2024-08-22 15:55:29 +02:00
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 fdd9dc44a4
feat(filter)!: new simpler filter API (#2092)
* chore: rename IReceiver subscribe

* feat!: new `subscribe() API that only takes in decoders and callback

* chore: `to_async_iterator` uses new function name

* chore: make `createSubscription` private, and shorten error handling

* chore: update subscribe return type

* tests: use new API

* fix: tests
2024-08-05 15:52:58 +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
gabrielmer 08fc2d133a
chore: changing default pubsub topic to its static sharding version (#2083)
* changing default pubsub topic to its static sharding version

* keeping RFC's Waku Message test vectors

* reverting change in changelog

* setting pubsub topic when creating nwaku node

* adding shardInfo to runMultipleNodes call

* adding shardInfo to runMultipleNodes call in lightpush tests

* add pubsub topics to nwaku.start

* get rid of it.only that remained

* fixing compliance tests

* setting clusterId to 0

* removing unnecessary fix

* adding shardInfo when creating nodes

* fixing wait for remote peer tests

* fixing peer exchange test

* refactor

* removing unnecessary variable

* feat: create default shard info, update tests (#2085)

* feat: create default shard info, update tests

* add link

* fix tests

* remoe only

* up tests

* up test

---------

Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
2024-07-26 00:21:52 +02:00
Sasha 04bd518210
chore: remove content_topic specific API (#2081) 2024-07-23 17:25:36 +02:00
Sasha 2b02f829c2
chore: throw if more than one network config is passed (#2056)
* chore: throw if more than one network config is passed

* up

* update init

* up message

* improve project structure

* address nit
2024-07-19 19:35:00 +02:00
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
Sasha ccdf84e593
chore: release master (#2004)
reliability improvements
2024-07-10 17:25:22 +02:00
Danish Arora 318667e442
feat(filter): peer/subscription renewal with recurring Filter pings (#2052)
* chore: renewPeer() returns the new found peer

* feat: ping & peer renewal

* chore: add tests

* fix: tests

* chore: remove only

* chore: remove comments

* chore(tests): decrease timeout

* chore: add array index validation

* chore: remove only

* chore: move defaults into a separate variable

* chore: update lightpush with new API

* chore: include peer renewals within `ping` instead of `interval`

* chore: update tests

* chore: add new test

* chore: address comments
2024-07-10 15:34:16 +05:30
Danish Arora 4db508b962
feat(filter): use protocol peer management (#2047)
* feat: leverage protocol peer management

* chore: add test

* chore: address comments

* chore: add todo
2024-07-03 12:09:34 +05:30
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 16e9116c7c
fix: bootstrapping with default pubsub topic (#2031)
* fix: bootstrapping into default pubsub topic

* chore: update tests

* chore: update TODO with GH issue

* chore: rename fleets

* feat: use TWN fleets, or wakuv2.prod if DefaultPubsubTopic

* chore: update imports for enrtree
2024-06-06 12:55:57 -04:00
Arseniy Klempner 6f188ef379
fix: add .js to base protocol import in filter sdk (#2009) 2024-05-14 13:06:10 +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
Arseniy Klempner 682cc66232
fix: filter for wss in libp2p websocket transport 2024-04-30 20:18:11 -07:00
Sasha 3d92f194a7
chore: release master (#1957) 2024-04-30 17:50:00 +02:00
Sasha 5b03709dfe
feat: lift contentTopics and make shardInfo mandatory for createLight… (#1959)
* feat: lift contentTopics and make shardInfo mandatory for createLightNode

* add default shard info and wanring

* fix

* fix lint

* fix

* fix types

* remove breaking changes
2024-04-30 01:47:45 +02:00
Sasha 1a6bc4f8ce
feat: add keep alive to Filter (#1970)
* 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

* feat: implement keep alive for filter subscription

* remove

* address comments
2024-04-29 23:31:09 +02:00
Arseniy Klempner fa523b78af
feat: add libp2p option for max ping connections 2024-04-29 08:21:37 -07: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
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
Sasha 8763173d2e
fix: make rollup replace env var (#1951)
* fix: make rollup replace env var

* up version

* up package name

* up name

* update replace pattern
2024-04-09 13:43:28 +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
Danish Arora 86058c59a1
chore: remove stale references to deprecated packages (#1936) 2024-04-07 14:19:47 +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] 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
Václav Pavlín def8a259ca
bug: check if process is defined before accessing it 2024-03-15 22:02:12 +01:00
Danish Arora 1882023c58
feat(metadata): use error codes (#1904) 2024-03-12 16:40:08 +05:30
Danish Arora 1e86c3d63e
feat!: @waku/discovery (#1876)
* initialise the new package

* move dns-discovery

* move peer-exchange

* move local-peer-cache-discovery

* add polyfill for node - dynamic import

* update size-limit

* update release-please

* chore: update pacakge desc

* chore: cleanup

* add peer-exchange and local peer cache to size-limit
2024-03-12 15:56:49 +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
Sasha 9f198dd149
feat: add bootstrapPeers option and refactor sdk (#1871)
* move relay related code

* move libp2p to utils

* define CreateWakuNodeOptions

* improve options

* make libp2p use from create function

* add bootstrapPeers option

* fix lint

* fix types, imports

* fix exports

* use bootstrap along default bootstrap

* fix test as REST does not return peer though connection is made

* rollback condition change

* enable gossipSub back for every node
2024-03-04 10:56:20 +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
Danish Arora f3cb10d484
chore!: rename local-discovery to local-peer-cache-discovery (#1867) 2024-02-29 01:05:54 +05:30
Arseniy Klempner ee2d4176f8
feat: create node and subscription by content topic 2024-02-27 15:37:57 -08:00
dependabot[bot] 6d3ed304a8
chore(deps)(deps): bump @chainsafe/libp2p-gossipsub (#1866)
Bumps [@chainsafe/libp2p-gossipsub](https://github.com/ChainSafe/js-libp2p-gossipsub) from 11.1.0 to 12.0.0.
- [Release notes](https://github.com/ChainSafe/js-libp2p-gossipsub/releases)
- [Changelog](https://github.com/ChainSafe/js-libp2p-gossipsub/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ChainSafe/js-libp2p-gossipsub/compare/v11.1.0...v12.0.0)

---
updated-dependencies:
- dependency-name: "@chainsafe/libp2p-gossipsub"
  dependency-type: direct:production
  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-27 22:01:02 +05:30
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
Arseniy Klempner e138b4f5c4
feat: decouple sharding params out of core 2024-02-08 08:42:47 -08:00