-
Notifications
You must be signed in to change notification settings - Fork 436
Default to anchors and remove automatic channel acceptance #4354
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?
Conversation
|
👋 Thanks for assigning @wpaulino as a reviewer! |
Hmm, can you ask claude to change those to use the |
Removes the `manually_accept_inbound_channels` config option. In upcoming commit we will default to anchor channels which requires users checking if they have enough onchain funds to cover fees in case of a force close. Hence, we move to always require users to manually accept inbound channels.
86d25a2 to
ef441ac
Compare
Set `negotiate_anchors_zero_fee_htlc_tx` default to true.
ef441ac to
b1ee9e3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4354 +/- ##
=========================================
+ Coverage 0 86.09% +86.09%
=========================================
Files 0 156 +156
Lines 0 102450 +102450
Branches 0 102450 +102450
=========================================
+ Hits 0 88202 +88202
- Misses 0 11754 +11754
- Partials 0 2494 +2494
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:
|
1 similar comment
| /// The `user_channel_id` value passed in for outbound channels, or for inbound | ||
| /// channels. |
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.
Let's keep this doc consistent with the other events, e.g., SpliceFailed
| features: nodes[0].node.init_features(), networks: None, remote_network_address: None | ||
| }, true).unwrap(); | ||
| } | ||
| let _ = nodes[1].node.get_and_clear_pending_msg_events(); |
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 should check what events we're expecting
| /// Note that all inbound channel requests will be surfaced via [`Event::OpenChannelRequest`] | ||
| /// and you must manually accept them with [`ChannelManager::accept_inbound_channel`]. This | ||
| /// is done to give you the chance to check whether your reserve of onchain funds is enough |
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.
| /// Note that all inbound channel requests will be surfaced via [`Event::OpenChannelRequest`] | |
| /// and you must manually accept them with [`ChannelManager::accept_inbound_channel`]. This | |
| /// is done to give you the chance to check whether your reserve of onchain funds is enough | |
| /// Upon receiving an `[Event::OpenChannelRequest]` for a channel of this type, you must check whether your reserve of onchain funds is enough |
| /// [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check | ||
| /// whether your reserve of onchain funds is enough to cover the fees for all existing and new | ||
| /// channels featuring anchor outputs in the event of a force close. | ||
| /// Note that all inbound channel requests will be surfaced via [`Event::OpenChannelRequest`] |
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.
Same suggestion here as above
| let events = node_b.node.get_and_clear_pending_events(); | ||
| assert_eq!(events.len(), 1); | ||
| match &events[0] { | ||
| Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, .. } => node_b | ||
| .node | ||
| .accept_inbound_channel(temporary_channel_id, counterparty_node_id, 42, None) | ||
| .unwrap(), | ||
| _ => panic!("Unexpected event"), | ||
| }; |
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.
Use the new helper added here? Several other cases throughout the diff
| // If this peer already has some channels, a new channel won't increase our number of peers | ||
| // with unfunded channels, so as long as we aren't over the maximum number of unfunded | ||
| // channels per-peer we can accept channels from a peer with existing ones. | ||
| if is_only_peer_channel && peers_without_funded_channels >= MAX_UNFUNDED_CHANNEL_PEERS { |
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.
Why did this change?
| let channel_type = channel::channel_type_from_open_channel( | ||
| common_fields, &self.channel_type_features() | ||
| ).map_err(|e| MsgHandleErrInternal::from_chan_no_close(e, common_fields.temporary_channel_id))?; | ||
| let channel_type = |
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.
Comment in line above can be updated
|
|
||
| * `ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx` | ||
| now defaults to `true` (previously `false`). This means anchor output channels | ||
| will be negotiated by default for all new channels, requiring users to |
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.
| will be negotiated by default for all new channels, requiring users to | |
| will be negotiated by default for all new channels if the counterparty supports it, requiring users to |
| @@ -4555,6 +4555,7 @@ pub fn create_node_cfgs_with_node_id_message_router<'a>( | |||
|
|
|||
| pub fn test_default_channel_config() -> UserConfig { | |||
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.
Would be nice to have the default actually use anchors so each new test added uses it, and we rename this one to something like legacy_test_channel_config to not break all our existing tests
Closes #4337
Changes
negotiate_anchors_zero_fee_htlc_txdefault to true and removes themanually_accept_inbound_channelsconfig option.Edit: Left the tests with default to non-anchor