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

Add ChannelOpened event #2567

Merged
merged 2 commits into from
Jan 16, 2023
Merged

Add ChannelOpened event #2567

merged 2 commits into from
Jan 16, 2023

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Jan 13, 2023

Emit an event when a channel is opened and ready to process payments. This event is distinct from the ChannelCreated event which is sent earlier, once we think a funding transaction has been successfully created (but cannot guarantee when we're not the initiator).

I've regularly worked around the lack of such an event, and I think it's useful to have, especially for plugins that would like to know when a new channel is really available without having to watch all state transitions.

@t-bast t-bast requested review from pm47 and remyers January 13, 2023 13:38
@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2023

Codecov Report

Merging #2567 (27f51ef) into master (4dd4829) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2567      +/-   ##
==========================================
- Coverage   85.32%   85.29%   -0.03%     
==========================================
  Files         205      205              
  Lines       16121    16122       +1     
  Branches      703      681      -22     
==========================================
- Hits        13755    13752       -3     
- Misses       2366     2370       +4     
Impacted Files Coverage Δ
.../scala/fr/acinq/eclair/channel/ChannelEvents.scala 80.00% <ø> (ø)
...inq/eclair/channel/fsm/SingleFundingHandlers.scala 84.09% <ø> (ø)
...n/scala/fr/acinq/eclair/json/JsonSerializers.scala 95.12% <ø> (ø)
...inq/eclair/channel/fsm/CommonFundingHandlers.scala 90.00% <100.00%> (+0.52%) ⬆️
...acinq/eclair/channel/fsm/DualFundingHandlers.scala 82.69% <100.00%> (ø)
...air-core/src/main/scala/fr/acinq/eclair/Logs.scala 83.33% <0.00%> (-3.34%) ⬇️
...cala/fr/acinq/eclair/payment/relay/NodeRelay.scala 96.45% <0.00%> (-1.42%) ⬇️
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 86.78% <0.00%> (-0.12%) ⬇️
...main/scala/fr/acinq/eclair/io/PeerConnection.scala 87.17% <0.00%> (+0.36%) ⬆️

Copy link
Contributor

@remyers remyers left a comment

Choose a reason for hiding this comment

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

Apart from some confusion in the release notes, it looks good to me!

pm47
pm47 previously approved these changes Jan 16, 2023
Emit an event when a channel is opened and ready to process payments.
This event is distinct from the `ChannelCreated` event which is sent
earlier, once we think a funding transaction has been successfully created
(but cannot guarantee when we're not the initiator).
This is a breaking change, but it should be ok since the previous event
wasn't reliable: it was emitted at a time where we couldn't guarantee
that the channel would really confirm.
@t-bast
Copy link
Member Author

t-bast commented Jan 16, 2023

Rebased to fix conflicts.

Copy link
Contributor

@remyers remyers left a comment

Choose a reason for hiding this comment

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

LGTM!

@t-bast t-bast merged commit b21085d into master Jan 16, 2023
@t-bast t-bast deleted the channel-opened-event branch January 16, 2023 15:46
t-bast added a commit that referenced this pull request Jun 16, 2023
This release introduces a few API changes:

- `audit` now accepts `--count` and `--skip` parameters to limit the
  number of retrieved items (#2474, #2487)
- `sendtoroute` removes the `--trampolineNodes` argument and
  implicitly uses a single trampoline hop (#2480)
- `sendtoroute` now accept `--maxFeeMsat` to specify an upper bound
  of fees (#2626)
- `payinvoice` always returns the payment result when used with
  `--blocking`, even when using MPP (#2525)
- `node` returns high-level information about a remote node (#2568)
- `channel-created` is a new websocket event that is published when
  a channel's funding transaction has been broadcast (#2567)
- `channel-opened` websocket event was updated to contain the final
  `channel_id` and be published when a channel is ready to process
  payments (#2567)
- `getsentinfo` can now be used with `--offer` to list payments sent
  to a specific offer
- `listreceivedpayments` lists payments received by your node (#2607)
- `closedchannels` lists closed channels. It accepts `--count` and
  `--skip` parameters to limit the number of retrieved items as well
  (#2642)
- `cpfpbumpfees` can be used to unblock chains of unconfirmed
  transactions by creating a child transaction that pays a high fee
  (#1783)
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.

4 participants