Skip to content

Store Payee info with HTLCs #1138

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

Conversation

TheBlueMatt
Copy link
Collaborator

Based on #1134, this builds on #1104 and ensures users always get payee information back in PaymentPathFailed events.

@TheBlueMatt TheBlueMatt added this to the 0.0.103 milestone Oct 25, 2021
@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #1138 (2a7ed23) into main (ca10349) will increase coverage by 0.06%.
The diff coverage is 94.00%.

❗ Current head 2a7ed23 differs from pull request most recent head 1b99c93. Consider uploading reports for the commit 1b99c93 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1138      +/-   ##
==========================================
+ Coverage   90.41%   90.47%   +0.06%     
==========================================
  Files          68       68              
  Lines       35244    35273      +29     
==========================================
+ Hits        31865    31914      +49     
+ Misses       3379     3359      -20     
Impacted Files Coverage Δ
lightning/src/ln/functional_test_utils.rs 95.11% <ø> (ø)
lightning/src/routing/router.rs 95.54% <81.81%> (+0.95%) ⬆️
lightning/src/ln/channelmanager.rs 83.96% <97.05%> (+0.07%) ⬆️
lightning/src/ln/channel.rs 88.38% <100.00%> (+<0.01%) ⬆️
lightning/src/ln/functional_tests.rs 97.37% <100.00%> (+0.01%) ⬆️
lightning/src/ln/onion_utils.rs 95.38% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca10349...1b99c93. Read the comment docs.

@jkczyz jkczyz self-requested a review October 25, 2021 15:24
@TheBlueMatt TheBlueMatt force-pushed the 2021-10-payee-in-monitors branch 2 times, most recently from 6a026ca to 61ed11a Compare October 25, 2021 16:18
@TheBlueMatt
Copy link
Collaborator Author

Rebased and fixed fuzz build.

Copy link
Contributor

@arik-so arik-so left a comment

Choose a reason for hiding this comment

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

LGTM

`Payee` is expected to be used by users to get routes for payment
retries, potentially with their own router. Thus, its helpful if it
is pub, even if it is redundant with the last hop in the `path`
field in `Events::PaymentPathFailed`.
@TheBlueMatt TheBlueMatt force-pushed the 2021-10-payee-in-monitors branch from 61ed11a to 2a7ed23 Compare October 25, 2021 17:58
@TheBlueMatt
Copy link
Collaborator Author

Good catch, testing the retry data in the expect macros is super trivial and easy way to get lots of coverage, done.

Copy link
Contributor

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

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

LGTM, please squash

This stores and tracks HTLC payee information with HTLCSource info,
allowing us to provide it back to the user if the HTLC fails and
ensuring persistence by keeping it with the HTLC itself as it
passes between Channel and ChannelMonitor.
@TheBlueMatt TheBlueMatt force-pushed the 2021-10-payee-in-monitors branch from 2a7ed23 to 1b99c93 Compare October 25, 2021 19:41
@TheBlueMatt
Copy link
Collaborator Author

Squashed without change, will land after CI:

$ git diff-tree -U1 2a7ed2305 1b99c9333
$

@TheBlueMatt TheBlueMatt merged commit 2ed1ba6 into lightningdevkit:main Oct 25, 2021
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.

3 participants