* 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.
processMessage legitimately returns (nil, nil) when a message is still
segmented-incomplete or gets re-queued because its hash ratchet key has
not arrived yet. processQueuedHashRatchetMessages dereferenced that nil
response (the shadowed r), crashing the whole app with SIGSEGV. Skip
such messages and leave them in the queue.
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.
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.
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.
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>