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.
Part of the Go project layout migration, item 4.
internal/db/walletdatabase -> internal/db/walletdb, and its one 45-line
file splits along the two jobs it was doing:
open.go DbInitializer, InitializeDB, OpenDB
migrate.go walletCustomSteps, doMigration, MigrateDB
scripts/migration_check.sh listed this migration directory as
"walletdatabase/migrations/sql" and appdatabase's as
"appdatabase/migrations/sql". Neither path has existed since those
packages moved under internal/db/, so the check has been silently
skipping both. Both are corrected here.
refs #7067
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".
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
Part of the Go project layout migration, item 27.
Pure move plus import-path rewrite across 502 files. No API or behaviour
change. `internal/` keeps the messaging application logic unimportable
from outside the module, which is what the issue asks for -- status-go is
consumed through the C-bindings in mobile/, not as a Go library.
Things that had to follow the move, beyond the Go imports:
- tools/generate-handlers/template.txt. messenger_handlers.go is
generated, and the template hard-codes the imports it emits, so the
generated file kept importing protocol/common and failed typecheck.
- .gitignore. The ignore rule for that generated file was pinned to the
old path; without moving it, a 1486-line generated file starts being
tracked.
- Makefile: the logosstorage and torrent test targets (both the archive
packages and ./protocol itself), the archive README, migration-protocol.
- scripts/run_unit_tests.sh, which names the protocol package explicitly
to shard its tests.
- scripts/cleanup_generated_files.sh and .golangci.yml.
scripts/migration_check.sh also needed a fix that is not specific to this
move: it validated every file the branch touched under a migration dir
against the timestamp naming rule, and a directory rename makes every
migration in it look newly added. It now excludes renames, so moving a
migration is not mistaken for adding one.
refs #7067
`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
`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
* 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.
Part of https://github.com/status-im/status-app/issues/21462
- Open existing app and wallet SQLCipher databases concurrently, while preserving sequential initialization for new or legacy databases.
- Speed up account selection by preloading the profile keypair and decrypting only the chat private key instead of the full extended key.
- Defer token manager startup until after login completes and run it asynchronously outside the critical startup path.
- Load cached leaderboard market data asynchronously, waiting only when the data is accessed or the service stops.
Before: about 2.15 s for the backend login request
After: about 0.47–0.50 s
Improvement: roughly 1.65–1.70 s saved
Relative reduction: about 77–78%
Speed multiplier: approximately 4.3–4.5× faster
When InitializeApplication is called again after logout, OpenAccounts
returns early and the media server kept a random port. Restart the
media server when SetMediaServerOptions runs on an existing listener,
and stop it on logout so the configured port can be rebound.
* 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>
* chore: remove Polygon zkEVM chain (#7429)
* chore: remove status l2 sepolia (#7431)
* fix(wallet-connect): advertise wallet_switchEthereumChain (#7432)
Fixes#20697
* fix(connector): EIP-5792 methods + trusted-only eth_accounts auto-share on requestPermissions (#7428)
fix(connector): partial permissions revocation
fix(connector): parallel dapp requests races
fixesstatus-im/status-app#20591
* feat(connector): ephemeral dApp records (#7435)
* feat(connector): ephemeral dapp records
refs status-im/status-app#20676
* fix: copilot comments
* chore: more descriptive logging added to router package
* feat: implemented log file rotation for new sessions
Added functionality to rotate log files when a new session starts, while the logs from previous sessions
are also kept.
* fix: puzzle-auth providers should not depend on the presence/absence of basic-auth credentials (#7437)
* fix: puzzle-auth providers should not depend on the presence/absence of basic-auth credentials
If the same network has puzzle-auth and basic-auth providers an incorrect enable flag might be used
if there is no ethrpc/status proxy credentials set.
* chore: sync balance/activity fetching (#7438)
* chore: trigger activity fetch when balance updated
* chore: trigger balance update when activity fetched
* fix(wc): reconnect broken pipe
fixesstatus-app/status-im#20767
* fix(wc): recreate ws connection on start
* fixes broken wc after restoring from the background
fixesstatus-app/status-im#20767
* fix: copilot comments
* fix: shrink tests
* fix: use WCClientGetter
* wcclient is recreated when service is paused
* fix: readability
* fix: pr comments
* fix: flaky test
* fix: push notification migration
If the latest migration ran is not present then remove it
* perf: Enrich community members and contacts with visual identity (#7430)
For each community member and contact Status needs to wire another 4 RPCs to fully resolve the members and contacts. This commit adds the necessary info in the community members and contacts response directly.
Needed for: https://github.com/status-im/status-app/issues/20228
* fix(collectibles): disable ink, katana
fixes status-im/status-app#20717
* fix(collectibles): pr comments
* feat(wallet): skip TANGYUAN and POSI tokens on BSCMainnet
Added token keys for TANGYUAN and POSI to the SkippedTokenKeys list.
Closes#20860
* perf: Interrupt stats ticker and throttle mvds on messenger.pause
The messenger needs to keep only critical infrastructure while paused.
This commit stops the stats retrieval while paused - not used. And throttles the mvds datasync to 5 minutes. This means that the ack is confirmed once every 5 minutes (as opposed to 300ms) while paused.
Message sending is also disabled in this time frame.
---------
Co-authored-by: Anthony Laibe <491074+alaibe@users.noreply.github.com>
Co-authored-by: Andrey Bocharnikov <andrey.bocharnikov@gmail.com>
Co-authored-by: Alex Jbanca <47811206+alexjba@users.noreply.github.com>
Co-authored-by: Alex Jbanca <alexjb@status.im>
- Wire ServiceRegistry into StatusNode: populateServiceRegistry() registers
all Pausable services after startup; Pause()/Resume() delegate to registry.
- Add PausableServices/PauseService/ResumeService/PauseServices/ResumeServices
to StatusBackend and mobile bindings — clients can now control individual
services by name.
- Remove AppStateChange/AppStateChangeV2 API entirely — clients call
PauseServices/ResumeServices directly, keeping app-state logic client-side.
* feat: add Pausable interface, PausableTicker, and ServiceRegistry
Introduce the core primitives for lifecycle-aware service control:
- common/pausable.go: Pausable interface (PausableName/Pause/Resume),
PauseBroadcaster embed (MarkPaused/MarkResumed/IsPaused/Subscribe),
Subscription interface for goroutine loops.
- common/pausable_ticker.go: PausableTicker — wraps time.Ticker with a
nil-channel pause trick so loops block cheaply without extra goroutines.
- pkg/backend/node/service_registry.go: ServiceRegistry — central registry
of Pausable services with Register/Pause/Resume/PauseAll/ResumeAll/List.
* fix: Various fixes for the pausable service, pausable ticker and service registry
- Introduced the following mainnet chains with their testnets:
- Polygon ZkEVM,
- Unichain,
- Katana,
- Ink,
- Abstract,
- ZkSync Era,
- Soneium,
- Scroll,
- Blast
Updated the code to accommodate the new chains.
- Updated go-wallet-sdk version in go.mod and go.sum.
- Improved on token manager initialization to use enabled chains from the network manager.
- Added functionality to watch for changes in active networks and update token manager accordingly.