Commit Graph

57 Commits

Author SHA1 Message Date
Aaryamann Challani 6a1af92276
chore(rln-relay): health check should account for window of roots (#2664)
* test(rln-relay): health check should account for window of roots

* fix: some type-fu

* fix: widen the type vs narrowing

* fix: add extra parens
2024-05-08 17:48:44 +05:30
Aaryamann Challani a9e19efd7a
fix(rln-relay): persist metadata every batch during initial sync (#2649)
* fix(rln-relay): persist metadata every batch during initial sync

* fix: test

* Apply suggestions from code review

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

* patch: isOkOr template

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-04-30 18:52:47 +05:30
Aaryamann Challani 1d7ff2881b
chore(rln-relay): resultify rln-relay 1/n (#2607)
* chore(rln-relay): resultify rln-relay 1/n

* fix: v2 too

* fix: for static group manager

* fix: cleanup, make PR digestable

* fix: remove resultified retry wrapper

* fix: cleanup

* fix: cleanup
2024-04-26 11:53:58 +02:00
Aaryamann Challani 9c9883a630
fix(rln-relay): enforce error callback to remove exception raised from retryWrapper (#2622) 2024-04-24 17:11:22 +02:00
Aaryamann Challani 1a23700d54
fix(rln-relay): increase retries for 1 minute recovery time (#2614) 2024-04-23 15:11:14 +02:00
Aaryamann Challani 480a62facd
fix(rln-relay): reduce sync time (#2577)
* fix(rln-relay): reduce sync time

* fix: add batch handling of futures to prevent over utilization of cpu

* fix: need to handle the futures on last iteration when it isnt full
2024-04-12 19:02:48 +03:00
Alvaro Revuelta b5e4795f55
fix(rln): set a minimum epoch gap (#2555) 2024-03-27 11:36:14 +01:00
Ivan FB 3ba4378cbe
Generic re-style with nph 0.5.1 (#2396) 2024-03-16 00:08:47 +01:00
Aaryamann Challani 059cb97518
chore(rln-relay-v2): wakunode testing + improvements (#2501)
* chore(rln-relay-v2): additional testing

* fix: bump librln to v0.4.2 for v2

* fix: catch possible error from the copyFrom

* ci: rename step title for rln-version
2024-03-12 16:20:30 +05:30
Aaryamann Challani 1274b15d75
fix(rln-relay): handle empty metadata returned by getMetadata proc (#2516)
* fix(rln-relay): silence error on startup when metadata is not found

* chore: fix fetching value from option

* fix: clarity of returned opt
2024-03-08 19:36:22 +05:30
Aaryamann Challani beba14dcaa
fix(rln-relay): make nullifier log abide by epoch ordering (#2508)
* fix(rln-relay): nullifier log abide by epoch ordering

* fix: cleaner hasKey method, test

* chore: idiomatic usage of results, error handling

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

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-03-06 23:59:07 +05:30
Aaryamann Challani 5b174fb392
chore(rln-relay-v2): added tests for static rln-relay-v2 (#2484)
* chore(rln-relay-v2): added tests for onchain rln-relay-v2

* chore(rln-relay): added tests for static rln-relay-v2

* Update waku/waku_rln_relay/group_manager/static/group_manager.nim

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

* fix: split lines

* fix: remove redundant require

* fix: remove redundant require

* fix: bad await

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-03-04 17:41:33 +05:30
Aaryamann Challani 88ff928213
chore(rln-relay-v2): added tests for onchain rln-relay-v2 (#2482)
* chore(rln-relay-v2): added tests for onchain rln-relay-v2

* Update tests/waku_rln_relay/test_rln_group_manager_onchain.nim

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

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-03-01 14:15:40 +05:30
Alvaro Revuelta 3f4f6d7e5b
chore: remove rln epoch hardcoding (#2483) 2024-02-28 17:19:20 +01:00
Aaryamann Challani 2060cfab67
chore(rln-relay): remove wss support from node config (#2442)
* chore(rln-relay): remove wss support from node config

* fix: incl regex pattern examples

* docs: update rln docs
2024-02-16 18:36:31 +05:30
gabrielmer 8f487a2179
fix: checking for keystore file existence (#2427) 2024-02-15 17:33:15 +02: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
Aaryamann Challani d0377056ca
chore(rln-relay-v2): add tests for serde (#2421)
* chore(rln-relay-v2): add tests for serde

* fix: call isOk fn instead of prop access

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

* fix: make cast more explicit

---------

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2024-02-14 13:24:05 +05:30
Aaryamann Challani 50308eda0d
feat(rln-relay-v2): nonce/messageId manager (#2413)
* feat(rln-relay-v2): nonce/messageId manager

* fix: simplify
2024-02-13 10:18:02 +05:30
Aaryamann Challani 2d46c35117
feat(rln-relay-v2): rln-keystore-generator updates (#2392)
* chore: init rln-v2 in OnchainGroupManager

* chore: update wrappers

* fix: units for userMessageLimit

* valueOr for error handling

* fix: len usage
2024-02-09 16:31:45 +05:30
Álex Cabeza Romero f86baa01a7
test(rln): Implement some rln unit tests (#2356)
* Fix sanity check location.
* Implement some rln tests.
2024-02-02 09:56:41 +01:00
Aaryamann Challani b88facd0b7
feat(rln-relay-v2): update C FFI api's and serde (#2385)
* feat(rln-relay-v2): integrate new ffi bindings, serde

* chore: remove ExtendedRateLimitProof, add comments

* fix: typo
2024-02-02 00:26:47 +05:30
Aaryamann Challani c55ca06756
chore(rln-relay-v2): use rln-v2 contract code (#2381)
* chore(rln-relay-v2): use rln-v2 contract code

* fix: reduced duped code
2024-01-30 23:28:30 +05:30
Aaryamann Challani efdc5244f6
chore(rln-relay): remove websocket from OnchainGroupManager (#2364)
* chore(rln-relay): remove websocket from OnchainGroupManager

* fix: swap ws for http
2024-01-23 23:22:45 +05:30
Ivan FB c9d558f878
relay: add trace logs in case of msg validation rejection (#2285) 2023-12-15 13:34:30 +01:00
Alvaro Revuelta 5847f49d3d
fix: make rln rate limit spec compliant (#2294) 2023-12-15 10:26:17 +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
Aaryamann Challani 15c1f974df
fix(rln-relay): graceful retries on rpc calls (#2250)
* fix(rln-relay): graceful retries on rpc calls

* fix: missing file
2023-12-11 14:59:16 +05:30
omahs 958b9bd712
chore: fix typos (#2239) 2023-11-30 11:08:08 +01:00
Ivan FB 13fb7c2f74
group_manager.nim more except detail when cant connect eth client (#2195) 2023-11-20 23:25:55 +01:00
Alvaro Revuelta 1042cacd3f
chore(rln): add more hardcoded memberhips to static group (#2108) 2023-10-05 13:25:24 +02:00
Aaryamann Challani 45fe2d3bee
fix(rln-relay): segfault when no params except rln-relay is passed in (#2047) 2023-09-25 13:26:16 +05:30
Ivan Folgueira Bande 292de5a6c1
bumping web3 (#2066) 2023-09-25 08:13:40 +02:00
Ivan Folgueira Bande 11e7394e0d
Adding 'librln' to `libwaku` and cleaning waku_example.c (#2044)
* When adding the dependency with 'librln' to 'libwaku', it is required
  to remove the dependency with 'confutils' because the 'nim-confutils'
  module prevents the creation of a dynamic library (libwaku.so.)

* waku_example.c: less code is needed because the Waku Thread attends
  any Waku event whereas the main thread can have a blocking scanf
  to retrieve user inputs.
2023-09-19 17:01:32 +02:00
Aaryamann Challani 2e515a06ed
chore(rln-relay): logs, updated submodule, leaves_set metric (#2024)
* chore(rln-relay): logs, updated submodule, leaves_set metric

* chore(rln-relay): update build script, fix makefile
2023-09-18 10:56:58 +05:30
Aaryamann Challani a4e783303c
fix(rln-relay): waku_rln_number_registered_memberships metrics appropriately handled (#2018) 2023-09-11 19:21:45 +05:30
Aaryamann Challani 21604e6bfd
fix(rln-relay): missed roots during sync (#2015) 2023-09-08 18:24:27 +05:30
Aaryamann Challani 5638bd06bb
chore(rln-relay): add isReady check (#1989)
* chore(rln-relay): add isReady check

* fix(rln-relay): multiple parameters for checking if node is in sync

* fix: set latesthead in newHeadCallback

* fix: explicit rpc call

* fix: unhandled exception
2023-09-06 14:16:19 +05:30
Aaryamann Challani 483f40c8f7
chore(rln-relay): clean up nullifier table every MaxEpochGap (#1994) 2023-09-06 13:48:02 +05:30
Aaryamann Challani debc5f19d9
feat(relay): ordered validator execution (#1966)
* feat(relay): ordered validator execution

* fix: make more readable

* test: ignore accepts only

* fix: idempotent .subscribe

* fix(rln-relay): make validators private

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

* fix: include comments, unsubscribe behaviour

* fix: compilation

---------

Co-authored-by: Ivan Folgueira Bande <128452529+Ivansete-status@users.noreply.github.com>
2023-09-05 14:35:07 +05:30
Aaryamann Challani 97a7c9d04d
chore(rln-relay): log levels for certain logs (#1986) 2023-09-04 18:43:59 +05:30
Aaryamann Challani a14c32614a
chore(rln-relay): use the only key from keystore if only 1 exists (#1984)
* chore(rln-relay): use the only key from keystore if only 1 exists

* fix: convert iterator to seq and then index into it
2023-09-04 15:46:44 +05:30
Aaryamann Challani be48891f77
chore(rln-relay): confirm that the provided credential is correct using onchain query (#1980) 2023-09-04 11:22:31 +05:30
Alvaro Revuelta 05c988645d
chore(api): validate rln message before sending (rest + rpc) (#1968) 2023-09-01 15:03:59 +02:00
Aaryamann Challani d262837ea5
fix(rln-relay): deserialization of valid merkle roots (#1973) 2023-08-31 13:19:43 +05:30
Aaryamann Challani e7b2b88f5b
fix(rln-relay): modify keystore credentials logic (#1956)
* fix(rln-relay): modify keystore credentials logic

fix: bump version

* Update waku/waku_rln_relay/group_manager/on_chain/group_manager.nim

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

* Update tests/waku_rln_relay/test_waku_rln_relay.nim

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

* Update waku/waku_keystore/protocol_types.nim

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

* fix: greatly improve error handling

* fix: display proc and appropriate assert

---------

Co-authored-by: Ivan Folgueira Bande <128452529+Ivansete-status@users.noreply.github.com>
2023-08-29 17:46:21 +05:30
Aaryamann Challani bd3be21929
fix(rln-relay): sync from deployed block number (#1955)
* fix(rln-relay): sync from deployed block number

* fix(rln-relay): remove option usage for ints

* fix: unnecessary decl
2023-08-29 13:12:13 +05:30
Aaryamann Challani 01634f57f0
fix(rln-relay): window of acceptable roots synced to rln metadata (#1953)
* fix(rln-relay): window of acceptable roots synced to rln metadata

* fix(rln-relay): s/var/let, use for loop
2023-08-25 23:29:17 +05:30
Aaryamann Challani cc9f8d4254
chore(rln-relay): integrate waku rln registry (#1943) 2023-08-25 22:48:52 +05:30
Aaryamann Challani c07d63db46
fix(rln-relay): flush_interval incorrectly set (#1933) 2023-08-23 18:23:44 +05:30