Repository navigation
Expose anchor per-channel reserve in node config - #322
Merged
benthecarman merged 1 commit intoOct 29, 2026
Merged
benthecarman merged 1 commit into
benthecarman merged 1 commit into
Conversation
|
I've assigned @benthecarman as a reviewer! |
benthecarman
requested changes
Oct 29, 2026
ldk-node defaults AnchorChannelsConfig::per_channel_reserve_sats to 25,000 sats, but ldk-server did not expose the setting. A node with no spendable on-chain balance therefore rejected every inbound anchor channel, including LSP-funded LSPS1 and LSPS2 channels, which blocks wallets designed to receive before depositing on-chain bitcoin. Add node.anchor_per_channel_reserve_sats, wired into ldk_node_config.anchor_channels_config.per_channel_reserve_sats, plus the matching --node-anchor-per-channel-reserve-sats CLI flag and LDK_SERVER_NODE_ANCHOR_PER_CHANNEL_RESERVE_SATS environment variable. Unset keeps the 25,000 sat default (AnchorChannelsConfig::default() per_channel_reserve_sats). Setting 0 accepts inbound anchor channels with no on-chain balance while leaving LDK's fee-bump handling enabled if funds arrive later. Document the security tradeoff: a zero or very low reserve can leave the node unable to fee-bump an urgent channel close until the on-chain wallet is funded. This is distinct from trusted_peers_no_reserve, which also makes LDK rely on the peer to confirm closing transactions. Note that trusted_peers_no_reserve is not currently configurable in LDK Server. The anchor reserve default test builds its TOML with lsps2_service_config_for_feature() so the feature-independent default is verified with and without experimental-lsps2-support. AI tools were used to help write this change and its tests.
frnandu
force-pushed
the
frnandu/expose-anchor-per-channel-reserve-in-node-config
branch
from
October 29, 2026 16:35
f0d14cb to
b9a0364
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #321.
Problem
ldk-nodedefaultsAnchorChannelsConfig::per_channel_reserve_satsto 25,000 sats, butldk-serverdid not expose that field. A node with no spendable on-chain balance therefore rejected every inbound anchor channel, including an LSP-funded one:This blocks an initial LSPS1 channel purchase or LSPS2 JIT channel for wallets designed to receive before depositing on-chain bitcoin.
Change
node.anchor_per_channel_reserve_sats(TOML),--node-anchor-per-channel-reserve-sats(CLI) andLDK_SERVER_NODE_ANCHOR_PER_CHANNEL_RESERVE_SATS(env).ldk_node_config.anchor_channels_config.per_channel_reserve_sats.0permits inbound anchor channels with zero on-chain balance while leaving LDK's fee-bump handling enabled if funds become available later.Security note
A zero or very low reserve raises risk if a channel needs an urgent close while the wallet has no on-chain funds: the node may be unable to increase the closing transaction fee until the on-chain wallet is funded. This is documented in
docs/configuration.mdwith an explicit warning, and in the annotated config template.This is distinct from
trusted_peers_no_reserve, which additionally tells LDK to rely on the peer to confirm channel-closing transactions, and fromenable_zero_fee_commitments.Tests
test_accepts_anchor_per_channel_reserve_argcovers CLI parsing (0and non-zero).test_anchor_per_channel_reserve_defaults_to_25k_satscovers the 25,000 sat default when unset.cargo test -p ldk-serverpasses (141 tests), andcargo fmt --all/cargo fmt --manifest-path e2e-tests/Cargo.toml --allwere run.AI tools were used to help write this change and its tests.