contractcourt: validate timeout second-level outputs - #11085
Conversation
🔴 PR Severity: CRITICAL
🔴 Critical (3 files)
🟢 Low (7 files)
AnalysisThis PR modifies To override, add a |
cb14b56 to
99e0fc2
Compare
Make second-level output matching independent of the success resolver by passing the expected output explicitly. Keep malformed outputs distinct from complete non-matches and return the confirmed transaction outpoint only for an exact value and script match.
Validate notifier spend details before watcher paths consume their transactions. Cover missing transactions, inputs, and watched outpoint mismatches with a focused table test.
Validate confirmed and mempool spends at the watcher boundary before logging or classifying their spending transactions. Return malformed notifier data as resolver errors, flatten confirmed event handling, and correct fixtures to spend the watched outpoint.
Extract the existing incoming failure message and terminal checkpoint sequence into a reusable timeout-spend helper. Keep the direct remote-commit timeout and preimage paths unchanged.
Match confirmed zero-fee timeout outputs before entering the second-level sweep and observation path. Treat complete foreign output spends as terminal timeouts using normalized transaction provenance while preserving preimage and legacy behavior.
Match replayed commitment spends before updating stage-two state or offering a restored timeout output to the sweeper. Leave complete foreign spends unresolved during Launch so Resolve owns the terminal failure message and checkpoint.
Document the outgoing HTLC timeout resolver fix in the 0.20.4 and 0.21.3 release notes. Link the follow-up PR beside the related incoming resolver fix.
831eb52 to
fe3ff22
Compare
Summary
Validate re-signed outgoing HTLC timeout spends before treating their indexed
output as the second-level sweep target.
Change Description
phantom sweeper inputs.
Notes
Draft follow-up to #10869, now rebased onto its merge in
master. This resolvesthe outgoing-timeout follow-up raised in the originating review comment
and the request to track it.