params/networkhelper only ever served the network manager and the
default network table, both of which now live in pkg/services/networks.
Eight of its ten functions are unexported now that their callers are in
the same package. OverrideBasicAuth and GetEmbeddedProviders stay
exported: tests in other packages build networks with them.
The two test files become internal tests, since what they cover is no
longer exported.
params/networkdefaults holds the embedded network table and builds the
default network list. It belongs with the service that owns networks,
not in params.
Dissolved into the networks package rather than kept as a subpackage:
BuildDefaultNetworks reads better than defaults.BuildDefaultNetworks,
and the next commit unexports the helpers both halves share.
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.
BuildDefaultNetworks took requests.WalletSecretsConfig, the raw wire
struct, reaching past the translation that already exists in
buildWalletConfig. It now takes params.WalletConfig, which already
carried six of the seven fields it needs.
PoktAPIKey is added to params.WalletConfig alongside the other provider
keys; it was the only field missing.
This drops networkdefaults' dependency on internal/protocol/requests,
and with it the whole protocol package graph.
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
`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
Part of https://github.com/status-im/status-app/issues/21598
Updated outgoing message status handling so `sent` is confirmed immediately after successful Waku publishing, eliminating store-node confirmation requests and retaining only MVDS ACKs (1:1/private groups) and SDS `message_sent` callbacks (communities) for `delivered`. Community SDS IDs are now tracked as internal aliases of the UI message ID, preventing alias messages from appearing in the UI while translating SDS delivery callbacks to the existing delivered signal.
The store nodes belong to the fleet, and the waku node already knows its
fleet, so it now resolves them itself (fleets.StoreNodes) at Start and feeds
its StoreClient — instead of the messenger resolving them and pushing them
down via SetStorenodes.
- wakuv2 resolves + dials the fleet's store nodes in Start; the
StoreNode -> peer.AddrInfo conversion moves from messaging.API into the node.
- Remove the SetStorenodes push chain: the Waku interface method, the transport
and messaging.API wrappers, and the messenger's AllMailservers/SetStorenodes call.
- The history-sync gate no longer checks storenode availability: the waku node
always has the fleet's store nodes, so shouldSync just honors the
mailservers-enabled setting.
- Drop the now-orphaned params.DefaultStoreNodes and the messenger's
AllMailservers / allMailserversByFleet / getFleet helpers.
- Stop populating MessengerResponse.StoreNodes (the client-visible "mailservers"
list); store nodes no longer leave the waku node.
Part of pm#380 / status-go#7589 — store-node peer selection was the last piece
of peer management still done above the Waku object.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* feat(messaging): resolve fleet + mode inside the Waku node
CoreParams now carries Fleet + Mode instead of a pre-resolved ClusterConfig.
The waku node resolves its peers from the fleet name via the fleets registry
and derives the peer-exchange / discv5 policy from the mode (Core = full/relay,
Edge = light) — moving peer management into the Waku object and giving the
messaging API its Start(fleet, mode) shape.
- New wakuv2.Mode (Core = relay, the default; Edge = light). It is the single
internal source of truth for the light-vs-full distinction and fully replaces
the former wakuv2.Config.LightClient flag (Config.IsLightClient() derives from
Mode). Unknown mode values are rejected by Config.Validate. Re-exported as
messaging.Mode; the app-facing WakuV2Config.LightClient bool and its DB column
are kept unchanged for backwards compatibility (bridged via ModeFromLightClient).
- wakuv2.Config gains Fleet + Mode; setDefaults resolves the fleet and derives
the node-type flags. An empty fleet leaves WakuNodes / DiscV5BootstrapNodes /
ClusterID as set directly (waku unit tests point at ephemeral nodes).
- services/ext and push-notification-server pass fleet + mode; the app no longer
pre-resolves node lists for the messaging path.
- Break the pkg/messaging/types -> waku import edge (Shard.PubsubTopic computes
its pubsub topic directly) so the waku node can own fleet resolution without
an import cycle.
Behaviour-preserving for the app: named fleets resolve to the same peers /
clusterID, and Core/Edge derives the same flags as the old LightClient path.
Note: DefaultConfig now defaults to Core, so the shared in-process test waku
enables discv5 (idle, no bootnodes) where it previously did not.
Part of pm#380 / status-go#7589 (Phase 2b).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(params): drop dead peer fields from ClusterConfig
Now that the waku node resolves its peers from the fleet name (this PR),
ClusterConfig.WakuNodes / DiscV5BootstrapNodes have no readers and were
never persisted, and ClusterConfig.ClusterID is only written to and
reloaded from the DB, never consumed. Drop all three from the struct
(keeping Enabled + Fleet) and the orphaned DefaultWakuNodes /
DefaultDiscV5Nodes re-exports.
The cluster_id DB column is kept (no migration): it is written from the
selected fleet on save (params.DefaultClusterID) and no longer loaded back
into the struct.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor(messaging): build waku config from fleet+mode in newWaku
newWaku no longer takes the whole params.WakuV2Config. Its wakuParams now
carries only what a caller actually configures — fleet + mode, plus the
port / udpPort / nameserver that some deployments set — and the waku node
builds the rest of its config from fleet+mode (peers, cluster id) and the
waku layer's setDefaults (host, discovery limit, max message size, default
shard topic).
Removed from the config build:
- identity: never read by newWaku (dead wakuParams field).
- Host / DiscoveryLimit / MaxMessageSize: only ever the waku defaults;
setDefaults fills them.
- DefaultShardPubsubTopic: setDefaults fills it.
- EnableStoreConfirmationForMessagesSent: unconditionally overridden by the
mode inside gowaku (Core -> true, Edge -> false), so the passed value was
already a no-op.
- AutoUpdate is now a fixed policy (always true, as every caller set it).
The public CoreParams (WakuConfig) is unchanged; only the messaging-internal
newWaku boundary is slimmed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Move the fleet definitions (waku nodes, discv5 bootstrap nodes, cluster
IDs, store nodes) out of params/cluster.go into a new leaf package
pkg/messaging/waku/fleets, behind the Waku layer. It exposes a registry
API (Supported / IsSupported / WakuNodes / DiscV5Nodes / ClusterID /
StoreNodes / LoadFromFile) plus Register() so local/interop harnesses
can register an ephemeral network as a named fleet.
params/cluster.go keeps back-compat re-exports (type aliases, fleet-name
constants, delegating helpers) so existing callers are unchanged. The
registry is a lightweight leaf package (deps: enr, multiaddr,
messaging/types only) so params does not pull in the go-waku runtime.
Part of pm#380 / status-go#7589 (Phase 2a).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* chore: adds setting file for NeoVim
* feat: wires up LogosStorageConfig db setup
* feat: adds implementation of ArchiveManagerLogosStorage and wires it up
* feat: wire LogosStorage history archive runtime control
* feat: expose history archive index completion signal
* feat: expose LogosStorage debug and connect APIs
* feat: add history archive timing knobs
* chore: align functional archive build toggles
* chore: refactors token permissions tests
* feat: wire LogosStorage archive APIs, request plumbing, and functional test
* fix: use UniversalChatID() for archive link distribution
* fix: functional archive tests
* feat: respecting online status in history archive task
* feat: more control over "ratchetNotFoundDelay"
* test: run storage-related functional tests only when USE_LOGOS_STORAGE is true
* test: adds LogosStorage backend tests
* build: updates testing on CI
* build: updates linting on CI
* fix: make sure archive_manager_torrent_test has use_torrent guard
* fix: formatting
* chore: updates nvim settings to include CGO paths
* chore: removes redundant "special disabled" files
* fix: Python linting issues
* build: use system Nim for libstorage native and Docker builds
* fix: initialize LogosStorage node config in DefaultNodeConfig
* fix: rebase
* fix: final review
* build: cleans up the vars in test storage and torrent targets in Makefile
* fix: stop unseeding before calling CreateHistoryArchiveFromDB (logos)
* test: cleans up some noise when closing websockets in functional tests
* test: further increase test coverage
* fix: linting
* chore: update local project nvim config
* chore: refactors ArchiveManagerLogosStorage
* chore: updates CONTRIBUTING.md
* build: temporarily add mc2 convenience scripts
* build: reset shared dependency repos before checkout in Makefile
Adds `git reset --hard` before `git checkout` in the `clone-nim-sds`
and `clone-storage` Makefile targets. Prevents CI failures when the
shared `../nim-sds` or `../logos-storage-nim` directories contain
unexpected local modifications from previous builds.
* fix: use shorter waku message retention policy only for LogosStorage tests
* fix: rename COMMUNITY_IMPORTING_HISTORY_ARCHIVE_MESSAGES_FINISHED to COMMUNITY_HISTORY_ARCHIVES_DOWNLOAD_AND_IMPORT_FINISHED
* build: move STORAGE and TORRENT envs close to their respective targets
* build: more robust cloning target for sds and storage
logos-delivery owns missed-message recovery (RecvService) internally, so
status-go no longer needs to periodically query store nodes to retrieve
missing messages. Remove the MissingMessageVerifier and its surrounding
machinery:
- The MissingMessageVerifier and its driving loop (checkForMissingMessagesLoop),
along with the SetCriteriaForMissingMessageVerification call chain through
the messaging API, transport and waku layers.
- The now-dead EnableMissingMessageVerification config flag and its plumbing
(params, waku config, create-account request, node-config persistence).
Sent-message store confirmation (MessageSentCheck /
EnableStoreConfirmationForMessagesSent) is intentionally left in place.
Refs: logos-messaging/pm#380
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
DefaultRPCURL/DefaultFallbackURL/DefaultFallbackURL2 were only ever populated by the removed embedded-proxy path and are read nowhere, so drop them from the Network struct and the assertions that checked they stayed empty.
* 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>
* feat: support libstorage in the build system
* build: make sure linting includes logos-storage
* build: tweaking native build of libstorage that avoids calling make update (allowing to build on RYZEN processors)
* build: removes redundant scripts
* build: removes printing libstorage version on nix env
* test: more uniform naming (USE_LOGOS_STORAGE)
* build: bumps vendor hash
* test: include logosstorage tests in the coverage on the CI
* build: remove passing lib paths to the generate target
Co-authored-by: Jakub <jakub@status.im>
* build: Update Dockerfile - remove indentation
Co-authored-by: Jakub <jakub@status.im>
* build: remove redundant check in Makefile
Co-authored-by: Jakub <jakub@status.im>
* build: remove noise from Makefile
Co-authored-by: Jakub <jakub@status.im>
* build: remove redundant IFs from Makefile
* build: adds README to be used when printing logosstorage help messages
* build: move some Makefile vars to be better visible in context
---------
Co-authored-by: Jakub <jakub@status.im>
- 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.
* feat(wallet): add module for proof-of-work auth
Add a new puzzleauth package that implements client-side proof-of-work
authentication using Argon2id hashing algorithm.
(https://github.com/status-im/proxy-common/tree/master/auth)
fixes#7320
* feat(collectibles): integrate nft-proxy with proof of work auth (#7322)
* feat(wallet): integrate nft-proxy with puzzle auth into collectibles
The alchemy client now supports three modes: alchemy api key, basic auth, proof-of-work
refs #7320
* feat(wallet): fix copilot comments
* feat(wallet): extract urls and auth logic for alchemy client
* test: Refactor `join_community` to improve handling of Waku propagation delays for light client mode
* test: Improve community join handling for Waku light client mode
- Add `waku_light_client` property to support light client mode checks.
- Introduce delays and retries to account for async filter subscriptions.
- Enhance error logging and re-send join requests in case of message loss.
---------
Co-authored-by: Egor Rachkovskii <egorrachkovskii@status.im>
- Introduced CommunitiesSupportedOnChain function to determine if communities are supported on a given chain.
- Updated Network struct to include CommunitiesSupported field.
- Implemented networkhelper functions to apply community support status to networks.
- Modified BuildDefaultNetworks to utilize the new community support feature.
* feat: introduce opentelemetry tracing
* chore: return associated message hasheh from segmentation layer
Required to derive trace context when a message has been segmented.
* feat: add basic tracing
- Deleted Celer bridge ABI and Go binding files.
- Removed related configurations and feature flags from wallet and protocol settings.
- Cleaned up wallet service code by eliminating references to Celer bridge processing.
- Updated path processor to remove Celer bridge transaction handling.
* refactor: use rpc server directly instead of running geth node
* refactor: run rpc server in connector service
* fix: force single API instance in connector service
* refactor: move start of time source
* refactor: remove rpc client router blocked methods
* feat: eth service
* fix: remove connector service welcomeServer
* fix: connector allow all origins
* fix: log rpc calls
* fix: use EthClient directly from connector and eth services
* chore: cleanup client and route
* test: set 1 as default ChainID
* test: connector forbidden method
* fix: TestForwardedRPCs
* test: fix rebase issues
* test: Implement ConnectorApiError
* fix: connector api result unmarshal
* fix: TestForwardedRPCs
* chore: address pr comments
* test: fix rebase issues
In some parts of the code, DataDir was an absolute, but in other parts a relative path to the data dir, while
RootDataDir is always an absolute path to the data dir. Since no need for such redundancy, DataDir is removed.