bkpr: don't exit when an account's debits exceed its credits - #9488
Open
ksedgwic wants to merge 1 commit into
Open
bkpr: don't exit when an account's debits exceed its credits#9488ksedgwic wants to merge 1 commit into
ksedgwic wants to merge 1 commit into
Conversation
bkpr-listbalances calls plugin_err when the debit sum for an account is larger than its credit sum. The bookkeeper is an important plugin, so lightningd shuts down with it: plugin-bookkeeper: Account balance underflow for account 906c4056... (credit 25339109661msat, debit 25351660836msat) plugin-bookkeeper: Killing plugin: exited during normal operation Plugin marked as important, shutting down lightningd! An inconsistent ledger is a bookkeeping defect, not a reason to stop the node, and no other bkpr command treats it as fatal. Three different accounting bugs have reached this exit so far (ElementsProject#5557, ElementsProject#8549, and now one on a node that already has the ElementsProject#8574 dedup); each time it took the node down. Log it as BROKEN and report that account's balance as 0msat, as 29e0a1d already does for a missing open event. Changelog-Fixed: Plugins: `bkpr-listbalances` no longer exits, taking lightningd down with it, when an account's debits exceed its credits; the inconsistency is logged and that account is reported as 0msat. Fixes: ElementsProject#9487
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.
bkpr-listbalances calls plugin_err when an account's debits exceed its credits. The bookkeeper is an important plugin, so lightningd shuts down with it. Fixes #9487.
The commit replaces the plugin_err with a BROKEN log and reports that account as 0msat, the way 29e0a1d handles a missing open event. The test corrupts one channel_moves row in a stopped node's database, so the next bkpr-listbalances sees debits above credits without a replay.