Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Jan 7, 2026

We emit several events during the channel lifecycle, which have become a bit of a mess over the years, especially with the addition of 0-conf, splicing and on-the-fly funding.

We now use the following events:

  • ChannelCreated once the funding transaction is created
  • ChannelFundingConfirmed once the funding transaction is confirmed, which is also emitted for splice transactions
  • ChannelReadyForPayments once the channel is ready for payments, after exchanging channel_ready for the channel creation or splice_locked for splice transactions

The order between ChannelFundingConfirmed and ChannelReadyForPayments depends on whether 0-conf is used or not.

We remove ChannelOpened, which was actually a subset of the existing ChannelReadyForPayments event (which was added afterwards).

We add a few fields to existing channel events, which we don't yet store in the DB to avoid modifying it, but will store later when we modify the schema of the AuditDb.

We now store an entry in the AuditDb whenever a splice transaction confirms, which allows tracking the full history of a channel's changes.

We emit several events during the channel lifecycle, which have become
a bit of a mess over the years, especially with the addition of 0-conf,
splicing and on-the-fly funding.

We now use the following events:

- `ChannelCreated` once the funding transaction is created
- `ChannelFundingConfirmed` once the funding transaction is confirmed,
  which is also emitted for splice transactions
- `ChannelReadyForPayments` once the channel is ready for payments,
  after exchanging `channel_ready` for the channel creation or
  `splice_locked` for splice transactions

The order between `ChannelFundingConfirmed` and `ChannelReadyForPayments`
depends on whether 0-conf is used or not.

We remove `ChannelOpened`, which was actually a subset of the existing
`ChannelReadyForPayments` event (which was added afterwards).

We add a few fields to existing channel events, which we don't yet
store in the DB to avoid modifying it, but will store later when we
modify the schema of the `AuditDb`.

We now store an entry in the `AuditDb` whenever a splice transaction
confirms, which allows tracking the full history of a channel's changes.
@t-bast t-bast requested a review from pm47 January 7, 2026 11:07
@t-bast t-bast merged commit 473b46d into master Jan 7, 2026
1 of 3 checks passed
@t-bast t-bast deleted the channel-events-rework branch January 7, 2026 13:55
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