Skip to content

fix: delete vss network graph using new ffi client#775

Merged
ovitrif merged 15 commits intomasterfrom
fix/stale-graph-reset
Feb 13, 2026
Merged

fix: delete vss network graph using new ffi client#775
ovitrif merged 15 commits intomasterfrom
fix/stale-graph-reset

Conversation

@ovitrif
Copy link
Collaborator

@ovitrif ovitrif commented Feb 10, 2026

Closes #765

This PR:

  1. Adds a new VssBackupClientLdk for direct LDK-specific VSS operations via FFI bindings
  2. Switches VSS graph deletion during stale-graph reset to use the new FFI client
  3. Improves graph validation logging with node IDs, graph stats, and RGS timestamp
  4. Extracts the network graph debug dump from LightningService

Description

Builds on #740. The stale graph auto-recovery added in #765 attempted to deleted the graph from VSS using the app-level backup client but due to different key obfuscation namespacing in ldk-node, the graph backup was never deleted.

This PR switches to a dedicated LDK-specific FFI client implementation that points operations to the correct obfuscated file names backed up by ldk-node on VSS. This new VSS client implementation adjusted for supporting OPs on ldk-node backups is found in PR:

In practice this translate to successful LN payments to nodes that would otherwise fail, one example being payments to Blink wallet if having a stale graph in your wallet's VSS backups.

LDK-node already has the required mechanism to trigger redownload of the network graph if attempts to retrieve it from its backup on VSS fails. The cleanup mechanism is triggered when the graph is found to miss any of the expected trusted peers, which in turn triggers ldk-node to kick-off its re-download of the graph from the latest RGS server snapshot.

Note

After more research this issue proved to reproduce only on wallets created with the early release candidate versions of the app, when caching of network graph was still done on VSS.

Preview

Test 1️⃣ - Payment to Blink

pay2blink.mp4

Test 2️⃣ - VSS app data preserved across vss-rust-client update

Before (0.4.0) After (0.5.5)
before after

QA Notes

Tip

No need to go all the way to replicate a stale graph on your VSS backup. To validate, simply test on mainnet some random LN payments to a couple wallets you have on other apps like Blink, Phoenix, WoS. If payments succeed, PR is good to be merged.

1. Verify stale graph reset clears VSS via FFI client

  1. Launch app with a wallet that has a stale network graph
  2. Check logs for: Network graph is stale, resetting and restarting...
  3. Verify logs show: Cleared stale network graph from VSS (first delete)
  4. After restart, verify graph validates successfully
  5. After graph validation passes, send a Lightning payment to Blink wallet
  6. Payment should route successfully

2. Verify VSS app data preserved across versions

  1. Install a previous version of the app (e.g. latest release from master)
  2. Create or restore a wallet and let it fully sync
  3. Personalize the wallet, eg.
    • Change display currency
    • Set a custom denomination (e.g. sats)
    • Toggle biometric authentication
    • Update widgets on home screen
  4. Make note of all customized values
  5. Uninstall the app so wallet data lives only on VSS
  6. Install the build from this PR
  7. Restore the same wallet using the seed phrase
  8. After sync completes, verify all personalization is preserved

@ovitrif ovitrif changed the base branch from master to fix/node-stopping-bg-payments February 10, 2026 19:12
@ovitrif ovitrif changed the title fix: reset stale graph from both local and vss fix: delete vss network graph using new ffi client Feb 10, 2026
@ovitrif ovitrif requested a review from jvsena42 February 10, 2026 19:22
@ovitrif ovitrif marked this pull request as ready for review February 10, 2026 19:32
@ovitrif ovitrif force-pushed the fix/stale-graph-reset branch from 82a5527 to ba44df3 Compare February 10, 2026 19:43
@ovitrif ovitrif force-pushed the fix/stale-graph-reset branch from ba44df3 to f120581 Compare February 10, 2026 19:46
ovitrif and others added 2 commits February 10, 2026 20:47
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ovitrif ovitrif force-pushed the fix/stale-graph-reset branch from 3dfa34b to e556b04 Compare February 10, 2026 23:42
@claude

This comment has been minimized.

@jvsena42
Copy link
Member

@jvsena42
Copy link
Member

LGTM, testing ...

jvsena42

This comment was marked as resolved.

@ovitrif

This comment was marked as resolved.

jvsena42

This comment was marked as resolved.

@ovitrif ovitrif marked this pull request as draft February 11, 2026 17:48
@ovitrif
Copy link
Collaborator Author

ovitrif commented Feb 11, 2026

drafted to update to new vss-rust-client which separates the app client from the vss client

@ovitrif ovitrif marked this pull request as ready for review February 11, 2026 21:40
Base automatically changed from fix/node-stopping-bg-payments to master February 12, 2026 20:35
@ovitrif ovitrif dismissed jvsena42’s stale review February 12, 2026 20:35

The base branch was changed.

# Conflicts:
#	app/src/main/java/to/bitkit/services/LightningService.kt
@ovitrif ovitrif enabled auto-merge February 13, 2026 15:33
Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed Lightning operation on main net

@ovitrif ovitrif merged commit 0109a58 into master Feb 13, 2026
25 of 27 checks passed
@ovitrif ovitrif deleted the fix/stale-graph-reset branch February 13, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants