fix: improve persisted logs and peer recovery#947
Open
ovitrif wants to merge 10 commits into
Open
Conversation
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.40from feat: persist restored channel peers ldk-node#82 so announced restored channel counterparties can be recovered into the peer store.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.40, which restores missing announced channel peers from the network graph during node startup.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 compileDevDebugKotlin testDevDebugUnitTest detektgit 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.zip, includessupport_snapshot.json, and accepts rotated.part_###.logfiles.v0.7.0-rc.40is published, and Bitkit depends on it.detektandlintpassed.CI Notes
claude-reviewis currently failing because Claude Code subscription is no longer available; this is unrelated to the code under test.