feat: add network graph reset to recovery - #1020
Conversation
|
OBS: logs are reporting staging SRG server more Tham 2 weeks old
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26bddf9f5d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
LGTM
Tested on same mainnet wallet I use for other app tests.
Did a payment to bitkit iOS (CJIT funding) before resetting graph via the new recovery option.
Did the reset → App restarted.
Attempted then to pay:
- Phoenix LN Invoice 🔴 1st attempt failed
- WoS LN Invoice 🟢 suceeded
- new Phoenix LN Invoice 🟢 succeeded
All as fast as I could, right after the app opened.
My main concerns around how long it might take to resync graph are mitigated.
This PR adds a manual "Reset Network Graph" option to the Recovery Mode screen as a safe recovery path for a rare "route not found" issue.
In an observed support case, a wallet with healthy channels and outbound liquidity could not route payments ("route not found") because its local Lightning network graph had decayed (far fewer channels than a full snapshot). The exact root cause is not yet 100% confirmed and is still being investigated — the leading hypothesis is an interaction between LDK pruning stale channels and Rapid Gossip Sync only applying forward deltas without ever re-downloading a full snapshot, but that is not conclusive. The issue appears to be infrequent.
What is clear is that the decayed-graph state exists and breaks routing, and that wiping the cached graph reliably resolves it by forcing a fresh full download. This PR adds that as a manual, low-risk recovery path so support and users can fix an affected wallet without reinstalling, independent of the eventual root-cause fix.
Description
This is a workaround, not a root-cause fix: it does not change the gossip/pruning behaviour and does not try to detect or auto-trigger the reset.
Preview
wallet-exist-fg-service-disabled.webm
wallet-exists-fg-service-enabled.webm
no-wallet.webm
QA Notes
Manual Tests
regression:Recovery Mode with no wallet: Reset Network Graph button is hidden/disabled.Automated Checks
resetNetworkGraph()clearing the local cache and deleting the VSSnetwork_graphcopy inapp/src/test/java/to/bitkit/repositories/LightningRepoTest.kt.just compile,just test, andjust lintpass.