2418 Commits

Author SHA1 Message Date
Simon-Pierre Vivier
2ad4432f4e
Merge branch 'master' into chat2disco 2026-07-13 08:32:49 -04:00
NagyZoltanPeter
f28cc7118c
Fix FFI peerId pretty print (#4023)
* Add import fix to node_api too as that has a single stringify peerId spot. Thx @fcecin
2026-07-13 14:17:09 +02:00
Simon-Pierre Vivier
123503f6f0
Merge branch 'master' into chat2disco 2026-07-10 12:00:52 -04:00
Fabiana Cecin
53c084dfdb
chore: move conf types to api/conf (#4024)
* move MessagingClientConf to api/conf/messaging_conf
* move ReliableChannelManagerConf to new api/conf/channels_conf
* impl modules now import their conf module, not the reverse
* logos_delivery_conf uses channels_conf, not reliable_channel_manager
* cleanup import lists
2026-07-10 09:33:28 -03:00
Fabiana Cecin
9f2a1c89ff
Move api config modules to api/conf/ (#4022)
Move api config modules to api/conf/
2026-07-09 18:14:37 -03:00
Fabiana Cecin
28956856bb
Fix interop tests (#4020)
* logosdelivery_create_node takes a flat WakuNodeConf JSON conf (auto-detect)
* Fix tools/confutils/conf_from_json.nim not accepting Port(0)
* Fix: don't mount lightpush without relay
* Add tests
2026-07-09 17:23:34 -03:00
Fabiana Cecin
d83900aa9b
feat: add fleet mode (#4019)
* Rename WakuMode to LogosDeliveryMode, add Fleet mode
* KernelConf (which starts only kernel) is now a distinct WakuNodeConf (starts messaging, for tests)
* Add LogosDelivery.new(kernelConf) (kernel-only)
* Add LogosDelivery.new(kernelConf, messagingOverrides, channelsOverrides) (full stack)
* LogosDeliveryConf.messagingOverrides/channelsOverrides are Option and mount each layer if present
* Add kernel-only LogosDeliveryConf.init(kernelConf)
* Parse {"mode": "fleet", "kernelConf": {...}} in parseLogosDeliveryConf
* Generalize parseOverrides to parse over caller-supplied defaults
* Add requireMessaging/requireChannels FFI guards and apply them
* Make start/stop skip layers that were not mounted (no config)
* Rename toKernelConf to toWakuNodeConf
* Add tests to test_conf.nim
* Misc additions/refactors
2026-07-09 15:57:16 -03:00
Fabiana Cecin
90fa5fa91f
feat: improve config v3 (#4015)
* remove --mode from the CLI
* move WakuMode to the messaging layer
* expose store backend (db url, max connections) and a remote store node on the messaging surface
* wakunode2 with no flags now runs as a full service node (store still opt-in)
* add rateLimitMessagesPerEpoch
* channel rate-limiting auto-enables if epochPeriodSec or messagesPerEpoch is set
* fix JSON conf parser to be generic (works over all config types)
* messaging config = mode + preset + messagingOverrides + channelsOverrides
* add full messaging plus selective kernel config options to MessagingClientConf
* mode (Core/Edge) expands to kernel protocol flags in the messaging layer
* create_node parses the messaging config, drops the flat WakuNodeConf JSON entrypoint
* wire channelsOverrides (segmentation/SDS/rate-limit) into channel creation
* fix liblogosdelivery.h comments and README for the new config shape
* messaging conf tests: switch names, reject-unknown, set-twice, field->kernel
* add kernel log-level, log-format, nodekey to the messaging surface
* Port 0 (ephemeral) default for messaging entry points
* KernelConf alias for WakuNodeConf
* rewrite the FFI examples to the new config shape
* C/C++ examples use preset status.prod
* drop operator-only confs from the examples
* remove duplicate tests & misc test fixes
* Delete p2pReliability from Kernel (Waku) resolver and config (keep preset definition)
* Delete NodeConfig API (deprecation completed by p2pReliability removal from kernel)
* Rename test_messaging_conf.nim to test_conf.nim (tests Logos Delivery config in general)
* Rename messaging_conf_json.nim to logos_delivery_conf_json.nim
* Add logos_delivery_conf.nim (defines LogosDeliveryConf aggregate)
* misc docs/comments cleanups
2026-07-09 12:21:41 -03:00
Tanya S
0a1700e239
replace RLN specific Result with generic Result (#4011) 2026-07-06 17:49:20 +02:00
Ivan FB
21569ef884
ffi: unify node lifecycle on logosdelivery_* and drop legacy waku_* surface (#4012) 2026-07-06 16:13:48 +02:00
Igor Sirotin
7a3a064b52
feat: add status.prod network preset (cluster 16, RLN off) (#3962)
Add a `status.prod` network preset usable from the Messaging API and CLI
(`--preset=status.prod`). It targets the live status.prod network that
Status runs on:

- cluster-id 16
- RLN disabled
- static sharding (fleet shards 1, 32, 64, 128, 256; Status uses 32 & 64)
- max message size 1024KiB
- bootstrap via the status.prod DNS-discovery enrtree and the three fleet boot nodes

Config sourced from https://fleets.waku.org/ and each host's /config.toml.

Closes #3906

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 13:04:57 +01:00
NagyZoltanPeter
42ccb5c673
chore: replace ReliableChannel sendhandler hack (#3994)
* squash original commits and rebase to master: removed sendHandler and replaced by MessagingSend BrokerRequest

* Needed to adapt to new messaging source structure to avoid cyclic imports

* Relocate MessagingSend request broker and eliminate api/requests

* fix ci fails
2026-07-02 17:46:05 +02:00
Darshan
ad17541619
fix: handle peer-exchange stream-closed errors gracefully (#4010) 2026-07-02 18:46:46 +05:30
Tanya S
cbb601ec9f
chore: phase 4 — remove RLN proof generation from lightpush server to client (#4009)
* remove RLN proof generation from lightpush server to client

* set timestamp before generating lightpush msg proof

* Add explicit error message for checkAndGenerateRLNProof and oneline for ensureTimestampSet

* Change ensureTimestampSet from func to proc
2026-07-01 14:02:07 +02:00
Darshan
440bd01cd8
fix: handle on-chain RPC errors gracefully during RLN setup (#4008) 2026-07-01 11:48:32 +05:30
Ivan FB
82dcada1b5
api: define layer contracts with concept, not RootObj inheritance (#4001) 2026-06-30 22:15:04 +02:00
Fabiana Cecin
7b6d5d542c
fix: remove hardcoded ports in tests (#3998)
* Remove hardcoded ports in tests
* Promote getPorts to a public helper in net/net_config.nim
* Make 0.0.0.0:0 a default argument for newTestWakuNode
2026-06-30 14:59:27 -03:00
Ivan FB
a45b785141
messaging: depend on the Waku kernel, not the raw WakuNode (#4000) 2026-06-30 18:00:12 +02:00
Fabiana Cecin
a763a59ac9
fix: fix portsShift feature (#4006)
* Fold portsShift into each port in WakuConfBuilder.build()
* Drop portsShift field from WakuConf
* Drop portsShift param from networkConfiguration, discv5 setup, rest/metrics start
* Keep Port(0) auto-assign sentinel (also fixes port-0 + shift)
* Add regression test: announced port == bound port under portsShift

* Fix lint
2026-06-30 11:30:41 -03:00
NagyZoltanPeter
a7f893555d
Integrate api-shape phase2 (#3989) + api interfaces (#3975) (#3999)
* Reshape per-layer API into api/ folders and thin the FFI over them

Each layer now separates its constructible core from its public surface:

  - core module (waku.nim / messaging_client.nim /
    reliable_channel_manager.nim): the type plus new/start/stop and the
    private construction helpers.
  - api/ folder: one module per differentiated set of operations
    (waku: topics/relay/filter/lightpush/store/peer_manager/discovery/
    debug/health) plus an events surface.

The waku api is reshaped to be the complete operation surface the C
bindings need, so the library no longer reaches into node internals:
relayPublish returns the message hash, relaySubscribe takes an optional
handler, filter/lightpush auto-select the service peer, connectedPeersInfo
returns structured data, pingPeer honours the timeout, plus
relayNumPeersInMesh / relayNumConnectedPeers / isOnline. library/ is now a
thin C-ABI shim: each {.ffi.} proc only marshals cstring/JSON/callbacks and
delegates to ctx.myLib[].waku.<op> (or messagingClient.<op>).
app_callbacks re-exports the modules defining its handler types, which the
included FFI files previously relied on by leakage.

Events move next to the surface that owns them, with each dependency kept
pointing the right way:

  - waku/events/ relocated under waku/api/events/.
  - channel events live in channels/api/events.nim.
  - the four messaging-level message events move to messaging/api/events;
    MessageSeenEvent stays in waku because it is emitted by waku core, so
    moving it would make waku depend on the messaging layer.
  - delivery_events renamed to filter_subscribe_events to match the
    OnFilterSubscribe/Unsubscribe events it actually declares.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Add reliable-channel FFI ops + events (nim-ffi v0.1.3)

Expose the reliable-channel layer through the v0.1.3 FFI:
- channel_create / channel_send / channel_close call the
  ReliableChannelManager api (createReliableChannel / send / closeChannel),
  marshalling channel id + base64 payload + ephemeral by hand
- channel message received / sent / errored are surfaced by listening to the
  channel-layer broker events in start_node and forwarding them through
  callEventCallback (received payload base64-encoded), dropped in stop_node

Stays on nim-ffi v0.1.3 (no typed/CBOR rewrite).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Expose reliable-channel ops in the stable C header (#3851)

The library already ships as a single .so with a tiered header surface
(liblogosdelivery.h = stable Messaging/Reliable-Channels, liblogosdelivery_kernel.h
= advanced Kernel). Per that tiering, the reliable-channel ops belong on the
stable surface, so declare channel_create / channel_send / channel_close in
liblogosdelivery.h and document the channel lifecycle events delivered through
the event callback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Graft PR#3975 interface layer onto decomposed foundation (events deduped)

Add IKernel/IMessagingClient/IReliableChannelManager/ILogosDelivery interface
classes under logos_delivery/api/. The EventBroker types PR#3975 hoisted into
these files already exist in PR#3989's decomposed */api/events/ modules, so the
interface files re-export those modules instead of redefining the types
(avoids 8 duplicate EventBroker definitions). api/types.nim kept at the
foundation version (ChannelId stays in channels/types.nim, which the decomposed
modules import).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Wire impl classes to interfaces (inherit; relocate SendHandler)

- Waku : IKernel, MessagingClient : IMessagingClient,
  ReliableChannelManager : IReliableChannelManager.
- The operation procs already live in PR#3989's decomposed */api/ modules and
  stay as plain procs (nothing dispatches through the interface types, so no
  method-ization is needed).
- SendHandler now lives in reliable_channel_manager_api.nim (its PR#3975 home);
  removed the duplicate from reliable_channel.nim, which re-exports the
  interface module so channels/api/{channel_lifecycle,send} still see it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Wire LogosDelivery to ILogosDelivery orchestrator interface

LogosDelivery : ILogosDelivery; start/stop/isOnline become method overrides.
Peripheral PR#3975 edits (lightpush/store clients, self_req_handlers,
statistics) are import-reorg artifacts of deleting waku/utils/requests.nim,
which the decomposed structure keeps -- so they are intentionally not ported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Dedup EventConnectionStatusChange (re-export from health_events)

9th duplicate EventBroker type: defined in both logos_delivery_api.nim and the
decomposed waku/api/events/health_events.nim. The interface file now re-exports
it. liblogosdelivery builds clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Move events back into interface-class source files (restore #3975 placement)

Reverses the earlier dedup-by-re-export: event TYPE definitions now live in the
interface classes, and the emptied decomposed event files are removed.

- MessageSeenEvent            -> logos_delivery/api/kernel_api.nim
- Message{Sent,Error,Propagated,Received}Event -> api/messaging_client_api.nim
- ChannelMessage{Received,Sent,Error}Event     -> api/reliable_channel_manager_api.nim
- EventConnectionStatusChange -> api/logos_delivery_api.nim

Deleted (became empty after the move):
- logos_delivery/waku/api/events/message_events.nim
- logos_delivery/messaging/api/events.nim
- logos_delivery/channels/api/events.nim
health_events.nim keeps its two remaining events (content/shard topic health).

Rewiring: each layer re-exports its interface module (waku->kernel_api,
messaging_client->messaging_client_api, reliable_channel->reliable_channel_manager_api,
which also re-exports messaging_client_api). Deep emitters/listeners
(subscription_manager, waku_node, waku_node/relay, node_health_monitor,
recv_service, send_service) import the owning interface module directly.
kernel_api stays below node level (types/topics/message/store-common) so the
node->kernel_api imports are acyclic. liblogosdelivery builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* nph formatting

---------

Co-authored-by: Ivan FB <ivansete@status.im>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 11:51:22 +02:00
Darshan
a4cd261fc7
fix: start_node() after stop_node() re-opens the listener (#4007) 2026-06-30 11:40:11 +02:00
Tanya S
ec36e09bae
chore: phase 3 — inline RLN validator, allow mountRlnRelay without wakuRelay (#3985)
* Add rln validator to mountRlnRelay

* remove requirement for relay when mounting RLN

* Rename mountRlnRelay to setRlnValidator

* Clean up setRlnValidator: update log wording, drop unused let bindings

* Fix botched setRlnValidator callsites from rename

* Drop obsolete test: setRlnValidator no longer requires relay

* Remove unused code in test utils

* remove unused import for rln
2026-06-29 13:01:04 +02:00
Tanya S
57ff24760f
chore: phase 2 — rename/restructure waku_rln_relay → waku_rln (#3978)
* move rln specific procs and types

* Renaming and restructuring RLN module

* Rename waku_rln_relay to waku_rln

* rename rln-relay types to rln

* Fix linting

* update logScope topics to match new rln module name

* Rename waku_rln module to rln

* Rename WakuRln type to Rln, rename FFI raw type to RlnRaw to avoid collision

* Apply nph formatting

* Rename local rlnRelay to rln in mountRlnRelay
2026-06-27 12:28:59 +02:00
AYAHASSAN287
26098d76cf
Add send API e2e tests to the PR job (#3983)
* Add send API e2e tests to the PR job

* Update yml reference

* ci: pin interop smoke tests to SMOKE_TEST_2026.06.25 tag

* ci: retrigger CI

* ci: retrigger CI
2026-06-26 18:36:06 +02:00
Tanya S
4ba5710a15
chore: phase 1 - extract generateRlnValidator into temp adapter dir (#3984)
* extract generateRlnValidator into temp adapter dir

* fix linting
2026-06-26 14:43:40 +02:00
Darshan
3eebc7288b
test: add S16 lightpush dynamic-recovery unittest (#3995) 2026-06-26 01:23:57 +05:30
Tanya S
fc15430e52
Temporarily extend ci test job timeout (#3997) 2026-06-25 17:13:38 +02:00
NagyZoltanPeter
6d35800fce
Chore: api shape phase2 (#3974)
* Move waku.nim from waku/factory to under waku/
* remove unused
* Realize Kernel API in scope of Waku class
* Refactor waku/api into messaging_client, waku/api/types and api_conf into logos_delivery/api
* Make liblogosdelivery and wakunode2 compile, remove waku/api.nim as it was just a import orchestrator
* make test compile and run
* Reconcile master's new send tests to LogosDelivery API after rebase

master commits #3965/#3669-followup added two test cases (Edge lightpush
delivery #3847, store-validation timeout) written against the removed
waku/api.nim createNode helper. Rewrite them to the LogosDelivery shape:
createNode -> LogosDelivery.new, node.node -> node.waku.node,
node.brokerCtx -> node.waku.brokerCtx, node.send -> node.messagingClient.send,
and drop the now-implicit mountMessagingClient calls (LogosDelivery.new
mounts the client internally).
2026-06-25 09:27:01 +02:00
Fabiana Cecin
56b92cfd71
chore: Fix .md docs (fix broken links, add QUIC notes) (#3988) 2026-06-25 09:11:52 +02:00
Ivan FB
5c20f48ab3
chore: build C/C++ examples on macOS via POSIX getopt (#3982) 2026-06-24 14:44:44 +02:00
Tanya S
b279533214
Apply LogosDelivery Orchestrator changes to api_send tests (#3976) 2026-06-24 10:43:16 +02:00
NagyZoltanPeter
8501d051a1
fix - Cap store checks on propagated messages by MessagingClient (#3965)
* Frame send service store checks and cap to 1 min per task

* Add test for store not verify case
2026-06-23 12:22:16 +02:00
Ivan FB
5309ce294b
fix: retry send tasks stuck in Entry state 2026-06-23 11:39:35 +02:00
Ivan FB
1a3b3204fa
feat: add LogosDelivery orchestrator as project entry point for FFI (#3970) 2026-06-23 01:20:09 +02:00
NagyZoltanPeter
2fe7e1c373
Workaround MacOS build issue caused by between new bearssl 0.2.9 and crhonos 2.2.4 (#3969) 2026-06-22 10:01:54 +02:00
Ivan FB
319c0c68fe
chore: simplify release process — merge deploy into prepare_release (#3964)
Co-authored-by: Igor Sirotin <sirotin@status.im>
2026-06-19 15:29:33 +02:00
Simon-Pierre
4795d9f081
fix rebase 2026-06-18 13:23:32 -04:00
Simon-Pierre
6562b14efe
broker hook & 2026-06-18 13:17:04 -04:00
Simon-Pierre
ec62e13914
fixes 2026-06-18 13:17:02 -04:00
Simon-Pierre
bbfa4cc529
rebase fix 2026-06-18 13:15:49 -04:00
Simon-Pierre
c826388628
chat2disco init 2026-06-18 13:15:47 -04:00
Simon-Pierre
eb02a3fb74
update config 2026-06-18 13:15:02 -04:00
SionoiS
2c345199c6
kademlia discovery first draft 2026-06-18 13:15:00 -04:00
Fabiana Cecin
20d43c577b
pin json_rpc, lsquic, boringssl to release tags
* json_rpc: to v0.6.1 tag (latest)
* lsquic: v0.5.1 (latest; QUIC connection-handling fixes)
* boringssl: v0.0.8 (latest)
2026-06-18 13:14:59 -04:00
Fabiana Cecin
6ce9925f66
remove dep forks 2026-06-18 13:14:57 -04:00
Fabiana Cecin
573da98390
Get nim-libp2p 2.0.0 bump to E2E working state (WIP)
* deps: json_rpc + web3 via websock-relaxed forks (WIP: revert on upstream fix)
* fix: setup() post-build switch services (autonat nil segfault)
* fix: unified 2.0.0 connection limits
* test: 2.0.0 defaults (identify-push, agent string)
* test: drop reboot/reconnect (unsupported Switch restart)
2026-06-18 13:14:55 -04:00
Fabiana Cecin
7fb87c4a75
pin json_rpc, lsquic, boringssl to release tags
* json_rpc: to v0.6.1 tag (latest)
* lsquic: v0.5.1 (latest; QUIC connection-handling fixes)
* boringssl: v0.0.8 (latest)
2026-06-18 13:07:48 -04:00
Fabiana Cecin
f21ef7f384
remove dep forks 2026-06-18 13:07:47 -04:00
Fabiana Cecin
b2994db0a0
Get nim-libp2p 2.0.0 bump to E2E working state (WIP)
* deps: json_rpc + web3 via websock-relaxed forks (WIP: revert on upstream fix)
* fix: setup() post-build switch services (autonat nil segfault)
* fix: unified 2.0.0 connection limits
* test: 2.0.0 defaults (identify-push, agent string)
* test: drop reboot/reconnect (unsupported Switch restart)
2026-06-18 13:07:44 -04:00
Simon-Pierre Vivier
a73035e28d
feat: integrate service discovery (#3947)
---------

Co-authored-by: Fabiana Cecin <fabiana@waku.org>
2026-06-18 12:51:27 -04:00