Skip to content

Conversation

@Thrishalmadasu
Copy link

@Thrishalmadasu Thrishalmadasu commented Jan 23, 2026

Fixes #1672.

Summary

  • Set the dont_forward bit (message_flags bit 1) on channel_update messages for private channels.
  • Log a warning when we receive a channel_update with dont_forward set for an unknown channel.
  • Add tests to cover both outbound flag setting and inbound warning logging.

Details

  • In ChannelManager::get_channel_update_for_unicast, we now compute:
    • message_flags = 1 | (1 << 1) for private channels (must_be_one + dont_forward).
    • message_flags = 1 for public channels (must_be_one only).
  • In internal_channel_update, if we receive a channel_update for an unknown short_channel_id and the dont_forward bit is set, we log a warning suggesting the user check the tx_index passed to chain::Confirm::transactions_confirmed.

Tests

  • New tests:
    • test_channel_update_dont_forward_flag
    • test_unknown_channel_update_with_dont_forward_logs_warning

Based on lightning/bolts#999: BOLT 7 dont_forward flag for SCID aliases.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 23, 2026

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

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (8cdc86a) to head (b0883ba).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4340      +/-   ##
==========================================
+ Coverage   86.53%   86.80%   +0.26%     
==========================================
  Files         158      158              
  Lines      103190   102790     -400     
  Branches   103190   102790     -400     
==========================================
- Hits        89300    89223      -77     
+ Misses      11469    11222     -247     
+ Partials     2421     2345      -76     
Flag Coverage Δ
fuzzing 36.20% <25.00%> (-0.87%) ⬇️
tests 86.09% <100.00%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Thrishalmadasu Thrishalmadasu marked this pull request as ready for review January 23, 2026 11:45
@ldk-reviews-bot
Copy link

🔔 1st Reminder

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

@TheBlueMatt TheBlueMatt removed the request for review from wpaulino January 26, 2026 14:41
None => {
// It's not a local channel
if msg.contents.message_flags & (1 << 1) != 0 {
log_warn!(self.logger, "Received channel_update for unknown channel {} with dont_forward set.\n\tYou may wish to check if an incorrect tx_index was passed to chain::Confirm::transactions_confirmed.", msg.contents.short_channel_id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't warn on something that a peer could spam us with. That would let them spam the logs. Also not sure we need the newline break here.

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.

Set the new dont_forward bit in channel_update messages

3 participants