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] Clone for ChannelContext #3332

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

Conversation

optout21
Copy link
Contributor

@optout21 optout21 commented Sep 23, 2024

Update: This assumes that the whole ChannelContext is duplicated, which may not be the case in the final solution.

Cloning of a channel -- more precisely of ChannelContext -- is needed for Splicing as well as for dual funding RBF, this is a preparation.

Simple #[derive(Clone)) is not sufficient, as the channel signer struct cannot be cloned, ultimately due to AtomicUSize and Secp256k1 (in KeysManager). So instead, a field-by-field cloning is done, with the a few exceptions.

@optout21 optout21 marked this pull request as ready for review September 25, 2024 19:04
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.65%. Comparing base (66fb520) to head (e593e86).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3332      +/-   ##
==========================================
- Coverage   89.66%   89.65%   -0.01%     
==========================================
  Files         126      126              
  Lines      102676   102826     +150     
  Branches   102676   102826     +150     
==========================================
+ Hits        92062    92188     +126     
- Misses       7894     7913      +19     
- Partials     2720     2725       +5     
Flag Coverage Δ
89.65% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jkczyz jkczyz self-requested a review September 26, 2024 02:39
@optout21 optout21 marked this pull request as draft October 3, 2024 18:09
@jkczyz
Copy link
Contributor

jkczyz commented Oct 3, 2024

Discussed briefly offline. This may not be needed if we split ChannelContext to avoid duplicating some fields.

@optout21
Copy link
Contributor Author

optout21 commented Oct 3, 2024

This change request assumes that the whole ChannelContext struct is duplicated, which may not be the best solution. I put this on hold for now (back to draft, description updated).

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

Successfully merging this pull request may close these issues.

2 participants