10 Commits
Author SHA1 Message Date
Igor Sirotin ab5daa4683 chore: remove unnecessary numeric import aliases (#7711)
* chore: drop redundant numeric import aliases

Refactoring left behind import aliases like `datasync2`/`types3` that
just repeat the package name. Remove them where the plain package name is
unambiguous in the file, and drop three duplicate imports of the same path.

* chore: name colliding type imports after repo convention

Where two packages named `types` (or `rpc`) meet in one file an alias is
unavoidable, so use the descriptive names already dominant in the tree
(cryptotypes, messagingtypes, wakutypes, accsmanagementtypes, wsdktypes,
noderpc) instead of types2/types3/rpc2, and spell the messaging/waku
import wakuv2 everywhere (was wakuv/wakuv2/wakuv3).

* chore: rename package wakuv2 to waku

The package in pkg/messaging/waku still declared itself `wakuv2`, which
forced every import site to carry an alias (goimports re-adds one when the
package name differs from its directory). Rename the package so the import
can stand as-is, and rename the local `waku` variable in transport_test.go
to `wakuNode` to free up the name.

* chore: unalias protocol/contacts import in protocol tests and backup

`contacts2` was only needed because local variables took the package name.
Rename those to what they hold — syncContacts for the sync messages built in
backupContacts, addedContacts/allContacts in the contact request and
verification tests — and import the package as-is.
2026-08-17 14:04:09 +01:00
Andrey Bocharnikov 783a0779cb test(messaging): queued hash ratchet message that can't process yet survives replay
Red on the parent commit: the replay dereferenced the nil response and
crashed. Green with the guard: the stray message stays queued under its
own key and the rest of the replay completes.
2026-08-14 13:12:49 +04:00
Jonathan Rainville b7b5f827a7 fix(sds): fix SDS stayed closed after coming back from offline
Reliability.Stop() destroyed the SDS reliability manager while Start() only
rebuilt the mvds datasync node, so the first offline->online transition (driven
by Core.connectionChanged) left SDS nil for the rest of the process and every
subsequent message — live or fetched from a store node — arrived still
SDS-wrapped, failed to decode at the application layer and surfaced as type
UNKNOWN. Stop() now tears down only the datasync node and preserves SDS, whose bloom filter and causal history are exactly the state needed to detect what was missed while offline; a new Close() releases it on shutdown, and Start()
rebuilds it if it is ever missing. Two related bugs are fixed alongside:
UnwrapPayloadFromSDS now returns ErrSDSManagerUnavailable when the manager is gone instead of silently passing the wrapped payload through (it still passes through, error-free, when a payload is simply not SDS-wrapped), and the
processor propagates that error so the envelope is retried rather than
confirmed as processed. sdsManager is stored in an atomic.Pointer, since the
hot path read it without holding the lock that Start/Stop write under.
2026-08-11 16:24:26 -04:00
Jonathan Rainville daec193d5b chore: add tests to SDS wrapping and unwrapping 2026-08-03 13:48:10 -04:00
Jonathan Rainville 40db5cc35a feat(sds): enable sds wrapping and fetching of retrieval hints
Fixes #7363

Enables the SDS wrapping flag.
Sets up the handler that wraps SDS messages with retrieval hints. Those hints are the envelope IDs of the messages that were sent and received
Sets up the unwrapping and fetching when there are missed messages detected.
Adds a new function that enables fetching per envelope ID instead than per topic.
2026-08-03 13:48:10 -04:00
Igor SirotinandClaude Opus 4.8 312565ee9e refactor(messaging): drop onPeerStats / onHistoricMessagesRequestFailed (#7598)
status-app no longer consumes the peer-stats push or the historic-messages-
request-failed signal, so remove both callback chains from the messaging stack:

- onHistoricMessagesRequestFailed: the signal (SendHistoricMessagesRequestFailed
  + EventHistoryRequestFailed), the messaging config option, the wakuv3.New
  parameter, and the OnRequestFailed hook on the store pager's envelopeProcessor.
- onPeerStats / SendPeerStats: the wakuv2.peerstats signal, the config option,
  and the push from checkForConnectionChanges.

Peer-stats reporting is removed but connection/online detection is preserved:
ConnStatus is slimmed to {IsOnline}, so the SubscribeToConnStatusChanges
subscription now carries only the online flag (used by the messenger for
connection-change detection). The Peers() RPC + PeerStats/WakuV2Peer types are
kept for the Python functional tests. Online detection is unaffected — it comes
from the libp2p peer count, independent of the removed push.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 11:38:04 +01:00
Igor Sirotin 24d0132145 chore: fix numbered import names (#7416) 2026-04-16 13:22:54 +01:00
Igor Sirotin 63fe9e7227 feat: sds unwrapping (#7227)
* feat: Add SDS unwrap process for received messages (#7149)

* feat: enable sds for wrap message

* chore: add sds default flag

* feat: enable sds for public community message

* fix: always set community id

* feat: add message ID for public params

* chore: move sds to reliability

* chore: refactor flags

* chore: add unit test for sds

* chore: fix test

* chore: add test-single helper

* chore: update Makefile

Co-authored-by: Igor Sirotin <sirotin@status.im>

* chore: update logs

Co-authored-by: Igor Sirotin <sirotin@status.im>

* chore: refactor function name for init sds

* chore: merge upstream

* chore: refactor sds processor

* chore: move sds wrap logic to messaging sender.

* chore: refactor sds manager

* chore: disable sds wrap

* fix: disable Nim signal handler

---------

Co-authored-by: Igor Sirotin <sirotin@status.im>

* fix: cleanup sds manager

* feat: set sds logger

* chore: update sds-go-bindings

* test: named loggers

* test: TestSdsFileDescriptors

* chore: vendor hash

* feat: support updating nim-sds

* fix: TestSdsFileDescriptors skip comment

* chore: bump sds-go-bindings

* chore: bump nim-sds

* chore: vendor hash
2025-12-22 19:57:36 +00:00
Igor Sirotin 30935148c4 refactor: project layout (crypto, logutils, rpc, accounts-management) (#7226)
* refactor: internal/crypto

* refactor: internal/logutils

* chore: internal/rpc

* refactor: internal/accounts-management
2025-12-18 12:24:40 +00:00
Igor Sirotin 0fcf4ceb8e refactor: project layout (messaging) (#7224)
* refactor: pkg/messaging

* fix: address non-go changes
2025-12-17 19:40:40 +00:00