add deterministic test reproducing asset lockup on crash during colored channel open - #154
Draft
dcorral wants to merge 1 commit into
Draft
add deterministic test reproducing asset lockup on crash during colored channel open#154dcorral wants to merge 1 commit into
dcorral wants to merge 1 commit into
Conversation
4 tasks
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.
When opening an RGB channel, the funder's FundingGenerationReady handler colors the funding transaction: it calls rgb_send_begin (sweeping the channel amount and the change into a batch transfer), consumes the resulting fascia into the stock (rgb_consume_fascia), and creates the consignments, all before the funding transaction is signed and handed to LDK (funding_transaction_generated).
If the process dies in that window, a restart is left in an inconsistent state:
Net effect: after the crash the funder's entire spendable balance for that asset is stuck at 0, unrecoverable through any existing API. It needs only a local crash at an unlucky moment during any colored channel open.
How the test reproduces it
A debug-only crash checkpoint (funding_kill_checkpoint, #[cfg(debug_assertions)], gated behind the RLN_FUNDING_KILL_AT env var) is placed at exactly that point, after coloring, before the LDK handoff. The test:
On master, step 6 fails: spendable is 0, the whole balance stranded.