* fix: add stop methods to protocols to prevent event listener leaks
* fix: add abort signal support for graceful store query cancellation
* fix: call protocol stop methods in WakuNode.stop()
* fix: improve QueryOnConnect cleanup and abort signal handling
* fix: improve MissingMessageRetriever cleanup with abort signal
* fix: add stopAllRetries method to RetryManager for proper cleanup
* fix: implement comprehensive ReliableChannel stop() with proper cleanup
* fix: add active query tracking to QueryOnConnect and await its stop()
* fix: add stop() to IRelayAPI and IStore interfaces, implement in SDK wrappers
* align with usual naming (isStarted)
* remove unnecessary `await`
* test: `stop()` is now async
* chore: use more concise syntax
---------
Co-authored-by: Levente Kiss <levente.kiss@solarpunk.buzz>
* chore: npm publication
Fixing npm publication and warnings
* Upgrade workflow to use trusted publishing
https://docs.npmjs.com/trusted-publishers
* bump node js to 24
To avoid having to reinstall npm in pre-release for npmjs trusted publishers
Concepts are being mixed up between the global network config (static vs auto sharding), that needs to be the same of all nodes in the network, individual node configuration (eg relay node subscribing to a given shard), and the routing characteristic of a specific message (eg pubsub topic, shard).
This stops proper configuration of nwaku post 0.36.0 because we know need to be deliberate on whether nwaku nodes are running with auto or static sharding.
It also included various back and forth conversions between shards, pubsub topics, etc.
With this change, we tidy up the network configuration, and make it explicit whether it is static or auto sharded.
We also introduce the concept of routing info, which is specific to a message, and tied to the overall network configuration.
Routing info abstract pubsub topic, shard, and autosharding needs. Which should lead to easier tidy up of the pubsub concept at a later stage.
# Conflicts:
# packages/core/src/lib/connection_manager/connection_manager.ts
# packages/core/src/lib/metadata/metadata.ts
# packages/interfaces/src/metadata.ts
# packages/interfaces/src/sharding.ts
# packages/relay/src/create.ts
# packages/sdk/src/filter/filter.ts
# packages/sdk/src/filter/types.ts
# packages/sdk/src/light_push/light_push.spec.ts
# packages/tests/tests/sharding/auto_sharding.spec.ts
# packages/tests/tests/sharding/static_sharding.spec.ts
# Conflicts:
# packages/sdk/src/store/store.ts
For an edge node, there is no such thing as a "pubsub topic configuration". An edge node should be able to operate for any possible shard, and it is a per-protocol matter (eg send message with light push).
A relay node do subscribe to shards, but in this case, even metadata protocol does not need to advertise them, this is already handled by gossipsub.
Only service node should advertise their shards via metadata protocol, which is out of scope for js-waku.
# Conflicts:
# packages/interfaces/src/connection_manager.ts
* create retry manager
* update tests
* add retry manager tests, update peer manager
* fix start & merge with master
* return send to many logic
* add new error handling
* add sections to protocol errors
* fix check
* up test
* add waku.start in test
* fix check and test
* improve name
* up lock
* make ConnectionManager use ctor
* reform connection manager configurations
* remove log param from peerManager
* make PeerManager use only ConnectionManager, move getPeers to ConnectionManager, remove not needed code
* remove allPeers and connectedPeers from BaseProtocolCore, update tests, add getPeers for IWaku
* use only one peerManager from Waku object
* remove IBaseProtocolSDK and merge with PeerManager
* re-implement peerManager, remove ProtocolUseOptions
* remove not needed test, up lock
* update deps and lock
* remove old test for peerManager, fix check and spell
* rename to getConnectedPeers
* feat: improve filter subscriptions (#2193)
* add message cache to Filter
* remove WakuOptions and use only ProtocolCreateOptions
* move subscribe options to createLightNode Fitler protocol options
* rename SubscriptionManager to Subscription
* rename to CreateNodeOptions
* add warning
* feat: introduce subscription manager (#2202)
* feat: inroduce subscription manager
* fix: make pipeline succeed (#2238)
* fix test
* use hardcoded value
* update playwright
* fix test:browser
* up lock
* make peer retrieval probabilistic
* add comments
* up lightpush tests
* add tests for peer_manager, improve folder structure
* create named files for protocols
* create named files, simplify project structure
* remove only
* fix comment of default number of peers
* export default number of peers from base protocol sdk
* rename to light_push, move class to separate file
* move waitForRemotePeer to sdk package
* add todo to move waitForGossipSubPeerInMesh into @waku/relay
* clean up waitForRemotePeer, split metadata await from event and optimise, decouple from protocol implementations
* simplify and rename ILightPush interface
* use only connected peers in light push based on connections instead of peer renewal mechanism
* improve readability of result processing in light push
* fix check & update tests
* address tests, add new test cases, fix racing condition in StreamManager
* use libp2p.getPeers
* feat: confirm metadata and protocols needed in waitForRemotePeer
* rely on passed protocols and fallback to mounted
* add I prefix to Waku interface
* implement waku.connect method
* add docs to IWaku interface
* remove export and usage of waitForRemotePeer
* move wait for remote peer related to Realy out of @waku/sdk
* change tests to use new API
* fix linting
* update size limit
* rename .connect to .waitForPeer
* export waitForRemotePeer and mark as deprecated
* feat: add mocha tests to @waku/sdk and cover waitForRemotePeer (#2163)
* feat: add mocha tests to @waku/sdk and cover waitForRemotePeer
* add waitForRemote UTs
* remove junk
* feat: expose peerId and protocols from WakuNode (#2166)
* chore: expose peerId and protocols from WakuNode
* remove unused method
* move to private method
* rename to waitForPeers
* up test
* 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
* 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
* 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