13 Commits
Author SHA1 Message Date
Igor Sirotin d1e9ae5225 refactor: extract a networks service (#7748)
The network manager lived in internal/rpc and was constructed, started
and stopped by rpc.Client, which reached back into it to route calls by
chain. It is now a service of its own at pkg/services/networks.

StatusNode owns the manager and hands it to rpc.Client through
ClientConfig, so the client depends on ManagerInterface rather than the
concrete type. The service owns the manager lifecycle.

The four live network RPC methods are registered under the networks_
namespace. The wallet_ ones are left in place so nothing breaks before
the app migrates; they are removed at the end of the stack.
2026-08-26 18:05:03 +01:00
Andrey Bocharnikov ee9336a8ca feat: collect a privacy-safe account load profile on demand
Reproducing a reporter's performance problem currently means guessing the
shape of their account: how many messages they hold, how those spread over
chats, how far behind their sync state is. Guessing that cost days on
status-im/status-app#21605.

Add a storagestats service that answers those questions with numbers a
reporter can paste into a public ticket. `storagestats_collect` starts a
background walk and returns immediately; progress arrives as
storage-stats.progress ("N of M", with M known upfront because the table
list is enumerated first) and the finished profile as storage-stats.result.
Nothing is collected unless a caller asks.

The walk is serial on purpose: COUNT(*) on a sqlcipher table is a full
decrypting scan, so running several at once would only starve the process it
is meant to describe. It must never be driven from a client's UI thread.

Privacy is enforced by construction: time appears only as relative day
counts, no per-entity row is ever read (the per-chat histogram query selects
counts and nothing else), and the only strings in the artifact are table
names from our own schema.

Section one carries curated metrics whose names mirror the seeder harness
knobs so a profile maps onto a harness run; section two is a schema-agnostic
table -> {rows, bytes} dump of both databases, insurance against the next
surprise living in a table nobody predicted. A step that fails names itself
in `incomplete` rather than leaving a zero that reads as "this account has
none".
2026-08-21 14:50:20 +04:00
Igor Sirotin f9cc782a6f refactor: move services to pkg/services
Part of the Go project layout migration, item 31.

Pure move plus import-path rewrite across 687 files. No API or behaviour
change.

The services keep their grouping under pkg/services/<name> rather than
being promoted to pkg/<name>: 27 top-level directories in pkg/ would read
worse than what we have, and the grouping is what makes "an RPC service"
identifiable at a glance.

Paths that follow the move: the logosstorage test target and generate
step, the two wallet token-list tools, the migration-order check (and the
pre-rebase hook symlinked to it), and the storage env helper.

refs #7067
2026-08-21 10:11:05 +02:00
Igor Sirotin 5029be4631 refactor: dissolve the root server package
`server` was one Go package doing three unrelated jobs. Each moves to
where it belongs:

  server/pairing/         -> services/pairing/
  server_media*.go,
  handlers*.go, testdata/ -> services/media/
  server.go, certs.go,
  ips.go, timeout.go,
  device.go, listen_*.go,
  servertest/             -> internal/httpserver/

MediaServer is renamed to media.Server (and NewMediaServer to
media.NewServer) now that it has a package to be named against.
Deliberately untouched: StatusNode.MediaServer(), which is an accessor
method rather than the type, and the unrelated identifiers that only
share the prefix (MediaServerImageID, MediaServerContactIcon,
MediaServerEnableTLS, ...).

Two identifiers had to be reassigned to make the boundary clean:

- certs.go held both the generic X509/TLS helpers and the media server's
  process-global certificate. Split: the generic half stays in
  internal/httpserver, generateMediaTLSCert and PublicMediaTLSCert move
  to services/media.
- HandlerPatternMap was declared in handlers.go but is a plain HTTP type
  that server.go depends on; it moves to internal/httpserver.

The media server URL tests moved with the type, and reached three
unexported Server fields they could touch while everything shared a
package. internal/httpserver now exposes ListeningAddr() and CachedPort()
(both reasonable API) plus a clearly-marked SetURLStateForTest.

Nothing else crossed the boundary, and the split is one-directional:
services/media and services/pairing import internal/httpserver, never the
reverse.

refs #7067
2026-08-20 20:59:45 +02:00
Igor Sirotin 23febf1645 refactor: dissolve the root common package
`common` was a grab-bag with no domain: the issue's own preamble names
it as the kind of package that must not exist. Every symbol moves to the
package that owns it, and the directory is deleted.

  common/dbsetup            -> internal/db/dbsetup
  common/devices.go         -> internal/platform
  common/pausable*.go       -> internal/pausable
  LogOnPanic                -> internal/panics
  TruncateWithDot(N)        -> internal/logutils
  RecoverKey, ValidateDisplayName, display-name errors -> protocol/common
  IpfsGatewayURL            -> internal/ipfs.GatewayURL
  Archives/TorrentTorrentsRelativePath, MainnetEthereumNetworkURL -> params
  StatusService             -> pkg/backend/node
  ErrBigIntSetFromString    -> services/wallet
  IsNil, Ptr                -> inlined at their call sites
  IsENSName                 -> deleted, it had no callers

Notes:
- LogOnPanic gets its own package rather than living in logutils. It
  reports to Sentry, and logutils is imported by nearly everything: put
  the guard in logutils and the Sentry SDK lands in every dependency
  graph in the tree (213 -> 250 packages). internal/panics imports
  logutils and sentry, which is the direction root `common` had.
- TruncateWithDot is log redaction, not string formatting: every one of
  its 121 call sites is inside a log or error message, so it belongs
  next to the logger.
- Moving RecoverKey and ValidateDisplayName into protocol/common removes
  the common -> protocol layering inversion; all their callers were
  already inside protocol/.
- Makefile lint-panics target follows LogOnPanic to its new path.

refs #7067
2026-08-20 20:59:45 +02:00
Andrey Bocharnikov 0f8ac5b12d chore: remove CryptoCompare market provider
Drop CryptoCompare provider wiring and its tests, and remove market proxy credentials that were only used by the CryptoCompare proxy path.
2026-06-09 18:52:46 +02:00
6b3f8258a6 chore: cherry-picked commits from 'release/10.34.x' into develop (#7479)
* fix(waku): Avoid peer reconnection storm (#7447)

* fix(waku): Avoid peer reconnection storm

This commit is fixing 2 issues in waku:
1. Unnecesary disconnect/reconnects
2. dns failure at startup will silently give up - no retries

- filter connection changes and forward the signal only when a change happened
- dnsDiscovery: retry on failure with exponential backoff

* chore: bump logos-delivery

Include https://github.com/logos-messaging/logos-delivery-go/pull/1302

* chore: add usds to mandatory tokens (#7455)

* feat(preferences): add secure storage for app settings (#7460)

* Should replace QSettings that are stored in files

refs status-im/status-app#20922

---------

Co-authored-by: Alex Jbanca <47811206+alexjba@users.noreply.github.com>
Co-authored-by: Andrey Bocharnikov <andrey.bocharnikov@gmail.com>
2026-05-26 14:18:15 +02:00
Andrey Bocharnikov 05ca3e0e57 fix(wc): remove old walletconnect files (#7366)
* fix(wc): remove old walletconnect

* fix(connector): use config.wsenable flag to disable websocket on mobile
2026-03-13 21:01:25 +04:00
Andrey BocharnikovandJonathan Rainville 451464d227 feat: wallet connect API (#7328)
* feat(walletconnect): WC v2 protocol implementation

* feat(walletconnect): integrate WC client into connector service

* refactor(walletconnect): remove legacy WC database layer and API

Fixes #19740

---------

Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2026-02-16 13:01:11 -05:00
Igor Sirotin c0dfb3911e fix: reliable messenger cleanup in tests (#7235)
* test: pass t to testing utils

* chore: remove unused code

* fix: update mvds

* fix: push notification client graceful shutdown

* fix: messenger watchExpiredMessages graceful shutdown

* test: log test logger name

* test: automatically start messenger for tests

* feat: use t.Cleanup foe messenger, messaging and databases

* fix: bugs

* test: remove manual messenger teardown

* fix: MessageSender graceful shutdown

* fix: PushNotificatinoServer graceful shutdown

* fix: don't close database from messenger

* fix: graceful shutdown

* test: fixes

* fix: lint

* fix: LogOnPanic ens

* chore: log test logger name on creation

* chore: vendor hash

* chore: mvds master branch
2025-12-19 23:09:39 +00:00
Khushboo-dev-cpp 8d0e9ea9de feat: Dont use ntp servers when Thirdparty services are disabled (#7197) 2025-12-17 21:03:34 +01:00
Igor Sirotin 6c9070fbe9 refactor: project layout (databases, abi-spec, connection) (#7205)
* chore: move databases to internal/db

* chore: move internal/db/sqlite

* chore: internal/abi-spec

* chore: move internal/connection

* chore: internal/circuitbreaker

* chore: internal/transactions

* fix: rebase issues
2025-12-15 12:01:03 +00:00
Igor Sirotin ea40003a77 chore: project layout (api, node, multiformat, backup) (#7191)
* chore: delete StatusBackend interface

* chore: rename GethStatusBackend to StatusBackend

* chore: move to pkg/multiformat

* chore: move and rename pkg/backend

* fix(Makefile): lint-fix depends on generate

* chore: move services/pkg

* chore: pkg/backend/node

* chore: testdata/test-0.132.0-account

* fix: rename imports
2025-12-12 21:28:00 +00:00