Skip to content

Move channel_reestablish log#4469

Open
elnosh wants to merge 2 commits intolightningdevkit:mainfrom
elnosh:move-chanreestablish
Open

Move channel_reestablish log#4469
elnosh wants to merge 2 commits intolightningdevkit:mainfrom
elnosh:move-chanreestablish

Conversation

@elnosh
Copy link
Contributor

@elnosh elnosh commented Mar 6, 2026

extremely small thing but unless I'm missing something, this doesn't need to be logged all the time. Just noticed it while seeing connections with peers with no channels.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 6, 2026

👋 I see @valentinewallace was un-assigned.
If you'd like another reviewer assignment, please click here.

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @valentinewallace! 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.

let logger = WithChannelContext::from(&self.logger, &chan.context(), None);
match chan.peer_connected_get_handshake(self.chain_hash, &&logger) {
ReconnectionMsg::Reestablish(msg) => {
log_debug!(logger, "Generating channel_reestablish events");
Copy link
Collaborator

Choose a reason for hiding this comment

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

log is wrong now, now we'd already generated the event, and now we're writing this per-channel, which is fine but merits a string update.

@TheBlueMatt TheBlueMatt removed the request for review from valentinewallace March 9, 2026 13:49
@elnosh elnosh force-pushed the move-chanreestablish branch from a3ba402 to daff171 Compare March 10, 2026 14:30
let logger = WithChannelContext::from(&self.logger, &chan.context(), None);
match chan.peer_connected_get_handshake(self.chain_hash, &&logger) {
ReconnectionMsg::Reestablish(msg) => {
log_debug!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ironically this is actually our only place we log at DEBUG (or higher) when a peer connects, can we add variants of this in the other branches (including None, I think, if we have a Channel entry for a peer makes sense to log).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(including None, I think, if we have a Channel entry for a peer makes sense to log).

I wasn't sure when this would happen, seems only when the signer hasn't provided a point so I just added a generic peer reconnection msg.

@elnosh elnosh force-pushed the move-chanreestablish branch from daff171 to cfde1ca Compare March 17, 2026 12:56
@ldk-claude-review-bot
Copy link
Collaborator

No issues found. The .clone() removals are correct (last uses before move), and the logging changes are purely cosmetic — moving from a blanket message to per-channel messages with no logic changes.

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