-
Notifications
You must be signed in to change notification settings - Fork 366
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
[Splicing] Preserve funding_transaction for the later lifecycle of the channel, simple solution #3380
[Splicing] Preserve funding_transaction for the later lifecycle of the channel, simple solution #3380
Conversation
We shouldn't keep broadcasting forever, but I think we can trivially solve that by just checking if the funding tx has confirmed before broadcasting? |
Is that what is checked immediately below where the funding tx was previously taken? rust-lightning/lightning/src/ln/channel.rs Lines 5492 to 5496 in ee23649
Or are there other places we'd need to worry about? |
Not quite, that will keep broadcasting forever if the channel is 0conf or keep broadcasting after the funding is confirmed at |
Indeed, once the funding transaction is confirmed, it makes no sense to rebroadcast, |
I think with just that change I'd be happy with this PR :) |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Changed the test for preventing re-broadcast to look whether the funding transaction is confirmed or not (instead of looking at ChannelReady state). |
Addressed @jkczyz 's comments; not yet squashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Feel free to squash
3561196
to
5577a88
Compare
Squashed with no changes |
Fixes #3300
In splicing, the funding transaction (not just the ID) is needed during splice negotiation.
Funding transaction is kept in field
ChannelContext.funding_transaction
.However, the way it is currently used is that it is cleared when the tx is broadcast, and this fact is used in some logic.
This change:
ChannelContext.funding_transaction
when tx is broadcast, but it's preserved (it's never reset)close_on_unfunded_channel
)Note that in some cases the funding transaction may get broadcasted more than once, which is a change in behavior.
Alternative is to preserve behavior, with some extra field, #3317 .