Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
03711f8
Uses codexConfig to mange codex-related files
marcinczenko Oct 31, 2025
0d3cb52
use param.CodexConfig instead of codex.Config
marcinczenko Oct 31, 2025
bcbaca7
Rough version of the integration test
marcinczenko Oct 31, 2025
3bbe1c7
draft of codex_config sql table with update node_config code
marcinczenko Oct 31, 2025
2d83cb5
updates the way the distribution preference is handled
marcinczenko Oct 31, 2025
956fc0c
adds triggering downloading and importing archives from Codex after j…
marcinczenko Oct 31, 2025
2a034ef
linting
marcinczenko Nov 1, 2025
c59a3da
Add API to update the message archive interval
2-towns Nov 2, 2025
168f78b
Extend test to check CodexConfig and ensure it is loaded properly
2-towns Nov 3, 2025
ac3c735
Add missing local property
2-towns Nov 3, 2025
02f8f2a
separates libcodex datadir from history archive data dir
marcinczenko Nov 3, 2025
85ac523
adds more logging to the archive downloader integration test
marcinczenko Nov 3, 2025
4182402
use filepath.Join to construct codex paths
marcinczenko Nov 3, 2025
ade0d07
updates node_config tests
marcinczenko Nov 3, 2025
51b19f2
Fetch the lib codex version based on the Go dependency
2-towns Nov 3, 2025
e9ec381
Update codex lib and use exists function to check cid existence
2-towns Nov 3, 2025
74e9947
Update codex version in nix configuration
2-towns Nov 3, 2025
a2d7cdd
Update nix hashes for v0.0.25
2-towns Nov 3, 2025
126a97d
Updates archive downloader integration test to again catch local down…
marcinczenko Nov 3, 2025
d5c49b8
Add test for HandleHistoryArchiveIndexCidMessage and fix IsReady
2-towns Nov 3, 2025
0ba4e11
global node-wide archive distribution preference
marcinczenko Nov 3, 2025
9191312
updates test in message_handler_test.go after changing preference dis…
marcinczenko Nov 3, 2025
9885e07
updates .gitignore
marcinczenko Nov 3, 2025
2ef1f59
Update codex lib version
2-towns Nov 3, 2025
a178478
updates linting
marcinczenko Nov 3, 2025
fa0836d
fix: messageArchiveInterval RPC param in seconds
emizzle Nov 4, 2025
792fd8f
updates API commands return values
marcinczenko Nov 4, 2025
6d4fcd7
[get/update]MessageArchiveInterval returns value in seconds + a bit o…
marcinczenko Nov 4, 2025
beda7df
bug fix - archive id not saved to db after being downloaded
marcinczenko Nov 4, 2025
890bb23
bug fix - ensure community archive directory exists in the Download path
marcinczenko Nov 5, 2025
bd2da9f
tests DownloadHistoryArchivesByIndexCid emits the signals as expected
marcinczenko Nov 5, 2025
9322593
various bug fixes and improvements
marcinczenko Nov 5, 2025
2cc4f52
add proper launch config for debugging
marcinczenko Nov 6, 2025
35b086b
add more assertions for archive downloading
marcinczenko Nov 6, 2025
65e66b3
make start/stop of CodexClient more thread safe and ensure uniqueness…
marcinczenko Nov 6, 2025
dccdd7d
widens the integration tests so that full downloadAndImportCodexHisto…
marcinczenko Nov 6, 2025
9d5eb34
more selective readiness control (bug fix) and bigger integration tes…
marcinczenko Nov 6, 2025
51cd825
respect distribution preference in InitHistoryArchiveTasks and Create…
marcinczenko Nov 6, 2025
169dd52
minor fix - more consistent seeding behavior for codex
marcinczenko Nov 6, 2025
fb42076
Use UniversalChatID to get the universal content topic instead of loo…
2-towns Nov 6, 2025
783395e
Add integration test for codex archive
2-towns Nov 6, 2025
6c06722
Increase timeout for archive test
2-towns Nov 6, 2025
fa6efed
removes removing index files from UnseedHistoryArchiveIndexCid
marcinczenko Nov 6, 2025
dece6ab
Makes (re)seeding of Codex index Cid more consistent
marcinczenko Nov 6, 2025
dba2e0e
Use isReady in CreateCommunity as more conservative check
marcinczenko Nov 6, 2025
4604de5
Updates community filters and topics
marcinczenko Nov 6, 2025
3799e28
allow archive download retry also for codex
marcinczenko Nov 7, 2025
41e7d4e
Use UniversalChatID to dispatch archive message instead of Magnetlink…
2-towns Nov 7, 2025
d8dc074
Improve archive functional test
2-towns Nov 7, 2025
c4b398f
Fix archive integration test
2-towns Nov 7, 2025
c4f5074
Improves the healthcheck so that the tests start as soon as possible
marcinczenko Nov 9, 2025
6c352b2
Adds more logs and makes the easier to find thanks to [CODEX] prefix …
marcinczenko Nov 9, 2025
7c5cc6f
adds even more logging
marcinczenko Nov 10, 2025
ee1b8b9
adds a compact document attempting to explain filters and topics
marcinczenko Nov 10, 2025
e019c96
fixes linting
marcinczenko Nov 10, 2025
5d23537
Improve functional test
2-towns Nov 10, 2025
6ebd8e6
Try to reduce store-message-retention-policy
2-towns Nov 10, 2025
bfe46a4
Provide better timeout
2-towns Nov 11, 2025
e48a5b1
Update Go bindings to the latest version
2-towns Nov 11, 2025
97ae5c5
improves test chronology and adds logging
marcinczenko Nov 11, 2025
066488e
more consistent issuing of the HistoryArchivesSeedingSignal + other s…
marcinczenko Nov 11, 2025
efe07ce
Add archive test using community default chat
2-towns Nov 12, 2025
ee22f35
Fix snake case for historyArchiveSupportEnabled
2-towns Nov 12, 2025
f8a2a6a
Add more tests
2-towns Nov 13, 2025
bf00670
Add codex_config_bootstrap_node configuration
2-towns Nov 13, 2025
3924218
chore: update codex version
2-towns Nov 14, 2025
083cb24
chore: still updating codex version
2-towns Nov 14, 2025
2451290
chore: disable codex discovery port random
2-towns Nov 14, 2025
e5e43ea
chore: add a test to check if the archive is downloaded after logout …
2-towns Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,8 @@ pkg/sentry/SENTRY_PRODUCTION
!vendor/**/migrations.go

# Libs directory (Codex)
libs
libs
coverage_merged.out
test_0.coverage.out
test-coverage.html
api/pre_login.log
100 changes: 100 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Current Test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${fileDirname}",
"args": ["-test.v", "-test.run", "^${selectedText}$"],
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
},
{
"name": "Debug Current Test Function",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${fileDirname}",
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
},
{
"name": "Debug All Tests in Current File",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${fileDirname}",
"args": ["-test.v"],
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
},
{
"name": "Debug All Tests in Current Package",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${fileDirname}",
"args": ["-test.v", "-count=1"],
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
},
{
"name": "Debug Specific Test Suite (e.g., TestMessengerCommunitiesTokenPermissionsSuite)",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/protocol",
"args": [
"-test.v",
"-test.run",
"TestMessengerCommunitiesTokenPermissionsSuite"
],
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
},
{
"name": "Debug Specific Test Case",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/protocol",
"args": [
"-test.v",
"-test.run",
"TestMessengerCommunitiesTokenPermissionsSuite/TestFullCodexIntegration",
"-count=1"
],
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
},
{
"name": "Debug Mock Tests (Codex)",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/protocol/communities",
"args": ["-test.v", "-test.run", "TestMock"],
"buildFlags": "-tags=gowaku_no_rln,gowaku_skip_migrations",
"env": {
"CGO_ENABLED": "1"
}
}
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ else
CODEX_OS := $(detected_OS)
endif

CODEX_VERSION ?= "v0.0.24"
CODEX_VERSION := $(shell go list -m -f '{{.Version}}' github.com/codex-storage/codex-go-bindings 2>/dev/null)
CODEX_DOWNLOAD_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(CODEX_VERSION)/codex-${CODEX_OS}-${CODEX_ARCH}.zip"

fetch-libcodex:
Expand Down Expand Up @@ -432,7 +432,7 @@ lint-panics: generate
lint: generate lint-panics
$(CGO_ENV) golangci-lint --build-tags '$(BUILD_TAGS)' run ./...

clean: ##@other Cleanup
clean: clean-libcodex | ##@other Cleanup
rm -fr build/bin/*

git-clean:
Expand Down
146 changes: 146 additions & 0 deletions _docs/filters-topics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Filters, Topics, Channels, and Chat IDs

_Last updated: 2025-11-10_

Status-Go juggles several identifiers while shuttling messages between the protocol layer and Waku. This note ties the names together so future readers can reason about filters, channels, and archives without spelunking through `messenger.go`.

## Quick Glossary

| Term | Defined in | Purpose |
| --- | --- | --- |
| `ChatID` | `messaging/types/filters.go:23-48` | Status-level label for a logical chat/channel (e.g., `communityID-memberUpdate`, `communityID-general`, `0x…` contact IDs). |
| `LocalChatID` | `messagingtypes.RawMessage` (various call sites) | Field embedded in outgoing raw messages so higher layers know which chat to update; does **not** change network routing. |
| Content Topic | `messaging/layers/transport/topic.go:18-21` | Waku topic (4 bytes) derived from `ChatID` via `Keccak256(chatID)[:4]`. Real network “channel.” |
| Pubsub Topic | `messaging/types/pubsub_topics.go` (see helpers in `messagingtypes`) | Waku v2 gossipsub domain (e.g., `/waku/2/rs/16/32`, `/waku/2/default-waku/proto`). Same content topic on different pubsub topics → distinct subscriptions. |
| `transport.Filter` | `messaging/layers/transport/filter.go` | Stores `ChatID`, `FilterID`, content topic, pubsub topic, symmetric key, and flags. Returned by transport code to upper layers. |
| `messagingtypes.ChatFilter` | `messaging/types/filters.go` | Thin wrapper exposed to the protocol (`messenger.go`); created from `transport.Filter`. |

> **Rule of thumb:** The `chatID` that created a filter is the only input to `ToTopic`, so _picking a chatID_ at send time uniquely determines the Waku content topic.

## Where Chat IDs Come From

Community helpers mint deterministic chat IDs (`protocol/communities/community.go:1544-1590`):

- `Community.ChatIDs()` returns legacy per-channel identifiers (one per Status channel).
- `Community.MemberUpdateChannelID()` produces `communityID-memberUpdate`.
- `Community.UniversalChatID()` aliases the member-update channel so one topic can carry **all** community messages during the universal-channel rollout.
- Contact/discovery/chat code helpers live in `messaging/layers/transport/topic.go:27-45`.

When a community loads, `Messenger.DefaultFilters` asks to subscribe to:

1. `communityID` on the community shard’s pubsub topic.
2. `communityID-memberUpdate` (universal channel) on the same pubsub topic.
3. The hex-encoded community pubkey on both the global content topic and the default non-protected topic.
4. Optional fallbacks when the community does not publish a shard (`protocol/messenger_communities.go:2463-2480`).

These `ChatID` + pubsub pairs become actual Waku subscriptions via the FiltersManager.

## From Chat ID to Transport Filter

`FiltersManager.LoadPublic` is the main entry point (`messaging/layers/transport/filters_manager.go:540-591`):

1. Derive a map key (`chatID` or `chatID||pubsub` when `distinctByPubsub` is true).
2. If no filter exists yet, call `addSymmetric(chatID, pubsubTopic)` which:
- Computes `ToTopic(chatID)` → content topic.
- Calls into the Waku service (`filters_service.Subscribe`) to register the subscription.
- Returns Waku’s `FilterID`, symmetric key id, and topic bytes.
3. Store and return the populated `transport.Filter`.

`InitCommunities` / `InitPublicChats` simply loop over `ChatsToInitialize` and call `LoadPublic` for each entry, so a single community normally yields several transport filters (legacy per-channel, universal, control/pubkey, etc.).

### Diagram: Subscription Lifecycle

```mermaid
flowchart TD
A[Messenger.DefaultFilters<br/>community.go helpers] --> B[ChatsToInitialize]
B --> C[Transport.InitPublicChats]
C --> D["FiltersManager.LoadPublic(chatID, pubsub)"]
D -->|compute Keccak| E["ToTopic(chatID)"]
E --> F["filters_service.Subscribe<br/>(content topic, pubsub)"]
F --> G["transport.Filter stored<br/>filters → chatID key"]
G --> H["messagingtypes.NewChatFilter<br/>exposed to messenger"]
```

## Sending Flow

All public/community traffic eventually funnels through `MessageSender.SendPublic` (`messaging/common/message_sender.go:565-681`). Important details:

1. The caller supplies `chatName` (usually `community.UniversalChatID()`).
2. After wrapping/encrypting, SendPublic calls `transport.SendPublic(ctx, newMessage, chatName)` (`messaging/layers/transport/transport.go:263-280`).
3. `transport.SendPublic` loads the filter keyed by `chatName`, then copies its symmetric key, content topic, and pubsub topic into the Waku message before posting.

Therefore **every** universal-channel message (chat, pin, magnetlink, indexCID, etc.) shares a content topic derived from `communityID-memberUpdate`. Legacy per-channel messages keep using their old chat IDs until migration completes.

### Diagram: Send Path

```mermaid
sequenceDiagram
participant Proto as protocol/messenger_communities.go
participant Msg as messaging/common/message_sender.go
participant Trans as messaging/layers/transport/transport.go
participant FM as FiltersManager
participant W as Waku

Proto->>Msg: SendPublic(chatID = communityID-memberUpdate, rawMessage)
Msg->>Trans: SendPublic(ctx, newMessage, chatID)
Trans->>FM: LoadPublic(chatID, pubsub, distinct=false)
FM-->>Trans: transport.Filter{ContentTopic, SymKeyID, PubsubTopic}
Trans->>W: Post(message with ContentTopic=ToTopic(chatID))
W-->>Trans: Hash
Trans-->>Msg: Hash
Msg-->>Proto: MessageID/Hash
```

## Receiving Flow

Incoming envelopes land inside Waku filter queues. Retrieval proceeds as follows:

1. `transport.RetrieveRawAll` iterates over **every** registered filter, calls `api.GetFilterMessages(filter.FilterID)`, drops cached duplicates, and groups results by filter (`messaging/layers/transport/transport.go:213-258`).
2. `messenger.RetrieveAll` converts transport filters into `messagingtypes.ChatFilter` objects and feeds the map into `handleRetrievedMessages` (`protocol/messenger.go:2610`, `3042-3230`).
3. For each `(filter, []*ReceivedMessage)` pair:
- If `filter.ChatID()` matches an owned community (legacy ID or universal ID) and `storeWakuMessages == true`, the raw Waku message is persisted for archive building (`protocol/messenger.go:3051-3082`, `protocol/communities/manager.go:4372-4405`).
- `messaging.HandleReceivedMessages` decodes the payload(s).
- Each decoded Status message is dispatched by type (`dispatchToHandler`), eventually ending up in chat history, member updates, archive downloads, etc.

### Diagram: Receive Path

```mermaid
flowchart LR
Waku["Waku subscription queues<br/>(per content topic & pubsub)"] -->|GetFilterMessages| Transport
Transport -->|"map[Filter][]Message"| Messenger.RetrieveAll
Messenger.RetrieveAll -->|handleRetrievedMessages| Loop["for each filter batch"]
Loop --> Decision{"owned chat & storeWakuMessages?"}
Decision -->|Yes| Store[StoreWakuMessage]
Decision -->|No| Skip["(skip storage)"]
Store --> Decode["messaging.HandleReceivedMessages"]
Skip --> Decode
Decode --> Dispatch["dispatchToHandler<br/>(type-specific logic)"]
Dispatch --> DB["User DB / UI updates / archive triggers"]
```

## Persistence & Archives

- Community owners call `GetOwnedCommunitiesChatIDs()` to load every legacy per-channel ID and `GetOwnedCommunitiesUniversalChatIDs()` for the universal ID (`protocol/communities/manager.go:4372-4400`). The union is the allowlist.
- `handleRetrievedMessages` is invoked in two distinct contexts:
1. **Live retrieval loop** (`RetrieveAll`): `storeWakuMessages = true`, `fromArchive = false`. Raw envelopes that match the allowlist are stored in `waku_messages`, and handlers run with `fromArchive=false`.
2. **Archive replay** (`handleArchiveMessages`): `storeWakuMessages = false`, `fromArchive = true`. No new rows are written, but handlers see `fromArchive=true` to suppress live-only side effects.
- Therefore, the code only writes to `waku_messages` when both the allowlist check and the “live retrieval” flags match (case 1 above).
- Stored rows retain raw payloads, timestamps, hashes, and third-party IDs (`protocol/communities/persistence.go:889-934`). Later, archive import/export code queries by content topic and timestamp windows.

Because magnetlink/indexCID/chat traffic now shares the universal channel, one subscription per community is enough to capture everything needed for archive creation; legacy filters stay in place until every client migrates.

## Debugging Checklist

1. **Which filter saw the message?** Log `filter.ChatID()` in `handleRetrievedMessages` to confirm whether it was the universal channel, a legacy chat, or the admin/pubkey topic.
2. **Did the message get stored?** Ensure the `ChatID` appears in either `GetOwnedCommunitiesChatIDs()` or `GetOwnedCommunitiesUniversalChatIDs()` and that `storeWakuMessages` was true for this pass.
3. **Unexpected content topic?** Remember that changing the `chatID` you pass into `SendPublic` changes the `ToTopic` hash. Verify the string passed to `SendPublic` (search `LocalChatID:` in the caller).
4. **Multiple filters per community?** Enumerate `t.filters.Filters()` at runtime; it’s normal to see several entries per community because the migration keeps both universal and legacy subscriptions alive.

## appendix: Useful References

- `messaging/layers/transport/topic.go` – helpers that convert strings/public keys into Waku topics.
- `messaging/layers/transport/filters_manager.go` – how filters are registered, keyed, and updated.
- `messaging/common/message_sender.go` – wrapping, encrypting, and handing messages to the transport.
- `messaging/layers/transport/transport.go` – message retrieval, cache checks, and calls into messenger.
- `protocol/messenger_communities.go` – default chat IDs per community and subscription bootstrap.
- `protocol/messenger.go` – storage/dispatch logic (`handleRetrievedMessages`).
1 change: 1 addition & 0 deletions api/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,7 @@ func TestRestoreKeycardAccountAndLogin(t *testing.T) {
},
"torrentConfigEnabled": false,
"torrentConfigPort": 0,
"codexConfigEnabled": false,
"keycardInstanceUID": "a84599394887b742eed9a99d3834a797",
"keycardPairingDataFile": path.Join(tmpdir, DefaultKeycardPairingDataFileRelativePath),
},
Expand Down
19 changes: 10 additions & 9 deletions api/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ import (

func setupConfigs() (*params.NodeConfig, *requests.APIConfig) {
newNodeConfig := &params.NodeConfig{
APIModules: "test, eth, wakuv2",
ConnectorConfig: params.ConnectorConfig{Enabled: true},
HTTPEnabled: true,
HTTPHost: "0.0.0.0",
HTTPPort: 8545,
HTTPVirtualHosts: []string{"status-go"},
WSEnabled: false,
WSHost: "127.0.0.1",
WSPort: 8586,
APIModules: "test, eth, wakuv2",
ConnectorConfig: params.ConnectorConfig{Enabled: true},
HTTPEnabled: true,
HTTPHost: "0.0.0.0",
HTTPPort: 8545,
HTTPVirtualHosts: []string{"status-go"},
WSEnabled: false,
WSHost: "127.0.0.1",
WSPort: 8586,
HistoryArchiveDistributionPreference: params.DefaultHistoryArchiveDistributionPreference,
}

apiConfig := &requests.APIConfig{
Expand Down
28 changes: 24 additions & 4 deletions api/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ func DefaultNodeConfig(installationID, keyUID string, request *requests.CreateAc
nodeConfig.LogEnabled = false
}

nodeConfig.HistoryArchiveDistributionPreference = params.DefaultHistoryArchiveDistributionPreference

if request.TestOverrideNetworks != nil {
nodeConfig.Networks = request.TestOverrideNetworks
} else {
Expand Down Expand Up @@ -343,18 +345,36 @@ func DefaultNodeConfig(installationID, keyUID string, request *requests.CreateAc

if request.TorrentConfigEnabled != nil {
nodeConfig.TorrentConfig.Enabled = *request.TorrentConfigEnabled

}
if request.TorrentConfigPort != nil {
nodeConfig.TorrentConfig.Port = *request.TorrentConfigPort
}

if request.CodexConfigEnabled != nil {
nodeConfig.CodexConfig.Enabled = *request.CodexConfigEnabled
}

if request.CodexConfigBootstrapNode != nil {
nodeConfig.CodexConfig.CodexNodeConfig.BootstrapNodes = []string{*request.CodexConfigBootstrapNode}
}

if request.ImportInitialDelay != nil {
nodeConfig.ImportInitialDelay = *request.ImportInitialDelay
}

if request.MessageArchiveInterval != nil {
nodeConfig.MessageArchiveInterval = *request.MessageArchiveInterval
}

nodeConfig.CodexConfig = params.CodexConfig{
Enabled: false,
Config: codex.Config{
DataDir: filepath.Join(nodeConfig.RootDataDir, params.ArchivesRelativePath),
Enabled: nodeConfig.CodexConfig.Enabled,
HistoryArchiveDataDir: filepath.Join(nodeConfig.RootDataDir, "codex", "archivedata"),
CodexNodeConfig: codex.Config{
DataDir: filepath.Join(nodeConfig.RootDataDir, "codex", "codexdata"),
BlockRetries: params.BlockRetries,
MetricsEnabled: false,
LogFormat: codex.LogFormatNoColors,
BootstrapNodes: nodeConfig.CodexConfig.CodexNodeConfig.BootstrapNodes,
},
}

Expand Down
5 changes: 3 additions & 2 deletions api/geth_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ func (b *GethStatusBackend) workaroundToFixBadMigration(request *requests.Login)
if currentConf.NetworkID == 0 &&
currentConf.NodeKey == "" {
// check if exist old node config
oldNodeConf := &params.NodeConfig{}
oldNodeConf := &params.NodeConfig{HistoryArchiveDistributionPreference: params.DefaultHistoryArchiveDistributionPreference}
err = b.appDB.QueryRow("SELECT node_config FROM settings WHERE synthetic_id = 'id'").Scan(&sqlite.JSONBlob{Data: oldNodeConf})
if err != nil && err != sql.ErrNoRows {
return err
Expand Down Expand Up @@ -692,7 +692,8 @@ func (b *GethStatusBackend) loginAccount(request *requests.Login) error {

defaultCfg := &params.NodeConfig{
// why we need this? relate PR: https://github.com/status-im/status-go/pull/4014
KeycardPairingDataFile: filepath.Join(b.rootDataDir, DefaultKeycardPairingDataFileRelativePath),
KeycardPairingDataFile: filepath.Join(b.rootDataDir, DefaultKeycardPairingDataFileRelativePath),
HistoryArchiveDistributionPreference: params.DefaultHistoryArchiveDistributionPreference,
}

defaultCfg.WalletConfig = buildWalletConfig(&request.WalletConfig, &request.WalletSecretsConfig)
Expand Down

This file was deleted.

Loading
Loading