Refactor commitment broadcast to always go through OnchainTxHandler
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Fri, 3 Nov 2023 19:43:06 +0000 (12:43 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Tue, 12 Dec 2023 00:44:55 +0000 (16:44 -0800)
commit90f24a6a509157ad8f5027dab1f287b9a6acca08
tree56e3141b691cb70af1874bc938729e30209251f3
parent7dcee4f2e54988dbaceefad7a352bbd15263622b
Refactor commitment broadcast to always go through OnchainTxHandler

Currently, our holder commitment broadcast only goes through the
`OnchainTxHandler` for anchor outputs channels because we can actually
bump the commitment transaction fees with it. For non-anchor outputs
channels, we would just broadcast once directly via the
`ChannelForceClosed` monitor update, without going through the
`OnchainTxHandler`.

As we add support for async signing, we need to be tolerable to signing
failures. A signing failure of our holder commitment will currently
panic, but once the panic is removed, we must be able to retry signing
once the signer is available. We can easily achieve this via the
existing `OnchainTxHandler::rebroadcast_pending_claims`, but this
requires that we first queue our holder commitment as a claim. This
commit ensures we do so everywhere we need to broadcast a holder
commitment transaction, regardless of the channel type.

Co-authored-by: Rachel Malonson <rachel@lightspark.com>
lightning/src/chain/channelmonitor.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/ln/reload_tests.rs