1419 Commits

Author SHA1 Message Date
Ivan FB
34c197c5cd
avoid keeping delivery tasks in propagated state when check store is disabled (#3843) 2026-05-15 17:39:38 +02:00
Fabiana Cecin
cb35b59f95
stop recv_service from delivering messages on unsubscribed topics for store-recovered messages (#3874)
* fix/harden recv_service so it won't deliver messages on unsubscribed content topics
* fix SubscrptionManager's subscribed-content-topics iterator
* fix broken store-message-receive test
* misc cleanups
2026-05-13 12:09:56 -03:00
Ivan FB
f23983f488
ensure peers are retrieved in random order from peer store (#3860) 2026-05-13 15:29:11 +02:00
darshankabariya
a537c85594
Merge branch 'master' into update_master_from_v0.38 2026-05-13 16:25:35 +05:30
Fabiana Cecin
71a369ffad
feat: allow a port value of zero for service ports (auto-assign port) (#3828)
* any port set to 0 on conf results in a random port bound
* Debug API MyBoundPorts reports actually bound ports for all services, reports 0 if disabled
* write back bound values to both WakuConf and WakuNode.ports
* setupDiscoveryV5 returns Result and errors out on port 0
* rename setupAndStartDiscv5WithAutoPort to setupAndStartDiscv5
* updateWaku ENR rebuild now runs after discv5 startup
* Add DefaultP2pTcpPort, DefaultDiscv5UdpPort, DefaultWebSocketPort, DefaultRestPort, DefaultMetricsHttpPort
* add tests
2026-05-11 15:22:22 -03:00
Ivan FB
35da224d5d
Evict peer instead of abrupt disconnect and avoid sending unnecessary store requests (#3857)
* peer manager not disconnect abruptly ongoing service peers streams
* fix: recv_service delivers store-recovered messages (#3805)
* recv_service now delivers store-recovered messages via MessageReceivedEvent
2026-05-07 17:28:30 +02:00
Ivan FB
27ae07adaa
receive_service: ensure fetch msgs query is performed when missing msg (#3849) 2026-05-06 19:58:19 +02:00
Ivan FB
587014e34f
add event_loop_accumulates_lag_secs (#3833) 2026-04-30 00:27:38 +02:00
NagyZoltanPeter
300f584efc
Removed duplicates of announcedAddresses, extMultiaddresses (#3831)
Removing duplicates of multiaddresses for Enr.
Safe building Enr Record.

Co-authored-by: Copilot <copilot@github.com>
2026-04-29 15:10:21 +02:00
Fabiana Cecin
ff98d85313
fix: relay validator registration and sync filter (#3823)
* reuse stored validator in relay
* fix skip check in store sync
* increase sync tolerance in test (matches similar test)
2026-04-23 21:02:34 +02:00
Fabiana Cecin
bb8a7e8782
Fix redundant start/stop calls (#3817)
* remove redundant proto start/stop calls from node start/stop
* fix WakuRelay start/stop not overriding GossipSub start/stop
* replace startRelay with reconnectRelayPeers
2026-04-22 09:52:57 -03:00
Ivan FB
260def68ad
use EWMA to show main loop lag information (#3808) 2026-04-20 18:05:44 +02:00
Ivan FB
cda0197168
use nimble 0.22.3 and more appropriate nimble.lock (#3809) 2026-04-20 13:54:34 +02:00
Fabiana Cecin
9cbb4e7338
fix: prefer --num-shards-in-network over preset (#3816)
* fill numShardsInCluster from preset when builder slot is none
* add regression tests
2026-04-20 13:48:27 +02:00
Fabiana Cecin
9ae108b4a7
Fix peer stats endpoint (#3815) 2026-04-20 08:16:01 -03:00
Fabiana Cecin
ca4dbb19e0
Improve logging of content topic on server (#3818) 2026-04-20 13:05:54 +02:00
Darshan
ecd3758580
Merge pull request #3760 from logos-messaging/release/v0.38 2026-04-14 18:17:49 +05:30
Fabiana Cecin
494ea94606
fix: recv_service delivers store-recovered messages (#3805)
* recv_service now delivers store-recovered messages via MessageReceivedEvent
* add regression test_api_receive to prove store recovery actually delivers messages
* fix confusing "UNSUCCESSFUL / Missed message" log message
* removed some dead/duplicated code

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
Co-authored by Zoltan Nagy
2026-04-09 14:29:17 -03:00
Ivan FB
ca7ec3de05
add main loop lag monitor (#3803)
* add loop lagging as health status
2026-04-09 16:51:46 +02:00
Ivan FB
f5762af4c4
Start using nimble and deprecate vendor dependencies (#3798)
Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
Co-authored-by: Darshan K <35736874+darshankabariya@users.noreply.github.com>
2026-04-08 12:42:14 +02:00
darshankabariya
b2e46b6e91
Merge branch 'master' into release/v0.38 2026-04-08 00:55:39 +05:30
Fabiana Cecin
56359e49ed
prefer reusing service peers across shards in edge filter reconciliation (#3789)
* selectFilterCandidates prefers peers already serving other shards
* restructure edgeFilterSubLoop (plan all dials then execute) for safety
2026-04-06 11:08:47 -03:00
Fabiana Cecin
dc026bbff1
feat: active filter subscription management for edge nodes (#3773)
feat: active filter subscription management for edge nodes

## Subscription Manager
* edgeFilterSubLoop reconciles desired vs actual filter subscriptions
* edgeFilterHealthLoop pings filter peers, evicts stale ones
* EdgeFilterSubState per-shard tracking of confirmed peers and health
* best-effort unsubscribe on peer removal
* RequestEdgeShardHealth and RequestEdgeFilterPeerCount broker providers

## WakuNode
* Remove old edge health loop (loopEdgeHealth, edgeHealthEvent, calculateEdgeTopicHealth)
* Register MessageSeenEvent push handler on filter client during start
* startDeliveryService now returns `Result[void, string]` and propagates errors

## Health Monitor
* getFilterClientHealth queries RequestEdgeFilterPeerCount via broker
* Shard/content health providers fall back to RequestEdgeShardHealth when relay inactive
* Listen to EventShardTopicHealthChange for health recalculation
* Add missing return p.notReady() on failed edge filter peer count request
* HealthyThreshold constant moved to `connection_status.nim`

## Broker types
* RequestEdgeShardHealth, RequestEdgeFilterPeerCount request types
* EventShardTopicHealthChange event type

## Filter Client
* Add timeout parameter to ping proc

## Tests
* Health monitor event tests with per-node lockNewGlobalBrokerContext
* Edge (light client) health update test
* Edge health driven by confirmed filter subscriptions test
* API subscription tests: sub/receive, failover, peer replacement

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
Co-authored by Zoltan Nagy
2026-03-30 08:30:34 -03:00
Ivan FB
0623c10635
completely remove storev2 (#3781) 2026-03-30 00:08:08 +02:00
Ivan FB
0b86093247
allow override user-message-rate-limit (#3778) 2026-03-25 13:23:20 +01:00
Ivan Folgueira Bande
37f587f057
set default retention policy in archive.nim 2026-03-24 12:03:21 +01:00
Ivan FB
d2fdd6ff36
allow union of several retention policies (#3766)
* refactor retention policy to allow union of several retention policies
* bug fix time retention policy
* add removal of orphan partitions if any
* use nim-http-utils 0.4.1
2026-03-24 09:22:43 +01:00
Ivan FB
6a20ee9c83
Merge pull request #3771 from logos-messaging/merge-v037-branch-into-master
This aims to bring recent fixes added into release/v0.37 branch into master
2026-03-23 12:31:38 +01:00
Ivan Folgueira Bande
de3143e351
set default retention policy in archive.nim 2026-03-20 21:05:42 +01:00
Ivan Folgueira Bande
d1ac84a80f
Merge branch 'master' into merge-v037-branch-into-master 2026-03-20 11:26:35 +01:00
Ivan FB
3e7aa18a42
force FINALIZE partition detach after detecting shorter error (#3728) 2026-03-20 00:16:16 +01:00
Ivan FB
11461aed44
allow union of several retention policies (#3766)
* refactor retention policy to allow union of several retention policies
* bug fix time retention policy
* add removal of orphan partitions if any
* use nim-http-utils 0.4.1
2026-03-19 21:37:04 +01:00
Fabiana Cecin
614f171626
nim nph 0.7.0 formatting (#3759) 2026-03-17 14:15:35 +01:00
Ivan FB
96f1c40ab3
simple refactor in waku mix protocol mostly to rm duplicated log (#3752) 2026-03-13 14:33:24 +01:00
Tanya S
bc9454db5e
Chore: Simplify on chain group manager error handling (#3678) 2026-03-13 01:57:50 +05:30
Ivan FB
dedc2501db
fix avoid IndexDefect if DB error message is short (#3725) 2026-03-12 09:24:58 +01:00
NagyZoltanPeter
1f9c4cb8cc
Chore: adapt cli args for delivery api (#3744)
* LogosDeliveryAPI: NodeConfig -> WakluNodeConf + mode selector and logos.dev preset

* Adjustment made on test, logos.dev preset

* change default agentString from nwaku to logos-delivery

* Add p2pReliability switch to presets and make it default to true.

* Borrow entryNode idea from NodeConfig to WakuNodeConf to easy shortcut among diffrent bootstrap node list all needs different formats

* Fix rateLimit assignment for builder

* Remove Core mode default as we already have a defaul, user must override

* Removed obsolate API createNode with NodeConfig - tests are refactored for WakuNodeConf usage

* Fix failing test due to twn-clusterid(1) default has overwrite for maxMessagSize. Fix readme.
2026-03-03 19:17:54 +01:00
Ivan FB
09618a2656
Add debug API in liblogosdelivery (#3742) 2026-03-03 13:32:45 +01:00
Fabiana Cecin
7e36e26867
Fix NodeHealthMonitor logspam (#3743) 2026-03-03 12:11:16 +01:00
Fabiana Cecin
51ec09c39d
Implement stateful SubscriptionService for Core mode (#3732)
* SubscriptionManager tracks shard and content topic interest
* RecvService emits MessageReceivedEvent on subscribed content topics
* Route MAPI through old Kernel API relay unique-handler infra to avoid code duplication
* Encode current gen-zero network policy: on Core node boot, subscribe to all pubsub topics (all shards)
* Add test_api_subscriptions.nim (basic relay/core testing only)
* Removed any MAPI Edge sub/unsub/receive support code that was there (will add in next PR)
* Hook MessageSeenEvent to Kernel API bus
* Fix MAPI vs Kernel API unique relay handler support
* RecvService delegating topic subs to SubscriptionManager
* RecvService emits MessageReceivedEvent (fully filtered)
* Rename old SubscriptionManager to LegacySubscriptionManager
2026-03-02 14:52:36 -03:00
Prem Chaitanya Prathi
335600ebcb
feat: waku kademlia integration and mix updates (#3722)
* feat: integrate mix protocol with extended kademlia discovery

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2026-02-19 10:26:17 +05:30
NagyZoltanPeter
3603b838b9
feat: liblogosdelivery FFI library of new API (#3714)
* Initial for liblogosdelivery library (static & dynamic) based on current state of API. 
* nix build support added.
* logosdelivery_example
* Added support for missing logLevel/logFormat in new API create_node
* Added full JSON to NodeConfig support
* Added ctx and ctx.myLib check to avoid uninitialzed calls and crash. Adjusted logosdelivery_example with proper error handling and JSON config format
* target aware install phase
* Fix base64 decode of payload
2026-02-17 10:38:35 +01:00
Ivan FB
b38b5aaea1
force FINALIZE partition detach after detecting shorter error (#3728) 2026-02-17 00:18:46 +01:00
Ivan FB
8f29070dcf
fix avoid IndexDefect if DB error message is short (#3725) 2026-02-16 11:49:35 +01:00
NagyZoltanPeter
84f791100f
fix: peer selection by shard and rendezvous/metadata sharding initialization (#3718)
* Fix peer selection for cases where ENR is not yet advertiesed but metadata exchange already adjusted supported shards. Fix initialization rendezvous protocol with configured and autoshards to let connect to relay nodes without having a valid subscribed shard already. This solves issue for autoshard nodes to connect ahead of subscribing.
* Extend peer selection, rendezvous and metadata tests
* Fix rendezvous test, fix metadata test failing due wrong setup, added it into all_tests
2026-02-13 11:23:21 +01:00
Fabiana Cecin
1fb4d1eab0
feat: implement Waku API Health spec (#3689)
* Fix protocol strength metric to consider connected peers only
* Remove polling loop; event-driven node connection health updates
* Remove 10s WakuRelay topic health polling loop; now event-driven
* Change NodeHealthStatus to ConnectionStatus
* Change new nodeState (rest API /health) field to connectionStatus
* Add getSyncProtocolHealthInfo and getSyncNodeHealthReport
* Add ConnectionStatusChangeEvent
* Add RequestHealthReport
* Refactor sync/async protocol health queries in the health monitor
* Add EventRelayTopicHealthChange
* Add EventWakuPeer emitted by PeerManager
* Add Edge support for topics health requests and events
* Rename "RelayTopic" -> "Topic"
* Add RequestContentTopicsHealth sync request
* Add EventContentTopicHealthChange
* Rename RequestTopicsHealth -> RequestShardTopicsHealth
* Remove health check gating from checkApiAvailability
* Add basic health smoke tests
* Other misc improvements, refactors, fixes

Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2026-02-12 14:52:39 -03:00
Fabiana Cecin
a8bdbca98a
Simplify NodeHealthMonitor creation (#3716)
Simplify NodeHealthMonitor creation

* Force NodeHealthMonitor.new() to set up a WakuNode
* Remove all checks for isNil(node) in NodeHealthMonitor
* Fix tests to use the new NodeHealthMonitor.new()

Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
2026-02-11 10:36:37 -03:00
Darshan
6421685eca
chore: bump v0.38.0 (#3712) 2026-02-10 22:30:57 +01:00
NagyZoltanPeter
1fd25355e0
feat: waku api send (#3669)
* Introduce api/send
Added events and requests for support.
Reworked delivery_monitor into a featured devlivery_service, that
- supports relay publish and lightpush depending on configuration but with fallback options
- if available and configured it utilizes store api to confirm message delivery
- emits message delivery events accordingly

prepare for use in api_example

* Fix edge mode config and test added
* Fix some import issues, start and stop waku shall not throw exception but return with result properly
* Utlize sync RequestBroker, adapt to non-async broker usage and gcsafe where appropriate, removed leftover
* add api_example app to examples2
* Adapt after merge from master
* Adapt code for using broker context
* Fix brokerCtx settings for all usedbrokers, cover locked node init
* Various fixes upon test failures. Added initial of subscribe API and auto-subscribe for send api
* More test added
* Fix multi propagate event emit, fix fail send test case
* Fix rebase
* Fix PushMessageHandlers in tests
* adapt libwaku to api changes
* Fix relay test by adapting publish return error in case NoPeersToPublish
* Addressing all remaining review findings. Removed leftovers. Fixed loggings and typos
* Fix rln relay broker, missed brokerCtx
* Fix rest relay test failed, due to publish will fail if no peer avail
* ignore anvil test state file
* Make terst_wakunode_rln_relay broker context aware to fix
* Fix waku rln tests by having them broker context aware
* fix typo in test_app.nim
2026-01-30 01:06:00 +01:00
Darshan
91b4c5f52e
fix: store protocol issue in v0.37.0 (#3657) 2026-01-17 17:05:25 +05:30