Commit Graph

207 Commits

Author SHA1 Message Date
NagyZoltanPeter 026d804a0d
feat: Added flexible rate limit checks for store, legacy store and lightpush (#2668)
* Added flexible rate limit checks for store, legacy store and lightpush. Also added rate and traffic metrics.

* Fix chat2 after WakuLegacyStoreCodec rename

* Update waku/common/ratelimit.nim

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>

* Update waku/common/ratelimit.nim

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>

* Update waku/waku_store_legacy/protocol.nim

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>

* Fix review findings, added limit to debug logs

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-05-09 20:07:49 +02:00
Simon-Pierre Vivier d700006a6a
feat: store v3 return pubsub topics (#2676) 2024-05-08 15:35:56 -04:00
Ivan FB 2463527b24
refactor: big refactor to add waku component in libwaku instead of onlu waku node (#2658) 2024-05-03 14:07:15 +02:00
Ivan FB 404810aa8d
refactor: simplify app.nim and move discovery items to appropriate modules (#2657) 2024-05-01 21:13:08 +02:00
Simon-Pierre Vivier e03d1165e6
fix: store v3 validate cursor & remove messages (#2636) 2024-05-01 14:47:06 -04:00
Ivan FB d5e0e4a9b1
chore: log enhancement for message reliability analysis (#2640)
* log enhancement for message reliability analysis

The next modules are touched:
  - waku_node.nim
  - archive.nim
  - waku_filter_v2/protocol.nim
  - waku_relay/protocol.nim

Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
2024-05-01 10:25:33 +02:00
Ivan FB 4a110f65ff
refactor: metrics server. Simplify app.nim module (#2650) 2024-04-30 15:07:17 +02:00
Ivan FB 6382dedb42
waku_node: first of all stop the waku-switch when stopping the waku-node (#2651)
This is aimed to avoid having flaky tests
2024-04-30 12:52:11 +02:00
Ivan FB 069b23f67e
waku_node.nim: simplify stop proc (#2645)
There is no need to explicitly stop mounted libp2p protocols
because they are already being stopped after the switch.stop()
is being called
2024-04-29 17:47:18 +02:00
NagyZoltanPeter 2a4c0f1543
chore: Enabling to use a full node for lightpush via rest api without lightpush client configured (#2626)
* Enabling to use a full node for lightpush via rest api without light push client configured
2024-04-26 12:42:47 +02:00
Simon-Pierre Vivier 843fe217fa
fix: proto field numbers & status desc (#2632) 2024-04-25 15:43:21 -04:00
Simon-Pierre Vivier 0b0fbfad5c
feat: store v3 (#2431) 2024-04-25 09:09:52 -04:00
NagyZoltanPeter 6d135b0d1b
chore: Separation of node health and initialization state from rln_relay (#2612)
* Separation of node health and initialization state from rln_relay status. Make (only) health endpoint avail early and install others in the last stage of node setup.

* Proper json report from /health, adjusted and fixed test, added convenient script for checking node health

* Stop wakunode2 if configured rest server cannot be started

* Fix wakuRlnRelay protocol existence check

* Fix typo

* Removed unused imports from touched files.

* Added missing /health test for all
2024-04-23 18:53:18 +02:00
Prem Chaitanya Prathi e61e4ff90a
fix: don't use WakuMessageSize in req/resp protocols (#2601)
* fix: don't use WakuMessageSize in req/resp protocols
2024-04-20 09:10:52 +05:30
Ivan FB 828583adc2
refactor: start moving discovery modules to waku/discovery (#2587) 2024-04-17 21:48:20 +02:00
NagyZoltanPeter a00f350cd1
feat: Added simple, configurable rate limit for lightpush and store-query (#2390)
* feat: Added simple, configurable rate limit for lightpush and store-query
Adjust lightpush rest response to rate limit, added tests ann some fixes
Add rest store query test for rate limit checks and proper error response
Update apps/wakunode2/external_config.nim
Move chronos/tokenbucket to nwaku codebasee with limited and fixed feature set
Add meterics counter to lightpush rate limits

Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
2024-04-15 15:28:35 +02:00
Alvaro Revuelta e861317209
chore: remove deprecated legacy filter protocol (#2507)
* chore: remove deprecated legacy filter protocol

* fix: do not use legacy import in test

* fix: remove legacy test references

* fix: more test fixes, starting filter client

* fix: sigh. more references to remove.

* fix: fix dereferencing error

* fix: fix merge mess up

* fix: sigh. merge tool used tabs.

* fix: more peer manager tests needed fixing

---------

Co-authored-by: Hanno Cornelius <hanno@status.im>
Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com>
2024-03-25 18:07:56 +00:00
Simon-Pierre Vivier 94ff5eab68
fix: remove subscription queue limit (#2551) 2024-03-25 10:33:01 -04:00
Ivan FB 2173fe2243
fix: peer_manager - extend the number of connection requests to known peers (#2534)
* peer_manager: limit the max num out conns from within the conn loop
2024-03-19 19:07:03 +01:00
Álex Cabeza Romero 33774fada0
fix(2491): Fix metadata protocol disconnecting light nodes (#2533)
* Fix metadata protocol disconnecting light nodes.
* Implement test cases.
2024-03-19 16:18:52 +01:00
Ivan FB 3ba4378cbe
Generic re-style with nph 0.5.1 (#2396) 2024-03-16 00:08:47 +01:00
Álex Cabeza Romero f436240d53
test(peer-exchange): Implement peer exchange tests (#2464)
* Implement peer exchange tests.
* Refactor, and remove duplicated tests.
* feat(wakunode): Resultify fetch peer exchange peers (#2486)
2024-03-14 17:48:09 +01:00
Vaclav Pavlin 2c1391d304
chore: add 150 kB to msg size histogram metric (#2430) 2024-03-14 12:38:02 +01:00
Alvaro Revuelta 5a225809cd
fix: enable autosharding in any cluster (#2505) 2024-03-13 10:58:13 +01:00
Simon-Pierre Vivier 505479b870
feat: archive update for store v3 (#2451) 2024-03-12 07:51:03 -04:00
gabrielmer dcc88ee0b2
chore: migrating logic from wakunode2.nim to node_factory.nim (#2504) 2024-03-08 16:46:42 -06:00
gabrielmer 361fe2cdc7
chore: moving node initialization code to node_factory.nim (#2479) 2024-03-02 18:59:53 -06:00
Simon-Pierre Vivier 91e3f8cde6
fix: notify Waku Metadata when Waku Filter subscribe to a topic (#2493) 2024-03-01 08:01:37 -05:00
Ivan FB 501c92e2c3
waku_metrics: change log interval from 30'' to 10' (#2428) 2024-02-19 22:25:20 +01:00
Hanno Cornelius ce151efc36
feat: prioritise yamux above mplex (#2417)
* update libp2p submodule

* feat: prefer yamux to mplex
2024-02-17 19:46:01 +00:00
Aaryamann Challani 22026b7e89
fix(rln-relay): graceful shutdown with non-zero exit code (#2429)
* fix(rln-relay): graceful shutdown with non-zero exit code

* fix: missed args

* fix: exception str

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>

* fix: remove old comment

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-02-15 16:55:08 +05:30
richΛrd 1b4026673a
feat: add yamux support (#2397) 2024-02-06 16:33:13 -04:00
gabrielmer 59d8b6204f
feat: running validators in /relay/v1/messages/{pubsubTopic} (#2373) 2024-02-01 18:16:10 +01:00
Simon-Pierre Vivier edca1df1a8
feat: shard aware relay peer management (#2332)
note that this feature is behind a config flag. `--relay-shard-manager`
2024-01-30 07:28:21 -05:00
gabrielmer bb58a63aa1
fix: adding rln validator as default (#2367) 2024-01-29 16:11:26 +01:00
gabrielmer f841454edc
chore: improve POST /relay/v1/auto/messages/{topic} error handling (#2339) 2024-01-18 13:49:13 +01:00
NagyZoltanPeter c3358409bb
chore: Refactor of FilterV2 subscription management with Time-to-live maintenance (#2341)
* Refactor of FilterV2 subscription handling and maintenance with addition subscription time-to-live support.
Fixed all tests and reworked where subscription handling changes needed it.
Adapted REST API /admin filter subscription retrieve to new filter subscription structure.

* Fix tests and PR comments

* Added filter v2 subscription timeout tests and fixed

* Fix review comments and suggestions. No functional change.

* Remove leftover echoes from test_rest_admin

* Fix failed legacy filter tests due to separation of mounting the filters.

* Small fixes, fix naming typo, removed duplicated checks in test
2024-01-16 17:27:40 +01:00
Ivan FB ed09074cc3
chore: message.nim - set max message size to 150KiB according to spec (#2298)
* message.nim: set max message size to 150KiB according to spec

Using KiB instead of KB because that seems more aligned with
the actual default defined in nim-libp2p (1024 * 1024)

Spec details: https://rfc.vac.dev/spec/64/#message-size

* test_protocol.nim: align test to current WakuMessage limit
* test_waku_client.nim: adapt test to MaxWakuMessageSize change
* make maxMessageSize configurable for wakunode2
* wakunode2 app now accepts max-num-bytes-msg-size with KiB, KB, or B units
* testlib/wakunode.nim: set maxMessageSize: "1024 KiB"
* test_waku_client.nim: remove duplicate check in "Valid Payload Sizes"
* set DefaultMaxWakuMessageSizeStr as the only source of truth
* external_config.nim: rename max-num-bytes-msg-size -> max-msg-size
2024-01-03 13:11:50 +01:00
Ivan FB ebad0385ef
ip colocation is parameterizable. If set to 0, it is disabled (#2323)
The "ip colocation" concept refers to the maximum allowed peers
from the same IP address. For example, we allow disabling this limit when the
node works behind a reverse proxy.
2024-01-02 14:01:18 +01:00
Ivan FB 32668f43f5
fix: Revert "feat: shard aware peer management (#2151)" (#2312)
This reverts commit dba9820c1f.

We need to revert this commit because
the waku-simulator stopped working. i.e. the nodes couldn't establish
connections among them: 054ba9e33f

Also, the following js-waku test fails due to this commit:
"same cluster, different shard: nodes connect"

* waku_lightpush/protocol.nim: minor changes to make it compile after revert
2023-12-20 15:23:41 +01:00
gabrielmer a1b27edf80
fix: setting connectivity loop interval to 15 seconds (#2307) 2023-12-20 09:38:14 +01:00
Álex Cabeza Romero fae20bff20
refactor(store): HistoryQuery.direction (#2263)
* Fix issue with default history query ascending value in serde operations: Should use the same value.
* Update direction types to PagingDirection.
2023-12-19 15:10:27 +01:00
Ivan FB 0fc617ff69
bug fix: update num-msgs archive metrics every minute and not only at the beginning (#2287) 2023-12-14 17:00:13 +01:00
Ivan FB 385daf16be
chore: vendor bump for 0.23.0 (#2274)
* on_chain/group_manager: use .async: (raises:[Exception]).
* bump nim-dnsdisc
* update nim-chronos to the latest state
* chat2.nim: catch any possible exception when stopping
* chat2bridge.nim: make it to compile after vendor bump
* ValidIpAddress (deprecated) -> IpAddress
* vendor/nim-libp2p additional bump
* libwaku: adapt to vendor bump
* testlib/wakunode.nim: adapt to vendor bump (ValidIpAddress -> IpAddress)
* waku_node: avoid throwing any exception from stop*(node: WakuNode)
* test_confutils_envvar.nim: ValidIpAddress -> IpAddress
* test_jsonrpc_store: capture exception
* test_rln*: handling exceptions
* adaptation to make test_rln_* to work properly
* signature enhancement of group_manager methods
2023-12-14 07:16:39 +01:00
Ivan FB 0cc0c80563
chore: peer_manager.nim - reduce logs from debug to trace (#2279) 2023-12-12 16:00:18 +01:00
Ivan FB 77c5ba7669
archive: simplify and enhance async retention policy application (#2278)
* Avoid using timer and just use an infinite async loop that can be
cancelled at any time.
2023-12-11 08:50:40 +01:00
Simon-Pierre Vivier 281c13a429
added sharded peer store pruning (#2167) 2023-12-07 07:21:18 -05:00
Simon-Pierre Vivier dba9820c1f
feat: shard aware peer management (#2151) 2023-12-07 06:48:28 -05:00
omahs 958b9bd712
chore: fix typos (#2239) 2023-11-30 11:08:08 +01:00
Simon-Pierre Vivier c301e880c8
chore: refactoring peer storage (#2243) 2023-11-27 08:08:58 -05:00