tests: Test that when a node loses state and the closing transaction has HTLC outputs#8887
Open
enaples wants to merge 1 commit intoElementsProject:masterfrom
Open
tests: Test that when a node loses state and the closing transaction has HTLC outputs#8887enaples wants to merge 1 commit intoElementsProject:masterfrom
enaples wants to merge 1 commit intoElementsProject:masterfrom
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.
Scenario
In order to reproduce the issue reported in #8880 where
onchaindmakes node crashes after CLN has lost a channel state (due to database deletion/corruption) and encounters a force-close transaction containing HTLC outputs that it no longer has knowledge of.Background
A commitment transaction with anchors typically has 5 outputs (here an example):
HTLC output(s) - pending payments in-flight
When a node loses its database, it loses:
Test Steps
l1will lose state,l2has a disconnect trigger onWIRE_UPDATE_FULFILL_HTLCl2funds a channel tol1(1M sats)l2paysl1400k sats so both sides have fundsl1starts a payment tol2.l2receives the HTLC but disconnects before sending the fulfill messagel2's commitment transaction which contains the pending HTLC (verifies 4+ outputs: 2 anchors + HTLC + balances)l1, delete its databasel1and useemergencyrecover()to stub the channell2, which triggers the bogus reestablishl1's onchaind fails with "Could not find resolution for output X" because it doesn't know about the HTLCThe test will fail before its end, when l1 will resing with
bitcoind, with the commandsync_blockheight(bitcoind, [l1, l2])