You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This debug assertion frequently triggers on both regtest and testnet. As it's possible for a new tx broadcast to be attempted before we receive the confirmation notification, would it be better to remove this debug assertion?
As it's possible for a new tx broadcast to be attempted before we receive the confirmation notification, would it be better to remove this debug assertion?
Huh, how are you syncing the sweeper? Via Confirm or Listen? I assume the former and you're describing a case where you calling best_block_updatedbeforetransactions_confirmed and the broadcast attempt would be interleaved?
Hmm, I see. We could consider removing the debug_assert, but tbh. it's not exactly wrong to check for the given conditional. That this can be hit is more a (known) shortcoming of how our Confirm interface works, i.e., that transactions_confirmed and best_block_updated can get called independently from each other and in arbitrary order. I'm tempted to resolve this by finally refactoring the interface to have a single method that takes an argument including all the changes that happened during connecting a new chain tip.
Activity
[-]Debug assertion `confirmation_height < latest_broadcast_height` triggers frequently[/-][+]Debug assertion `confirmation_height >= latest_broadcast_height` triggers frequently[/+]tnull commentedon Dec 11, 2024
Huh, how are you syncing the sweeper? Via
ConfirmorListen? I assume the former and you're describing a case where you callingbest_block_updatedbeforetransactions_confirmedand the broadcast attempt would be interleaved?whfuyn commentedon Dec 11, 2024
Yes, it's syncing via
Confirm, and I'm actually usingldk-node! :)It looks like
best_block_updatedis indeed called beforetransactions_confirmedinlightning-transaction-sync.rust-lightning/lightning-transaction-sync/src/esplora.rs
Lines 165 to 210 in a688f1c
I made a reproduction of this problem. It typically occurs when force closing a channel.
https://github.com/whfuyn/ldk-node/tree/rust-lightning-3456
tnull commentedon Dec 12, 2024
Hmm, I see. We could consider removing the
debug_assert, but tbh. it's not exactly wrong to check for the given conditional. That this can be hit is more a (known) shortcoming of how ourConfirminterface works, i.e., thattransactions_confirmedandbest_block_updatedcan get called independently from each other and in arbitrary order. I'm tempted to resolve this by finally refactoring the interface to have a single method that takes an argument including all the changes that happened during connecting a new chain tip.TheBlueMatt commentedon Dec 19, 2024
Would be nice, but we shouldn't leave a known-reachable debug assertion in place either :/. I assume there's no actual logic bug here, right?
tnull commentedon Jan 13, 2025
Fixed (intermittently) in #3524.