5 Commits
Author SHA1 Message Date
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
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
Igor Sirotin 24d0132145 chore: fix numbered import names (#7416) 2026-04-16 13:22:54 +01: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