contractcourt: validate timeout second-level outputs - #11085
Conversation
🔴 PR Severity: CRITICAL
🔴 Critical (3 files)
🟢 Low (7 files)
AnalysisThis PR modifies To override, add a |
858c983 to
cb14b56
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 confirmed and mempool spend details at the watcher boundary before logging or classifying their spending transactions. Return malformed notifier data as resolver errors and correct legacy test fixtures to spend the outpoints their resolvers actually watch.
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.
cb14b56 to
99e0fc2
Compare
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.
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.