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

Fail unsigned outgoing htlcs on force-close #1832

Merged
merged 8 commits into from
Jul 16, 2021
Merged

Fail unsigned outgoing htlcs on force-close #1832

merged 8 commits into from
Jul 16, 2021

Conversation

pm47
Copy link
Member

@pm47 pm47 commented May 31, 2021

See #1829.

We should fail outgoing unsigned htlcs on force close, just like we do when disconnected.

@codecov-commenter
Copy link

codecov-commenter commented May 31, 2021

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.33%. Comparing base (ca51a2d) to head (7c7cb15).
Report is 620 commits behind head on master.

Files with missing lines Patch % Lines
...r/acinq/eclair/payment/send/PaymentLifecycle.scala 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1832      +/-   ##
==========================================
+ Coverage   87.27%   87.33%   +0.05%     
==========================================
  Files         159      159              
  Lines       11943    11950       +7     
  Branches      471      448      -23     
==========================================
+ Hits        10423    10436      +13     
+ Misses       1520     1514       -6     
Files with missing lines Coverage Δ
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 86.35% <100.00%> (+0.13%) ⬆️
...n/scala/fr/acinq/eclair/channel/ChannelTypes.scala 100.00% <100.00%> (ø)
...a/fr/acinq/eclair/payment/relay/ChannelRelay.scala 98.00% <100.00%> (+0.02%) ⬆️
...r/acinq/eclair/payment/send/PaymentLifecycle.scala 92.25% <0.00%> (-0.66%) ⬇️

... and 4 files with indirect coverage changes

@akumaigorodski
Copy link
Contributor

Looks like this only works on user-issued force-close command currently? I'd guess that would be the least likely occurrence, more probable case is something like we are sending HTLCs and suddenly see remote commit published.

@pm47
Copy link
Member Author

pm47 commented Jun 1, 2021

Looks like this only works on user-issued force-close command currently? I'd guess that would be the least likely occurrence, more probable case is something like we are sending HTLCs and suddenly see remote commit published.

I agree the fix should handle all cases of channel closing.

@pm47 pm47 marked this pull request as draft June 1, 2021 14:42
@t-bast
Copy link
Member

t-bast commented Jun 7, 2021

I think the right way to fix this is here:

Closing.overriddenOutgoingHtlcs(d, tx).foreach { add =>

We should wait for the commit tx to be confirmed and then fail all these proposed HTLCs, either by modifying overriddenOutgoingHtlcs to return them or by explicitly handling them separately.

@pm47
Copy link
Member Author

pm47 commented Jun 28, 2021

We should wait for the commit tx to be confirmed and then fail all these proposed HTLCs, either by modifying overriddenOutgoingHtlcs to return them or by explicitly handling them separately.

I disagree, because in the case of an overridden htlc, that htlc was previously committed, which is why we need to make sure that a competing commitment won the race. Here, since the htlc has not been signed, it will be overridden as soon as we enter the closing procedure.

@pm47 pm47 marked this pull request as ready for review June 28, 2021 17:21
@pm47 pm47 requested a review from t-bast July 15, 2021 16:32
t-bast
t-bast previously approved these changes Jul 16, 2021
@pm47
Copy link
Member Author

pm47 commented Jul 16, 2021

Rebased on master.

@pm47 pm47 merged commit d02760d into master Jul 16, 2021
@pm47 pm47 deleted the force-close-htlcs branch July 16, 2021 11:52
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.

5 participants