Skip to content

Wallet core synced height regresses across abrupt app termination — scan floor collapses to checkpoint, forcing full filter re-scans #4130

Description

@QuantumExplorer

Problem

The wallet's core-chain committed/synced height is not reliably durable across ABRUPT app terminations (crash, force-kill). On the next launch the SPV filter scan floor collapses to max(birthHeight, header checkpoint floor), forcing a full filter re-scan of millions of blocks — and, before rust-dashcore#893, combining with a filter-storage island (rust-dashcore#894) into a hard startup crash-loop.

Evidence (device logs, testnet, same shape observed on mainnet):

session A ends cleanly:  19:30:04  Committed batch 2504884-2504884, committed_height now 2504884
session B, 70s later:    19:31:15  Starting filter download (scan_start=200000, download_start=2504885, stored_filters_tip=2504884, …)
  • PersistentWallet.syncedHeight today holds 2504884 — the value is persisted eventually, so this is about WHEN it is stamped and/or re-applied.
  • Restarts following abrupt kills collapsed the floor (two observed); the restart following a long healthy session resumed correctly at committed+1 (scan_start=2505047).
  • Vicious cycle pre-fix(dashmate): api binds to all interfaces #893: the crash-loop guaranteed abrupt terminations, so the floor collapse re-armed on every relaunch.

Suspected area

Sync-height persistence cadence in rs-platform-wallet / the Swift persister: the height appears to be stamped on some pulse or graceful path that abrupt terminations miss, and/or the load path only applies it under certain conditions. Needs a trace of where syncedHeight is written (which event, how often) and where the reloaded ManagedWalletInfo's committed height is seeded from on restore.

Impact

  • Full filter re-scan (observed: 2.3M filters) on every unlucky restart — user-visible "sync starts over" / chain-stall-like behavior.
  • Pre-fix(dashmate): api binds to all interfaces #893 pins: hard startup SIGABRT crash-loop in debug builds when a filter-storage island exists.

Related: rust-dashcore#892 (crash), rust-dashcore#893 (self-heal fix, merged pin pending), rust-dashcore#894 (island-manufacturer T1 half).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions