Skip to content

Commit b0c384e

Browse files
carlaKCtankyleo
authored andcommitted
ln: remove test flag from negotiate_anchor_zero_fee_commitments
1 parent 953e939 commit b0c384e

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

fuzz/src/full_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ fn two_peer_forwarding_seed() -> Vec<u8> {
10481048
// our network key
10491049
ext_from_hex("0100000000000000000000000000000000000000000000000000000000000000", &mut test);
10501050
// config
1051-
ext_from_hex("0000000000900000000000000000640001000000000001ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff000100000000", &mut test);
1051+
ext_from_hex("000000000090000000000000000064000100000000000100ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff000100000000", &mut test);
10521052

10531053
// new outbound connection with id 0
10541054
ext_from_hex("00", &mut test);
@@ -1502,7 +1502,7 @@ fn gossip_exchange_seed() -> Vec<u8> {
15021502
// our network key
15031503
ext_from_hex("0100000000000000000000000000000000000000000000000000000000000000", &mut test);
15041504
// config
1505-
ext_from_hex("0000000000900000000000000000640001000000000001ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff000100000000", &mut test);
1505+
ext_from_hex("000000000090000000000000000064000100000000000100ffff0000000000000000ffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff000000ffffffff00ffff1a000400010000020400000000040200000a08ffffffffffffffff000100000000", &mut test);
15061506

15071507
// new outbound connection with id 0
15081508
ext_from_hex("00", &mut test);

lightning/src/ln/channel.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13837,14 +13837,9 @@ pub(super) fn get_initial_channel_type(
1383713837
// If they don't understand it (or we don't want it), we check the same conditions for
1383813838
// `option_anchors_zero_fee_htlc_tx`. The counterparty can still refuse the channel and we'll
1383913839
// try to fall back (all the way to `only_static_remotekey`).
13840-
#[cfg(not(test))]
13841-
let negotiate_zero_fee_commitments = false;
13842-
13843-
#[cfg(test)]
13844-
let negotiate_zero_fee_commitments =
13845-
config.channel_handshake_config.negotiate_anchor_zero_fee_commitments;
13846-
13847-
if negotiate_zero_fee_commitments && their_features.supports_anchor_zero_fee_commitments() {
13840+
if config.channel_handshake_config.negotiate_anchor_zero_fee_commitments
13841+
&& their_features.supports_anchor_zero_fee_commitments()
13842+
{
1384813843
ret.set_anchor_zero_fee_commitments_required();
1384913844
// `option_static_remote_key` is assumed by `option_zero_fee_commitments`.
1385013845
ret.clear_static_remote_key();

lightning/src/ln/channelmanager.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14925,7 +14925,6 @@ pub fn provided_init_features(config: &UserConfig) -> InitFeatures {
1492514925
#[cfg(any(test, fuzzing))]
1492614926
features.set_quiescence_optional();
1492714927

14928-
#[cfg(test)]
1492914928
if config.channel_handshake_config.negotiate_anchor_zero_fee_commitments {
1493014929
features.set_anchor_zero_fee_commitments_optional();
1493114930
}

lightning/src/util/config.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ pub struct ChannelHandshakeConfig {
219219
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
220220
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
221221
/// [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
222-
#[cfg(test)]
223222
pub negotiate_anchor_zero_fee_commitments: bool,
224223

225224
/// The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
@@ -251,7 +250,6 @@ impl Default for ChannelHandshakeConfig {
251250
commit_upfront_shutdown_pubkey: true,
252251
their_channel_reserve_proportional_millionths: 10_000,
253252
negotiate_anchors_zero_fee_htlc_tx: false,
254-
#[cfg(test)]
255253
negotiate_anchor_zero_fee_commitments: false,
256254
our_max_accepted_htlcs: 50,
257255
}
@@ -274,7 +272,6 @@ impl Readable for ChannelHandshakeConfig {
274272
commit_upfront_shutdown_pubkey: Readable::read(reader)?,
275273
their_channel_reserve_proportional_millionths: Readable::read(reader)?,
276274
negotiate_anchors_zero_fee_htlc_tx: Readable::read(reader)?,
277-
#[cfg(test)]
278275
negotiate_anchor_zero_fee_commitments: Readable::read(reader)?,
279276
our_max_accepted_htlcs: Readable::read(reader)?,
280277
})
@@ -446,16 +443,15 @@ pub enum MaxDustHTLCExposure {
446443
/// thus never experience dust exposure changes due to feerate shifts, resulting in no
447444
/// force-closes due to dust exposure limits), such channels will calculate their maximum
448445
/// dust exposure using a constant feerate of 250 sat/KW when using this variant.
446+
/// See [`ChannelHandshakeConfig::negotiate_anchor_zero_fee_commitments`] to enable such channels.
449447
///
450448
/// # Backwards Compatibility
451449
/// This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
452450
/// by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
453451
///
454452
/// [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
455453
/// [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate
456-
//
457-
// TODO: link ChannelHandshakeConfig::negotiate_anchor_zero_fee_commitment in zero fee
458-
// commitment doc once field is no longer behind cfg[test] flag.
454+
/// [`ChannelHandshakeConfig::negotiate_anchor_zero_fee_commitments`]: ChannelHandshakeConfig::negotiate_anchor_zero_fee_commitments
459455
FeeRateMultiplier(u64),
460456
}
461457

0 commit comments

Comments
 (0)