UtxoSweeper.UpdateParams updates the parameters for a specified input and resets its state to Init, after which the sweeper can create a new transaction for the input. But UpdateParams does not cancel any existing fee bumps for the input.
Thus, we can end up with the fee bumper creating multiple conflicting transactions each block. The fee bumper will not notice the conflicting transactions until one of them confirms, at which point any unspent inputs are allowed to be batched again.
These rebatched inputs will not be swept for at least 1 block after the conflicting transaction confirms, potentially causing deadlines to be missed in some edge cases.
Example edge case
- Inputs A, B, C all have a deadline in 6 blocks and are batched into a single transaction
Tx1.
- After 4 blocks,
Tx1 still hasn't confirmed. The user increases the budget for input A using BumpFee. The sweeper creates a new transaction Tx2 containing only input A.
- In the 5th block,
Tx2 confirms. Inputs B and C are rebatched into a new transaction Tx3.
Tx3 now cannot confirm before the deadline.
Solution
UpdateParams should probably cancel any existing fee bump for the specified input. This would allow immediate rebatching of inputs in the original transaction using the updated parameters.
UtxoSweeper.UpdateParamsupdates the parameters for a specified input and resets its state toInit, after which the sweeper can create a new transaction for the input. ButUpdateParamsdoes not cancel any existing fee bumps for the input.Thus, we can end up with the fee bumper creating multiple conflicting transactions each block. The fee bumper will not notice the conflicting transactions until one of them confirms, at which point any unspent inputs are allowed to be batched again.
These rebatched inputs will not be swept for at least 1 block after the conflicting transaction confirms, potentially causing deadlines to be missed in some edge cases.
Example edge case
Tx1.Tx1still hasn't confirmed. The user increases the budget for input A usingBumpFee. The sweeper creates a new transactionTx2containing only input A.Tx2confirms. Inputs B and C are rebatched into a new transactionTx3.Tx3now cannot confirm before the deadline.Solution
UpdateParamsshould probably cancel any existing fee bump for the specified input. This would allow immediate rebatching of inputs in the original transaction using the updated parameters.