From aaf2aef59c7cab274292768ad1ec1bffde0ca4bc Mon Sep 17 00:00:00 2001 From: Hermes Alby Date: Fri, 24 Apr 2026 08:38:05 +0000 Subject: [PATCH 1/2] fix: raise inbound channel size limit --- src/config.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 5ed1d1e12..49b18d74d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,6 +28,7 @@ const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30; const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS: u64 = 60 * 10; const DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER: u64 = 3; const DEFAULT_ANCHOR_PER_CHANNEL_RESERVE_SATS: u64 = 25_000; +const DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS: u64 = 10 * 100_000_000; /// The default log level. pub const DEFAULT_LOG_LEVEL: LogLevel = LogLevel::Debug; @@ -329,6 +330,8 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig { // some of the values set here, e.g. the ChannelHandshakeConfig, meaning these default values // will mostly be relevant for inbound channels. let mut user_config = UserConfig::default(); + user_config.channel_handshake_limits.max_funding_satoshis = + DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS; user_config.channel_handshake_limits.force_announced_channel_preference = false; user_config.manually_accept_inbound_channels = true; user_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = @@ -565,7 +568,21 @@ pub enum AsyncPaymentsRole { mod tests { use std::str::FromStr; - use super::{may_announce_channel, AnnounceError, Config, NodeAlias, SocketAddress}; + use super::{ + default_user_config, may_announce_channel, AnnounceError, Config, NodeAlias, SocketAddress, + DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS, + }; + + #[test] + fn default_user_config_allows_10_btc_inbound_channels() { + let node_config = Config::default(); + let user_config = default_user_config(&node_config); + + assert_eq!( + user_config.channel_handshake_limits.max_funding_satoshis, + DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS + ); + } #[test] fn node_announce_channel() { From 9159addc1296e6689143d18ae5529f636a32f8c2 Mon Sep 17 00:00:00 2001 From: Hermes Alby Date: Fri, 24 Apr 2026 08:44:42 +0000 Subject: [PATCH 2/2] docs: explain Alby inbound channel limit --- src/config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config.rs b/src/config.rs index 49b18d74d..ea7ad18eb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,6 +28,8 @@ const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30; const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS: u64 = 60 * 10; const DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER: u64 = 3; const DEFAULT_ANCHOR_PER_CHANNEL_RESERVE_SATS: u64 = 25_000; +// Alby: our project is well-tested and requires larger inbound channels, +// especially for business users. const DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS: u64 = 10 * 100_000_000; /// The default log level. @@ -330,6 +332,8 @@ pub(crate) fn default_user_config(config: &Config) -> UserConfig { // some of the values set here, e.g. the ChannelHandshakeConfig, meaning these default values // will mostly be relevant for inbound channels. let mut user_config = UserConfig::default(); + // Alby: override LDK's default inbound channel limit to allow larger + // channels needed by well-tested deployments and business users. user_config.channel_handshake_limits.max_funding_satoshis = DEFAULT_MAX_INBOUND_CHANNEL_SIZE_SATS; user_config.channel_handshake_limits.force_announced_channel_preference = false;