Uh oh!
There was an error while loading. Please reload this page.
Add counterparty_node_id & channel_capacity to ChannelClosed event - #2387
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
04952ca to
01e3ef1Compare
valentinewallace
left a comment
There was a problem hiding this comment.
Could you add some test coverage? Otherwise LGTM.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vladimirfomene
commented
Jul 6, 2023
@valentinewallace, let me do that and open it up for reviews. |
9be7828 to
ef131e3CompareCodecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@## main #2387 +/- ##
==========================================
- Coverage 90.34% 90.32% -0.02%
==========================================
Files 106 106 Lines 55784 55850 +66 Branches 55784 55850 +66 ==========================================
+ Hits 50398 50447 +49 - Misses 5386 5403 +17
☔ View full report in Codecov by Sentry. |
a54a709 to
ee61e38Comparedunxen
commented
Jul 12, 2023
The fix for the CI breakage is merged now so this just needs a rebase :) |
ee61e38 to
1052ac6Compare
dunxen
left a comment
There was a problem hiding this comment.
Thanks! Just a few comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1052ac6 to
63614a1Comparebenthecarman
commented
Jul 15, 2023
If possible getting the closing txid would be great here too |
vladimirfomene
commented
Jul 20, 2023
@benthecarman in most cases when this event is fired, a closing tx has not yet been confirmed on chain so it is hard to figure out the closing txid at this point. I asked @TheBlueMatt on discord and here is what he had to say about it.
|
Uh oh!
There was an error while loading. Please reload this page.
| reason: ClosureReason::ProcessingError { err: err.err.clone() } | ||
| reason: ClosureReason::ProcessingError { err: err.err.clone() }, | ||
| counterparty_node_id: Some($counterparty_node_id), | ||
| channel_capacity_sats: $channel_capacity_sats, |
There was a problem hiding this comment.
If we think this may be set to None sometimes (due to dual funding?) then we should update the docs to indicate when the field can be None even for users of LDK 0.0.117, if not, let's make the macro take a non-option and wrap it in Some here so that its a compile error to pass None.
There was a problem hiding this comment.
When might it be considered None for the dual funding case? If we get a close event before accept_channel2 is sent / received?
There was a problem hiding this comment.
Thought so as well. I don’t know if we need worry about that with the new fix. @TheBlueMatt thanks for the pointer to look at the internal object
Uh oh!
There was an error while loading. Please reload this page.
854b742 to
ca02769Compare
dunxen
left a comment
There was a problem hiding this comment.
Looking good. I think you don't need to worry about addressing latest feedback with fixups commits. Can just edit the relevant commits and then we're ready for accept and merge unless any final things caught in review after.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The current ChannelClosed event does not let you know the counterparty during a channel close event. This change adds the counterparty_node_id and the channel_capacity to the ChannelClosed event. This helps users to have more context during a channel close event. Solves lightningdevkit#2343
ca02769 to
7cfafc9Compare| /// The reason the channel was closed. | ||
| reason: ClosureReason | ||
| reason: ClosureReason, | ||
| /// Counterparty in the closed channel. |
There was a problem hiding this comment.
You have quite a bit of whitespace at the ends of lines in your patch, a local git show should highlight them for you.
| check_added_monitors(&nodes[0], 1); | ||
| check_closed_broadcast(&nodes[0], 1, true); | ||
| check_closed_event(&nodes[0], 1, ClosureReason::HolderForceClosed, false); | ||
| check_closed_event!(&nodes[0], 1, ClosureReason::HolderForceClosed, false, |
There was a problem hiding this comment.
We're trying to move away from the macros slowly towards the functions, please don't re-introduce macro calls where we previously had functions.
The current ChannelClosed event does not let
you know the counterparty during a channel close
event. This change adds the counterparty_node_id
and the channel_capacity to the ChannelClosed event. This helps users to have more context during a
channel close event. Solves #2343