662 Commits

Author SHA1 Message Date
Arseniy Klempner
f2ad23ad43
feat(rln)!: generate contract types, migrate from ethers to viem (#2705)
* feat: use wagmi to generate contract types

* feat: migrate rln from ethers to viem

* fix: remove .gitmodules

* fix: update readme

* fix: refactor to use a single viem client object

* fix: update comments, tsconfig

* feat: remove membership event tracking

* fix: script name in package.json and readme

* fix: only allow linea sepolia

* fix: consolidate viem types, typed window

* fix: use viem to infer type of decoded event

* fix: use js for generate abi script

* feat: generate abi and build rln package as release condition

* fix: check that eth_requestAccounts returns an array

* fix: handle error messages

* fix: use https instead of git for cloning in script

* fix: add warning annotations for contract typings check

* fix: install deps for rln package before building

* fix: use pnpm when installing rln contracts

* fix: use workspace flag to run abi script

* fix: add ref to checkout action

* fix: include pnpm in ci
2025-12-01 17:32:35 -08:00
Sasha
101ffe8a04
chore: release master (#2663) 2025-11-04 15:56:42 +01:00
Arseniy Klempner
0daa81d3d7
fix: run npm audit fix (#2696)
* fix: run npm audit fix

* fix: bump playwright image in CI
2025-10-27 13:47:14 -07:00
Arseniy Klempner
0df18b2a75
feat: create @waku/run package for local dev env (#2678)
* feat: create @waku/run package for local dev env

* chore: add @waku/run to release please config

* feat: test @waku/run with playwright

* fix: don't run waku/run tests in CI

* fix: cache images so docker-compose can work offline

* feat: set nodekey and staticnode flags for each nwaku node

* fix: use constants for node ids

* chore: set directories for running via npx

* fix: remove .env, support env vars for nwaku ports

* fix: use separate db (same instance) for each node

* feat: add command to test dev env

* chore: use package version in container name

* fix: replace hardcoded WS/REST ports with constants/env vars

* chore: clean up README

* fix: refactor config printing into own function

* fix: add run package to release please manifest

* fix: defer to root folder gitignore/cspell

* fix: update node version and remove tsx

* fix: remove browser tests and express dep

* fix: replace magic values with constants

* fix: move to root .gitignore

* fix: move cspell to root
2025-10-22 21:38:28 -07:00
Sasha
ad0bed69ba
feat: add waku/react package and make it compatible with React frameworks (#2656)
* chore: add waku/react package

* fix check

* remove not needed logic from waku/react package

* make it compatible with expo/next

* add to release please

* remove tests
2025-10-08 15:37:49 +02:00
Arseniy Klempner
d803565b30
feat(browser-tests): simplify, refactor, update dockerized browser node (#2623)
* feat(browser-tests): simplify, refactor, update dockerized browser node

* Update packages/browser-tests/web/index.ts

* fix: remove comments and console.logs from tests

* fix: add temporary logging

* fix: debugging static sharding

* fix: replace console with logger

* fix: remove use of any

* fix: log dial error

* fix: replace any with libp2p options

* fix: remove unused logic around sourcing address.env

* fix: uncomment log

* fix: add more logging and fix tests

* feat: add types for test-config

* fix: add types to server.ts

* fix: remove more uses of any

* fix: remove use of any in endpoint handlers
2025-10-07 10:54:19 -07:00
Arseniy Klempner
bbcfc94879
feat(rln)!: use zerokit for credential generation (#2632)
Co-authored-by: Danish Arora <danisharora099@gmail.com>
2025-09-30 16:49:18 -07:00
Sasha
79dd001b1f
chore: release master (#2576) 2025-09-20 11:37:22 +02:00
fryorcraken
4d5c152f5b
feat: introduce reliable channels (#2526)
* SDS: pushOutgoingMessage is actually sync

* SDS: ensure that `ContentMessage` class is stored in local history with `valueOf` method

* feat: introduce reliable channels

Easy to use Scalable Data Sync (SDS, e2e reliability) wrapper, that includes:
- store queries upon connection to store nodes
- store queries to retrieve missing messages

* remove `channel` prefix

* attempt to improve performance when processing a lot of incoming messages

* test: split test file

* use index.ts for re-export only.

* improve if condition

* use getter for isStarted

* waku node already auto-start

* rename send

* fix lightPush.send type post rebase

* test: remove extra console.log

* SDS: emit messages as missing as soon as they are received

* make configurable elapse time for task process

* typo

* use string instead of enum for event types

* ReliableChannel.send returns the message id
2025-09-09 12:43:48 +10:00
Sasha
a7f30b1211
feat: add debounce to health indicator (#2594) 2025-09-04 00:49:10 +02:00
Sasha
26de2d11c8
chore: release master (#2515) 2025-08-15 21:56:59 +02:00
fryorcraken
c161b37d08
fix!: SDS acknowledgements (#2549)
* SDS: change default causal history size to 200

# Conflicts:
#	packages/sds/src/index.ts
#	packages/sds/src/message_channel/message_channel.ts

* SDS: add some comments

* SDS: segregate messages types, introduce LocalHistory

* SDS: fix miss-acks

* SDS: logs and more explicit variable names

* SDS: shorten event name

* SDS: shorten var name

* SDS: move message classes to own file.

* SDS: use lodash instead of custom SortedArray implementation

* SDS: move Message to own file

* SDS: add comparison tests
2025-08-14 10:44:18 +10:00
Sasha
ada265731a
fix: improve error handling for stream manager (#2546)
* fix: improve error handling for stream manager

* fix browser tests

* update logs for stream manager

* fix tests

* fix playwright
2025-08-12 23:25:23 +02:00
Sasha
79f319cc86 chore: release master 2025-07-19 01:52:31 +02:00
Sasha
981248eedd
chore!: remove deprecated filter implementation (#2433)
* chore: remove deprecated filter implementation

* update tests

* skip IReceiver test, remove unused utility

* fix typo

* address comments

* unskip Filter e2e test

* address more comments, remove duplication

* skip CI test
2025-07-02 12:37:54 +02:00
Sasha
cd1d909de3
chore: release master (#2390) 2025-06-23 22:29:40 +02:00
Sasha
fcc6496fef
chore!: upgrade libp2p, nodejs and typescript (#2401)
* remove react native package

* upgrade nodejs

* upgrade libp2p

* upgrade typescript, use 22 node

* up lock

* fix node compatibility

* upgrade playwright

* upgrade proto

* update tests
2025-06-22 17:41:23 +02:00
Sasha
7c8d1073b0
chore!: remove IBaseProtocol and improve interface on PeerExchange (#2422)
* remove IBaseProtocol

* fix references, interfaces and integration

* fix ci

* up mock

* up lock

* add mock for local storage

* add missing prop, fix tests

* up lock
2025-06-20 12:53:42 +02:00
fbarbu15
4997440225
chore: add reliability tests package with longevity tests (#2361)
* chore: add reliability tests package with longevity tests

* chore: add reliability tests package with longevity tests

* chore: fix ci errors

* chore: fix

* chore: fix timeout
2025-06-05 11:19:00 +03:00
Arseniy Klempner
f649f59e64
fix: rebase package lock 2025-06-03 11:24:37 -07:00
Arseniy Klempner
9f7a15dfb1
fix(store): update store query validation logic to support msg hash queries 2025-06-03 09:05:54 -07:00
Sasha
1905558753
feat!: re-work messaging parts and sharding (#2399)
* remove message-hash package, move it to core

* add js-doc to message hash

* up

* address type changes

* fix lint
2025-06-03 11:08:02 +02:00
Arseniy Klempner
5ed35471ca
feat: headless app and api for testing js-waku in browser 2025-05-29 10:19:56 -07:00
Danish Arora
3b23bceb9d
feat: refine work with membership info and other meta information (#2341)
* chore: update definitions to match the ABI

* chore: improve exports and types

* chore: use big endian instead of little endian

* chore: improve logging

* chore: update import

* fix: use overloaded function call

* chore: estimate gas

* test

* npm i

* chore: regen locl

* chore: update

* chore: update playwright docker images

* chore: cannot erase membership if it isn't expired/in grace period

* chore: fix condition

* chore: add `getMembershipStatus` method

* refactor(rln): cache min/max rate limits at contract instantiation

* chore: fix accessor

* chore: rename arg

* chore: allow chromebin path through env
2025-05-29 16:09:08 +05:30
Sasha
e22f211d46 chore: release master 2025-04-23 07:38:08 +02:00
Arseniy Klempner
6456d09809
fix: npm audit without force 2025-04-22 08:11:02 -07:00
Arseniy Klempner
408be95a13
feat(sds): add retrieval hint to causal history 2025-04-22 07:45:05 -07:00
Arseniy Klempner
0826f32b69
feat(sds): adds ephemeral messages, delivered message callback and event 2025-04-22 07:41:52 -07:00
Sasha
e45736ff98
feat: introduce WSS checker CI (#2366)
* feat: introduce WSS checker CI

* rename CI step

* specify nodejs

* try

* remove not needed dep

* use npx and fail on failure

* run by dispatch only and improve naming

* fix fail detection
2025-04-18 22:51:07 +02:00
Danish Arora
4adf8706c3
feat(rln): create CredentialsManager without Zerokit (#2295)
* chore: update ABI

* chore: update contract address and chain ID to Linea Sepolia

* chore: improve error handling

* fix: bigint conversion

* chore: update tests

* chore: clean comments

* chore: export keystore types

* chore: update README with contract address

* tests: add reusable mock functions

* chore: LINEA_CONTRACT instead of SEPOLIA_CONTRACT

* chore: add linea to cspell

* chore: add rateLimit to MembershipInfo

* fix: determine start options

* feat: RLNLight

* chore: fix

* chore: export

* fix: returns for ratelimit

* chore: big number conversions

* chore: rename RLNLight to CredentialsManager, add logs

* chore: setup and use rln_base_contract

* chore: use CredentialsManager for rln.ts

* chore: public methods written above private methods

* fix: rate limit getter

* chore: simplify getters/setters

* chore: insert empty line
2025-04-07 16:04:06 +05:30
Danish Arora
a8ff776962
chore(rln): update ABI and contract address to Linea Sepolia, enhancements (#2294)
* chore: update ABI

* chore: update contract address and chain ID to Linea Sepolia

* chore: improve error handling

* fix: bigint conversion

* chore: update tests

* chore: clean comments

* chore: export keystore types

* chore: update README with contract address

* tests: add reusable mock functions

* chore: LINEA_CONTRACT instead of SEPOLIA_CONTRACT

* chore: add linea to cspell

* chore: add rateLimit to MembershipInfo

* fix(tests): rate limit additions

* chore: update gitignore
2025-03-31 14:32:29 +05:30
Sasha
ea6daae927
chore: release master (#2311) 2025-03-24 14:41:33 +01:00
Sasha
1ee77c0423
fix: downgraid chainsafe (#2316)
* fix: downgraid chainsafe

* up lock

* up lock

* bump playwright

* add override section
2025-03-24 13:07:29 +01:00
fryorcraken
edfb56243d
doc: build first to avoid not found deps issues (#2307)
* doc: build first to avoid not found deps issues

* fix: Remove XMLHttpRequest usage

XMLHttpRequest API is deprecated and not available in browser extensions.

Replace the culprit dependency with a more modern one.

Some options are removed. The assumption is that nobody uses them. It can always be added if a developer wants the flexibility.

* test: simplify test

The test focus on testing DNS Discovery, there is no need to also have a nwaku local node for bootstrap.

Bootstrap on nwaku local node is used in many other tests.
2025-03-19 09:43:41 +01:00
Danish Arora
6fc6bf3916
feat(rln): migrate from v1 to v2, rate limiting, memberships, test coverage (#2262)
* chore: update ABIs and deployed address

* chore: remove storage contract references

* feat: upgrading adapter to basic rlnv2

* feat: rate limit

* chore: upgrade packages revert

* fix: tests

* chore: remove uneeded file

* feat(rln): implement RLNv2 rate limiting and membership states

- Add rate limit validation and handling in proof generation/verification
- Implement membership lifecycle state management (Active/GracePeriod/Expired)
- Add new membership management methods:
  - getMembershipInfo
  - extendMembership
  - eraseMembership
  - registerMembership
- Update proof verification to include rate limit checks
- Refactor message serialization to include rate limit data

Breaking changes:
- verifyWithRoots now takes roots as array instead of spread parameters
- Proof verification methods now accept optional rateLimit parameter

* fix: typo

* chore: add to cspell

* chore: reduce diff

* chore: simplify subdir for abi

* chore: address comments

* chore: simplify access to variables

* chore: address comments

* chore: simplify constants

* chore: add error handling

* chore: change rln v2 references to rln

* fix: check
2025-03-03 18:14:06 +05:30
Sasha
87a918d9cc
chore: remove go-waku related code in tests (#2285)
* remove go-waku related code in tests

* remove not needed

* remove args level for go-waku
2025-02-25 17:56:55 +01:00
Arseniy Klempner
389ca4062e
feat(sds): add message channel with buffers and send/receive logic
This commit creates the class for an SDS message channel, including
buffers for outgoing and incoming messages. Adds logic for sending
messages, receiving messages, delivering messages, and reviewing
acknowledgement status of messages. Also adds byte serialization
for bloom filters.
2025-02-21 14:12:29 -08:00
Danish Arora
582c4e1c81
chore: sds and rln before tests (#2263) 2025-02-18 16:46:33 +05:30
Danish Arora
0a0a92bccb
feat: @waku/rln (#2244)
* chore: setup rln as a new package

* chore: migrate src

* fix: wasm loading, tests, config

* chore: fix Karma CI

* fix: bundler

* chore: copy dist resources

* chore(rln): enable all tests

* chore: increase karma timeouts
2025-02-11 15:28:00 +05:30
Danish Arora
becb46f3a5
chore(sds): use allure reporting (#2255) 2025-02-11 00:56:00 +05:30
Sasha
3136f3a704
feat: add HealthIndicator with simplified logic and testing (#2251)
* implement HealthIndicator

* up libp2p interface version

* up lock

* remove unused tests

* expose HealthIndicator from Waku

* update test, add start and stop

* fix error handling
2025-02-05 13:24:50 +01:00
fbarbu15
2a7f4b6e86
chore: add back allure (#2247) 2025-02-03 13:59:55 +05:30
Sasha
62f93dc842
feat: improve peer manager and re-integrate to light push (#2191)
* 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
2025-01-31 00:16:00 +01:00
Ivan FB
d706fe146c
replace pubsub topic param with clusterid plus shard (#2239)
We are in the process of deprecating pubsub-topic param from nim-waku.
The pubsub-topic shouldn't be used to start nim-waku and instead, a
combination of 1 cluster-id plus n shard should be given. This aims to
start using the new added param: shard.
2025-01-30 18:16:07 +05:30
Arseniy Klempner
468512fa85
feat(sds): create package for sds and add protobuf def
Adds a new package for the browser implementation of scalable data
sync. Ports some of the nim implementation of bloom filter to ts.
Adds protobuf definition for SDS messages.
2025-01-28 18:53:41 -08:00
Sasha
f34fc4b244
fix: remove peer deps (#2200) 2025-01-16 14:27:46 +01:00
Sasha
88e33a90fd
fix: remove window reference and improve waitForRemotePeer (#2194)
* fix: remove window reference and improve waitForRemotePeer

* remove only

* up lock

* debug: try * as version

* return version

* up lock
2024-11-08 12:34:31 +07:00
Danish Arora
7c0ce7b2ec
chore: upgrade to libp2p v2 (#2143)
* chore: upgrade libp2p to v2 and related deps

* chore: fix ENR

* chore(core): remove CustomEvent polyfill import

* chore: `peer-id-factory` has been removed

* chore(discovery): fix local-cache & remove CustomEvent imports

* chore(sdk): update config

* chore(tests): update tests without peer-id-factory

* fix: spec tests

* chore: fix test

* chore: upgrade dataset-core

* chore: upgrade libp2p and stale references

* chore: upgrade playwright

* chore: rm console log

* fix: lock
2024-10-21 16:43:24 +05:30
Danish Arora
b2efce5ec2
feat(filter): enhancing protocol peer management with mutex locks (#2137)
* chore: improvements

* chore: add logs for subscription maintenance

* chore: update logging

* chore: trimming down BaseProtocolCore

* chore: track peers in a hashmap instead of array

* chore: peer mgmt responds to conenction/disconnection and improve logging

* feat: add mutex locks to tackle race conditions over shared state

* fix: build

* chore: some mutex lock-release improvements

* feat: peer manager

* chore: rm tests for remove internal util

* chore: update HealthManager updates

* chore: update tests

* rm: only

* fix: hasPeers management

* chore: add modularity to getting connected peers

* chore: improve logs & add debug

* chore: renewal doesnt disconnect, only removes

* chore: await for sequential operations

* chore: add TODO

* chore: minor improvements

* chore: fix rebase

* chore: update playright

* chore: remove additional arg

* chore: update interafce

* feat(peer-manager): unit tests

* chore: improve hasPeers()

* chore: update lockfile

* feat: Filter reacts to peer:disconnect event, add tests

* chore: fix lock

* chore: update playright

* chore: update protocol health for lightpush

* chore: remove .only

* chore: address comments and improvements

* fix: tsconfig
2024-10-10 23:47:12 +02:00
Sasha
75fcca4cd9
feat: replace waitForRemotePeers() with waku.waitForPeer() method (#2161)
* 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
2024-10-09 00:43:34 +02:00