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

Correct payment resolution after on chain failure of dust HTLCs #1691

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

Previously, we wouldn't mark a dust HTLC as permanently resolved if
the commitment transaction went on chain. This resulted in us
always considering the HTLC as pending on restart, when we load the
pending payments set from the monitors.

Fixes #1653.

@TheBlueMatt TheBlueMatt added this to the 0.0.111 milestone Sep 2, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2022

Codecov Report

Merging #1691 (b0a0955) into main (00f08c9) will decrease coverage by 0.10%.
The diff coverage is 97.59%.

@@            Coverage Diff             @@
##             main    #1691      +/-   ##
==========================================
- Coverage   90.88%   90.78%   -0.11%     
==========================================
  Files          85       85              
  Lines       46220    47408    +1188     
  Branches    46220    47408    +1188     
==========================================
+ Hits        42007    43038    +1031     
- Misses       4213     4370     +157     
Impacted Files Coverage Δ
lightning/src/ln/functional_test_utils.rs 93.58% <93.33%> (-0.02%) ⬇️
lightning/src/ln/payment_tests.rs 98.89% <98.96%> (+0.01%) ⬆️
lightning/src/chain/channelmonitor.rs 91.23% <100.00%> (+0.06%) ⬆️
lightning/src/ln/priv_short_conf_tests.rs 96.84% <100.00%> (+0.24%) ⬆️
lightning/src/ln/functional_tests.rs 96.83% <0.00%> (-0.29%) ⬇️
lightning/src/lib.rs 100.00% <0.00%> (ø)
lightning/src/ln/features.rs 99.60% <0.00%> (+0.14%) ⬆️
lightning/src/ln/msgs.rs 87.01% <0.00%> (+1.26%) ⬆️
lightning/src/util/time.rs 82.55% <0.00%> (+1.30%) ⬆️
lightning/src/onion_message/functional_tests.rs 98.47% <0.00%> (+2.59%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

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

Looks good, test fails as expected on main

Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

LGTM. There are a few warnings/failures to fix after the latest push.

Also wrote a commit to create a type alias for the test ChannelManager if you want to include it here, see https://gist.github.com/wpaulino/edc59a12b749452d8bcce2bb0816cee2.

@TheBlueMatt
Copy link
Collaborator Author

Oops lol I guess there was a reason the channel was being opened 0conf in the test.

@wpaulino
Copy link
Contributor

wpaulino commented Sep 6, 2022

Feel free to squash.

Previously, we wouldn't mark a dust HTLC as permanently resolved if
the commitment transaction went on chain. This resulted in us
always considering the HTLC as pending on restart, when we load the
pending payments set from the monitors.

Fixes lightningdevkit#1653.
@TheBlueMatt
Copy link
Collaborator Author

Squashed without further changes.

@valentinewallace valentinewallace merged commit e45db2b into lightningdevkit:main Sep 7, 2022
@wpaulino wpaulino mentioned this pull request Sep 9, 2022
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.

Dust HTLCs on closed channels are always retryable
4 participants