Skip to content

feat: channel events#193

Open
frnandu wants to merge 3 commits intolightningdevkit:mainfrom
frnandu:feat/channel-events
Open

feat: channel events#193
frnandu wants to merge 3 commits intolightningdevkit:mainfrom
frnandu:feat/channel-events

Conversation

@frnandu
Copy link
Copy Markdown

@frnandu frnandu commented Apr 17, 2026

fixes #134

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 17, 2026

I've assigned @benthecarman as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Copy link
Copy Markdown
Contributor

@Anyitechs Anyitechs left a comment

Choose a reason for hiding this comment

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

Thank you for looking into this. Please fix CI if this is ready for review (The proto files are now out of date and needs to be updated, and the changes introduced needs to be formatted too)

@ldk-reviews-bot
Copy link
Copy Markdown

🔔 1st Reminder

Hey @benthecarman! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@ldk-reviews-bot
Copy link
Copy Markdown

🔔 2nd Reminder

Hey @benthecarman! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Comment thread ldk-server/src/main.rs
Comment on lines +646 to +653
matches!(
reason,
Some(ClosureReason::FundingTimedOut)
| Some(ClosureReason::DisconnectedPeer)
| Some(ClosureReason::CounterpartyCoopClosedUnfundedChannel)
| Some(ClosureReason::LocallyCoopClosedUnfundedChannel)
| Some(ClosureReason::FundingBatchClosure)
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of like this, can we do a match reason { ... then we can explicitly set true or false for each and we'll get a compile error when new reasons are added in the future

Comment thread ldk-server/src/main.rs
| Some(ClosureReason::CounterpartyCoopClosedUnfundedChannel) => {
events::ChannelClosureInitiator::Remote
},
Some(_) => events::ChannelClosureInitiator::Unknown,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we enumerate all the other ones still instead of just Some(_) for same reason

Comment thread ldk-server/src/main.rs
peer_feerate_sat_per_kw: *peer_feerate_sat_per_kw,
required_feerate_sat_per_kw: *required_feerate_sat_per_kw,
})),
_ => None,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again, can we enumerate them all

Comment thread e2e-tests/tests/e2e.rs
}

#[tokio::test]
async fn test_subscribe_events_channel_state_lifecycle_pending_ready_closed() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

for both of these tests, can we check the events on both sides?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also we should be able to assert more things on these events

Comment thread ldk-server/src/main.rs
mod service;
mod util;

use std::collections::HashSet;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to use the HashSet from HashBrown here instead, since it's already in the tree?

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.

Add Channel state change event publishing to grpc subscriptions

4 participants