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

[Splicing] Preserve funding_transaction for the later lifecycle of the channel #3317

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

optout21
Copy link
Contributor

@optout21 optout21 commented Sep 16, 2024

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:

  • does not clear ChannelContext.funding_transaction when tx is broadcast, but it's preserved
  • adds a funding_transaction_broadcast bool field to indicate if it has been broadcast

So behavior of not (re)broadcasting twice is preserve (though I am not sure whether this was intentional and it is needed, one test fails if this is changed (test_completed_payment_not_retryable_on_reload)).

Alternative would be to leave funding_transaction unchanged, and introduce a new funding_transaction_saved field, that is set the same way, but never cleared. This way existing logic would not be affected, but the tx would be kept in two copies.

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.63%. Comparing base (66fb520) to head (bb043a1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3317      +/-   ##
==========================================
- Coverage   89.64%   89.63%   -0.02%     
==========================================
  Files         126      126              
  Lines      102676   102697      +21     
  Branches   102676   102697      +21     
==========================================
+ Hits        92045    92048       +3     
- Misses       7912     7920       +8     
- Partials     2719     2729      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@optout21 optout21 marked this pull request as ready for review September 20, 2024 09:42
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

Successfully merging this pull request may close these issues.

[Splicing] Make funding transaction available in funded channel
2 participants