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

Expose the channel via which we received a payment #1856

Merged
merged 2 commits into from
Nov 29, 2022

Conversation

tnull
Copy link
Contributor

@tnull tnull commented Nov 16, 2022

Fixes #1800.
Based on #1855.

Previously the user had a hard time understanding via which channel we received some funds. In this PR, we therefore expose the channel_id and user_channel_id of the last hop in the PaymentReceived event.

@tnull tnull marked this pull request as draft November 16, 2022 14:44
@tnull
Copy link
Contributor Author

tnull commented Nov 16, 2022

Currently in draft. Will also expose the current number of confirmations in ChannelDetails as requested in #1800, and will look into whether we want to expose the channel ids also in other event types.

@TheBlueMatt
Copy link
Collaborator

Nice! Thanks. Let us know when you're ready for more review but the draft code basically LGTM.

@tnull tnull force-pushed the 2022-10-expose-channel-id branch from 0fb6e3e to 132d5da Compare November 17, 2022 10:31
@tnull tnull marked this pull request as ready for review November 17, 2022 10:32
@tnull
Copy link
Contributor Author

tnull commented Nov 17, 2022

Nice! Thanks. Let us know when you're ready for more review but the draft code basically LGTM.

I now exposed the number of confirmations via ChannelDetails. Should be ready for review.

I also explored exposing the channel ids in PaymentClaimed, however, I'm not sure if we want to go this way since we'd need to collect all last hops of MPP payments, which we'd probably don't want to do via a simple unsorted Vec. So if we want to do it, it should probably be a map showing which parts were claimed over which channel? Then again, this seems overly complicated for not that much benefit over the information provided in PaymentReceived. Any opinion whether we want to also expose them in PaymentClaimed?

@tnull tnull added this to the 0.0.113 milestone Nov 17, 2022
@tnull tnull force-pushed the 2022-10-expose-channel-id branch 2 times, most recently from 3b6d2df to 86e2039 Compare November 17, 2022 12:10
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2022

Codecov Report

Base: 90.72% // Head: 90.70% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (3625608) compared to base (64b9e83).
Patch coverage: 97.05% of modified lines in pull request are covered.

❗ Current head 3625608 differs from pull request most recent head b1b3666. Consider uploading reports for the commit b1b3666 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1856      +/-   ##
==========================================
- Coverage   90.72%   90.70%   -0.02%     
==========================================
  Files          91       91              
  Lines       47999    48042      +43     
  Branches    47999    48042      +43     
==========================================
+ Hits        43546    43578      +32     
- Misses       4453     4464      +11     
Impacted Files Coverage Δ
lightning/src/util/events.rs 25.97% <71.42%> (+0.35%) ⬆️
lightning/src/ln/chanmon_update_fail_tests.rs 97.59% <100.00%> (+<0.01%) ⬆️
lightning/src/ln/channel.rs 88.84% <100.00%> (+0.01%) ⬆️
lightning/src/ln/channelmanager.rs 86.37% <100.00%> (+0.02%) ⬆️
lightning/src/ln/functional_test_utils.rs 93.73% <100.00%> (+0.01%) ⬆️
lightning/src/ln/functional_tests.rs 97.01% <100.00%> (-0.07%) ⬇️
lightning/src/ln/reorg_tests.rs 100.00% <100.00%> (ø)
lightning/src/routing/router.rs 91.73% <100.00%> (+<0.01%) ⬆️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
... 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.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Basically LGTM

lightning/src/ln/reorg_tests.rs Outdated Show resolved Hide resolved
lightning/src/ln/chanmon_update_fail_tests.rs Outdated Show resolved Hide resolved
lightning/src/ln/channel.rs Outdated Show resolved Hide resolved
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.

LGTM after squash

@tnull
Copy link
Contributor Author

tnull commented Nov 21, 2022

LGTM after squash

Squashed commits without further changes. Happy to rebase again though, if we want to land #1766 before this.

@TheBlueMatt
Copy link
Collaborator

Needs rebase now.

@tnull
Copy link
Contributor Author

tnull commented Nov 28, 2022

Rebased on main.

@tnull tnull force-pushed the 2022-10-expose-channel-id branch 2 times, most recently from b28bdae to 3625608 Compare November 29, 2022 09:53
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.

LGTM after squash :)

@TheBlueMatt
Copy link
Collaborator

Yes, please squash :)

We expose the `channel_id` and `user_channel_id` via which we received a
payment in the `PaymentReceived` event.
We expose the current number of confirmations in `ChannelDetails`.
@tnull tnull force-pushed the 2022-10-expose-channel-id branch from 3625608 to b1b3666 Compare November 29, 2022 17:50
@tnull
Copy link
Contributor Author

tnull commented Nov 29, 2022

Squashed without further changes.

@TheBlueMatt TheBlueMatt merged commit 2c57878 into lightningdevkit:main Nov 29, 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.

Expose channel payment was received on in events
4 participants