-
Notifications
You must be signed in to change notification settings - Fork 432
Set dont_forward on private channel updates and add tests #4340
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
base: main
Are you sure you want to change the base?
Set dont_forward on private channel updates and add tests #4340
Conversation
|
👋 I see @wpaulino was un-assigned. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🔔 1st Reminder Hey @wpaulino! This PR has been waiting for your review. |
| 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); |
There was a problem hiding this comment.
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.
Fixes #1672.
Summary
dont_forwardbit (message_flags bit 1) onchannel_updatemessages for private channels.channel_updatewithdont_forwardset for an unknown channel.Details
ChannelManager::get_channel_update_for_unicast, we now compute:message_flags = 1 | (1 << 1)for private channels (must_be_one + dont_forward).message_flags = 1for public channels (must_be_one only).internal_channel_update, if we receive achannel_updatefor an unknownshort_channel_idand thedont_forwardbit is set, we log a warning suggesting the user check thetx_indexpassed tochain::Confirm::transactions_confirmed.Tests
test_channel_update_dont_forward_flagtest_unknown_channel_update_with_dont_forward_logs_warningBased on lightning/bolts#999: BOLT 7
dont_forwardflag for SCID aliases.