Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN continues trying to RBF an OUR_DELAYED_RETURN_TO_WALLET even after "All outputs resolved" #7788

Open
whitslack opened this issue Nov 3, 2024 · 0 comments

Comments

@whitslack
Copy link
Collaborator

Issue and Steps to Reproduce

I had a channel that CLN had force-closed due to an HTLC timeout due to the peer's being unreachable for a prolonged time. CLN faithfully tracked the DELAYED_OUTPUT_TO_US output of the on-chain commitment transaction as it approached its timelock expiration, down to 1 block remaining:

2024-11-02T03:27:12.090Z DEBUG   02…73-onchaind-chan#255049: billboard: 1 outputs unresolved: in 1 blocks will spend DELAYED_OUTPUT_TO_US (57…bd:3) using OUR_DELAYED_RETURN_TO_WALLET

Once the timelock had expired, CLN began RBF attempts on its OUR_DELAYED_RETURN_TO_WALLET transaction:

2024-11-02T03:48:49.441Z INFO    02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid 4f…c7 (fee 259sat)

Evidently there's no logic to avoid attempting to RBF a transaction using the same transaction (a fraction of a second later):

2024-11-02T03:48:49.612Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid 4f…c7 (fee 259sat)

(Odd that that message was logged at the DEBUG level, whereas the previous message of identical format was logged at the INFO level.)

What followed was a strangely urgent series of attempts to RBF the transaction with ever decreasing fees (which should be impossible):

2024-11-02T03:49:20.730Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid 4f…c7 (fee 259sat)
2024-11-02T03:49:43.621Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid 4f…c7 (fee 259sat)
2024-11-02T03:50:33.943Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid 4f…c7 (fee 259sat)
2024-11-02T03:51:08.918Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid 4f…c7 (fee 259sat)
2024-11-02T03:51:43.130Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid 4f…c7 (fee 259sat)
2024-11-02T03:52:42.515Z DEBUG   02…73-chan#255049: RBF onchain txid 4f…c7 (fee 259sat) with txid ee…e0 (fee 258sat)
2024-11-02T03:53:24.916Z DEBUG   02…73-chan#255049: RBF onchain txid ee…e0 (fee 258sat) with txid ee…e0 (fee 258sat)
2024-11-02T03:54:07.413Z DEBUG   02…73-chan#255049: RBF onchain txid ee…e0 (fee 258sat) with txid ee…e0 (fee 258sat)
2024-11-02T03:54:52.592Z DEBUG   02…73-chan#255049: RBF onchain txid ee…e0 (fee 258sat) with txid ee…e0 (fee 258sat)
2024-11-02T03:55:26.817Z DEBUG   02…73-chan#255049: RBF onchain txid ee…e0 (fee 258sat) with txid ee…e0 (fee 258sat)
2024-11-02T03:56:00.780Z DEBUG   02…73-chan#255049: RBF onchain txid ee…e0 (fee 258sat) with txid 26…7a (fee 257sat)
2024-11-02T03:56:40.987Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T03:57:16.053Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T03:57:55.157Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T03:58:42.712Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T03:59:33.865Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T04:00:07.990Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T04:00:59.118Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T04:01:37.423Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 26…7a (fee 257sat)
2024-11-02T04:02:10.430Z DEBUG   02…73-chan#255049: RBF onchain txid 26…7a (fee 257sat) with txid 4d…f5 (fee 256sat)
2024-11-02T04:02:55.729Z DEBUG   02…73-chan#255049: RBF onchain txid 4d…f5 (fee 256sat) with txid 4d…f5 (fee 256sat)
2024-11-02T04:03:31.610Z DEBUG   02…73-chan#255049: RBF onchain txid 4d…f5 (fee 256sat) with txid 4d…f5 (fee 256sat)
2024-11-02T04:04:24.633Z DEBUG   02…73-chan#255049: RBF onchain txid 4d…f5 (fee 256sat) with txid 4d…f5 (fee 256sat)
2024-11-02T04:04:58.715Z DEBUG   02…73-chan#255049: RBF onchain txid 4d…f5 (fee 256sat) with txid 4d…f5 (fee 256sat)
2024-11-02T04:05:31.786Z DEBUG   02…73-chan#255049: RBF onchain txid 4d…f5 (fee 256sat) with txid 0b…f6 (fee 255sat)
2024-11-02T04:06:31.175Z DEBUG   02…73-chan#255049: RBF onchain txid 0b…f6 (fee 255sat) with txid 0b…f6 (fee 255sat)
2024-11-02T04:07:13.179Z DEBUG   02…73-chan#255049: RBF onchain txid 0b…f6 (fee 255sat) with txid 0b…f6 (fee 255sat)
2024-11-02T04:08:11.545Z DEBUG   02…73-chan#255049: RBF onchain txid 0b…f6 (fee 255sat) with txid 0b…f6 (fee 255sat)
2024-11-02T04:08:44.633Z DEBUG   02…73-chan#255049: RBF onchain txid 0b…f6 (fee 255sat) with txid 0b…f6 (fee 255sat)
2024-11-02T04:09:23.023Z DEBUG   02…73-chan#255049: RBF onchain txid 0b…f6 (fee 255sat) with txid 0b…f6 (fee 255sat)
2024-11-02T04:10:18.191Z DEBUG   02…73-chan#255049: RBF onchain txid 0b…f6 (fee 255sat) with txid ca…24 (fee 254sat)
2024-11-02T04:10:51.601Z DEBUG   02…73-chan#255049: RBF onchain txid ca…24 (fee 254sat) with txid ca…24 (fee 254sat)
2024-11-02T04:11:45.691Z DEBUG   02…73-chan#255049: RBF onchain txid ca…24 (fee 254sat) with txid ca…24 (fee 254sat)
2024-11-02T04:12:19.949Z DEBUG   02…73-chan#255049: RBF onchain txid ca…24 (fee 254sat) with txid ca…24 (fee 254sat)
2024-11-02T04:12:56.726Z DEBUG   02…73-chan#255049: RBF onchain txid ca…24 (fee 254sat) with txid ca…24 (fee 254sat)
2024-11-02T04:13:49.578Z DEBUG   02…73-chan#255049: RBF onchain txid ca…24 (fee 254sat) with txid ca…24 (fee 254sat)
2024-11-02T04:14:23.612Z DEBUG   02…73-chan#255049: RBF onchain txid ca…24 (fee 254sat) with txid 9e…b7 (fee 253sat)
2024-11-02T04:15:20.747Z DEBUG   02…73-chan#255049: RBF onchain txid 9e…b7 (fee 253sat) with txid 9e…b7 (fee 253sat)
2024-11-02T04:16:21.038Z DEBUG   02…73-chan#255049: RBF onchain txid 9e…b7 (fee 253sat) with txid 9e…b7 (fee 253sat)
2024-11-02T04:17:18.269Z DEBUG   02…73-chan#255049: RBF onchain txid 9e…b7 (fee 253sat) with txid 9e…b7 (fee 253sat)
2024-11-02T04:18:04.544Z DEBUG   02…73-chan#255049: RBF onchain txid 9e…b7 (fee 253sat) with txid 69…c4 (fee 252sat)

Finally, one of the proposed replacement transactions was mined into a block:

2024-11-02T04:18:35.703Z DEBUG   02…73-chan#255049: Got UTXO spend for 57…bd:3: 26…7a

You'll note that it was not the most recently proposed replacement (69…c4) that was mined but rather one (26…7a) from a few iterations back.

CLN tried again to RBF its claim transaction even after it had noted that the UTXO had already been spent on chain:

2024-11-02T04:18:43.271Z DEBUG   02…73-chan#255049: RBF onchain txid 69…c4 (fee 252sat) with txid 69…c4 (fee 252sat)

Subsequently it realized that its DELAYED_OUTPUT_TO_US output had been resolved by its OUR_DELAYED_RETURN_TO_WALLET proposal:

2024-11-02T04:18:43.290Z DEBUG   02…73-onchaind-chan#255049: Resolved OUR_UNILATERAL/DELAYED_OUTPUT_TO_US by our proposal OUR_DELAYED_RETURN_TO_WALLET (26…7a)
2024-11-02T04:18:43.290Z DEBUG   02…73-onchaind-chan#255049: billboard: All outputs resolved: waiting 100 more blocks before forgetting channel

However, it then continued trying to RBF its proposal, still with gradually decreasing fees:

2024-11-02T04:19:25.208Z DEBUG   02…73-chan#255049: RBF onchain txid 69…c4 (fee 252sat) with txid 69…c4 (fee 252sat)
2024-11-02T04:20:15.297Z DEBUG   02…73-chan#255049: RBF onchain txid 69…c4 (fee 252sat) with txid 7c…fc (fee 251sat)
2024-11-02T04:21:12.484Z DEBUG   02…73-chan#255049: RBF onchain txid 7c…fc (fee 251sat) with txid 7c…fc (fee 251sat)
2024-11-02T04:21:46.420Z DEBUG   02…73-chan#255049: RBF onchain txid 7c…fc (fee 251sat) with txid 7c…fc (fee 251sat)
2024-11-02T04:22:31.528Z DEBUG   02…73-chan#255049: RBF onchain txid 7c…fc (fee 251sat) with txid 7c…fc (fee 251sat)
2024-11-02T04:23:15.672Z DEBUG   02…73-chan#255049: RBF onchain txid 7c…fc (fee 251sat) with txid e0…61 (fee 250sat)
2024-11-02T04:23:31.095Z DEBUG   02…73-chan#255049: RBF onchain txid e0…61 (fee 250sat) with txid e0…61 (fee 250sat)
2024-11-02T04:24:31.365Z DEBUG   02…73-chan#255049: RBF onchain txid e0…61 (fee 250sat) with txid e0…61 (fee 250sat)
2024-11-02T04:25:27.591Z DEBUG   02…73-chan#255049: RBF onchain txid e0…61 (fee 250sat) with txid e0…61 (fee 250sat)
2024-11-02T04:25:59.091Z DEBUG   02…73-chan#255049: RBF onchain txid e0…61 (fee 250sat) with txid af…49 (fee 249sat)
2024-11-02T04:26:44.498Z DEBUG   02…73-chan#255049: RBF onchain txid af…49 (fee 249sat) with txid af…49 (fee 249sat)
2024-11-02T04:27:43.586Z DEBUG   02…73-chan#255049: RBF onchain txid af…49 (fee 249sat) with txid f8…96 (fee 248sat)
⋮

This continued until 100 blocks had passed and CLN "forgot" the channel:

⋮
2024-11-02T21:00:01.581Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:00:58.113Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:01:28.847Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:02:00.556Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:02:51.279Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:03:43.025Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:04:21.828Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:05:12.364Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:06:02.900Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:06:56.461Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:07:04.916Z DEBUG   02…73-chan#255049: RBF onchain txid d8…ab (fee 122sat) with txid d8…ab (fee 122sat)
2024-11-02T21:07:04.932Z DEBUG   02…73-onchaind-chan#255049: Got new message WIRE_ONCHAIND_DEPTH
2024-11-02T21:07:04.932Z DEBUG   02…73-onchaind-chan#255049: OUR_UNILATERAL/DELAYED_OUTPUT_TO_US->OUR_DELAYED_RETURN_TO_WALLET depth 100
2024-11-02T21:07:04.932Z DEBUG   02…73-onchaind-chan#255049: billboard: All outputs resolved: waiting 0 more blocks before forgetting channel
2024-11-02T21:07:04.933Z INFO    02…73-chan#255049: onchaind complete, forgetting peer

Only then did the RBF attempts cease.

getinfo output

This was with CLN 24.08.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant