fix: improve persisted logs and peer recovery#947
Draft
ovitrif wants to merge 15 commits into
Draft
Conversation
auto-merge was automatically disabled
May 20, 2026 14:32
Pull request was converted to draft
Collaborator
Author
|
drafted until ldk-node PR is updated and new bindings version is consumed here, then, this PR is re-validated by dev. |
Collaborator
Author
|
PR ready for review again & revalidated locally. |
Collaborator
Author
|
New update incoming in synonymdev/ldk-node#82, not ready again :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
bitkit_YYYY-MM-DD_HH-MM-SSfile names, and keeps retained logs bounded by age and total size.0.7.0-rc.44from feat: persist restored channel peers ldk-node#82 so announced restored channel counterparties can be recovered into the peer store, peer recovery remains retryable after transient persistence failures, and RGS recovery no longer uses a stale disconnect-exclusion snapshot.Description
This is the Bitkit side of the support-ticket cleanup around oversized persisted logs and restored external Lightning channels.
The log changes keep persisted logs useful for support without allowing one long TRACE session to dominate the archive. They also stop wallet wipe/restore from clearing logs, matching iOS and preserving the exact history support needs after a recovery flow. The peer diagnostics make it easier to see whether channels, connected peers, and persisted peers line up when investigating a wallet that has channel state but no usable peer connection.
The ldk-node bump consumes synonymdev/ldk-node#82 and release v0.7.0-rc.44, which restores missing announced channel peers from the network graph during node startup, keeps recovery retryable after transient peer-store persistence failures, and closes the RGS recovery race with explicit disconnects.
Preview
N/A - logging changes.
QA Notes
Manual Tests
Self-checks
to.bitkit.dev) -> launched app and inspectedfiles/logsthroughrun-as: new persisted logs are namedbitkit_YYYY-MM-DD_HH-MM-SS.log.bitkit_2026-05-17_18-44-47.part_002.log.To Check
support_snapshot.json.regression:Recovery Mode -> wipe wallet -> restore wallet -> Drawer -> Support -> Report Issue: persisted logs from before the wipe are still available.Automated Checks
./gradlew installDevDebugon attached Pixel 10 Pro../gradlew assembleDevDebug --no-daemonpassed locally with ldk-node0.7.0-rc.44../gradlew testDevDebugUnitTest --no-daemonpassed locally with ldk-node0.7.0-rc.44../gradlew detekt --no-daemonpassed locally with ldk-node0.7.0-rc.44../gradlew installDevDebug --no-daemoninstalled the rc.44 dev build onPixel_9_36(emulator-5554).to.bitkit.dev/to.bitkit.ui.MainActivity, confirmed the process stayed alive, crash log buffer was empty, and the wallet home screen rendered.git diff --checkLogger.perf(...)persists viasaver.save(message)andmeasured(...)no longer checksEnv.isDebug.WakeNodeWorkerkeepsmeasured(label = "doWork", context = TAG, ...)andAGENTS.mdhas the short mechanical log naming rule.WipeWalletUseCaseno longer callsLogger.reset(), so wallet wipe/restore no longer clears persisted logs unless the user explicitly wipes logs.LogsRepocreatesbitkit_logs_YYYY-MM-DD_HH-MM-SS.zipfor sharing andbitkit_support_logs_YYYY-MM-DD_HH-MM-SS.zipfor support uploads, includessupport_snapshot.json, and accepts rotated.part_###.logfiles.CI Notes
claude-reviewis currently failing because Claude Code subscription is no longer available; this is unrelated to the code under test.