Skip to content

Enforce segwit inputs for all "safe" funding transactions #3199

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

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

TheBlueMatt
Copy link
Collaborator

8403755 introduced a separate path for funding a channel without a full funding transaction, relying on users to manually broadcast the funding tx. One of the major things that makes this path less safe is that for other paths we're supposed to validate that all inputs have witnesses, making the funding transaction (likely) txid-non-malleable.

However, in one of several rewrites of that commit the funding tx tests ended up getting elided in some call paths, which is fixed here.

8403755 introduced a separate path
for funding a channel without a full funding transaction, relying
on users to manually broadcast the funding tx. One of the major
things that makes this path less safe is that for other paths we're
supposed to validate that all inputs have witnesses, making the
funding transaction (likely) txid-non-malleable.

However, in one of several rewrites of that commit the funding tx
tests ended up getting elided in some call paths, which is fixed
here.
@TheBlueMatt TheBlueMatt added this to the 0.0.124 milestone Jul 22, 2024
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 89.73%. Comparing base (3733103) to head (55686b9).
Report is 2 commits behind head on main.

Files Patch % Lines
lightning/src/ln/channelmanager.rs 33.33% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3199      +/-   ##
==========================================
+ Coverage   89.71%   89.73%   +0.01%     
==========================================
  Files         121      121              
  Lines      101074   101072       -2     
  Branches   101074   101072       -2     
==========================================
+ Hits        90680    90692      +12     
+ Misses       7701     7690      -11     
+ Partials     2693     2690       -3     

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

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Going to land this as it's a simple move that also checks the the witness data for the funding_transaction_generated call path but not for the unsafe case, which was the goal of the change in the original PR (cc @jbesraa).

@tnull tnull merged commit fafa655 into lightningdevkit:main Jul 23, 2024
18 of 19 checks passed
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.

2 participants