Skip to content

Conversation

@elnosh
Copy link
Contributor

@elnosh elnosh commented Jan 27, 2026

Closes #4337

Changes negotiate_anchors_zero_fee_htlc_tx default to true and removes the manually_accept_inbound_channels config option.

Edit: Left the tests with default to non-anchor

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 27, 2026

👋 Thanks for assigning @wpaulino 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.

@TheBlueMatt
Copy link
Collaborator

Changing the negotiate_anchors_zero_fee_htlc_tx default to true in the tests causes +100 test failures

Hmm, can you ask claude to change those to use the test_default_config() thing? Our test config default has diverged somewhat from our actual default config for reasons like this but that's okay...

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.
@elnosh elnosh force-pushed the manual-channel-acceptance branch from 86d25a2 to ef441ac Compare January 28, 2026 20:22
Set `negotiate_anchors_zero_fee_htlc_tx` default
to true.
@elnosh elnosh force-pushed the manual-channel-acceptance branch from ef441ac to b1ee9e3 Compare January 28, 2026 20:38
@elnosh elnosh marked this pull request as ready for review January 28, 2026 20:38
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 81.39535% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.09%. Comparing base (7fe3268) to head (b1ee9e3).

Files with missing lines Patch % Lines
lightning/src/ln/channelmanager.rs 70.45% 12 Missing and 1 partial ⚠️
lightning/src/ln/functional_test_utils.rs 90.62% 3 Missing ⚠️
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     
Flag Coverage Δ
tests 86.09% <81.39%> (?)

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.

@jkczyz jkczyz requested a review from wpaulino January 29, 2026 18:32
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @jkczyz @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.

1 similar comment
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @jkczyz @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.

@ldk-reviews-bot
Copy link

🔔 2nd Reminder

Hey @jkczyz @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.

Comment on lines +1838 to +1839
/// The `user_channel_id` value passed in for outbound channels, or for inbound
/// channels.
Copy link
Contributor

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();
Copy link
Contributor

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

Comment on lines +169 to +171
/// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 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`]
Copy link
Contributor

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

Comment on lines +1700 to +1708
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"),
};
Copy link
Contributor

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 {
Copy link
Contributor

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 =
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 {
Copy link
Contributor

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

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.

Move to always-manually-accepting channels (and default anchors)

4 participants