Skip to content

fix: let unannounced channels take full-size payments - #120

Draft
ovitrif wants to merge 2 commits into
mainfrom
fix/inbound-htlc-in-flight-unannounced
Draft

ovitrif wants to merge 2 commits into
mainfrom
fix/inbound-htlc-in-flight-unannounced

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Refs:

Description

  • Sets the maximum inbound HTLC value in flight to 100% of the channel value for nodes that cannot announce channels (no node alias or no listening addresses), so a single incoming payment can use the whole channel instead of 10% of it. Such a node only accepts unannounced channels, and ldk-node already sets 100% for the unannounced channels it opens itself.
  • The limit is part of the channel handshake, so channels opened before this change keep their 10% limit; only new channels benefit.
  • Adds inbound_htlc_in_flight_limit_for_unannounced_node: opens a 1,000,000 sat channel to a node without an alias, pays it 9% (works with and without the change) and 20% of the channel value (fails with PaymentSendingFailed without the change).
  • Upstream rust-lightning makes 100% the default for unannounced channels (2867d5c1a, in the 0.3 pre-releases); the fork is on LDK 0.2.0, where it is still 10%.
  • The changelog line goes into the release PR, per the fork's single-section CHANGELOG rule.

Out of Scope

  • src/builder.rs, src/event.rs: the LSPS2 paths keep their own 100% override.
  • Nodes that can announce keep LDK's default for every inbound channel, unannounced ones included; no config option is added.
  • Existing channels: the limit is fixed at channel open, so they stay at 10%.
  • Version bump and release: separate release PR, followed by the bump PRs in the Bitkit apps.
  • Newer LDK defaults 100% for unannounced channels (unannounced_channel_max_inbound_htlc_value_in_flight_percentage); when the fork moves to an LDK release with that option, this override can be removed.

QA Notes

Automated Checks

  • added inbound_htlc_in_flight_limit_for_unannounced_node in tests/integration_tests_rust.rs: failed on main (a payment above 10% of the channel value must be routable: PaymentSendingFailed), passes with the change.
  • ran lsps2_client_service_integration, lsps2_client_trusts_lsp, lsps2_lsp_trusts_client_but_client_does_not_claim, multi_hop_sending: pass.
  • channel_full_cycle_electrum did not finish locally: it stops at the splice step on main as well as with the change. CI here is manual (rust.yml runs on workflow_dispatch); I dispatched it on this branch (https://github.com/synonymdev/ldk-node/actions/runs/36661558748): the ubuntu stable build fails on warnings that main has too, and fail-fast cancelled the rest, so the full suite has not run yet. It is the readiness gate once main builds on stable.

Manual Tests

  • Bitkit Android master (2.5.0) on a regtest LND channel of 1,000,000 sats, with a libldk_node built from 0.7.0-rc.66 plus this one-line change swapped in: the channel is accepted with max_htlc_value_in_flight_msat: 1000000000 (was 100000000), and single payments of 110,000 sats (11%) and 500,000 sats (50%) succeed with "Received Instant Bitcoin". Without the change the 11% payment fails.

…alue

A node that cannot announce channels only accepts unannounced ones, so LDK's default of 10% of the channel value as maximum inbound HTLC value in flight capped every single incoming payment far below the inbound capacity. Set it to 100% for such nodes, as already done for unannounced channels we open ourselves.

The integration test opens a channel to a node without a node alias and pays it 9% and 20% of the channel value; the second payment fails without the change.
@ovitrif ovitrif changed the title fix: accept incoming payments above 10% of an unannounced channel's value fix: let unannounced channels take full-size payments Sep 30, 2026
@ovitrif

ovitrif commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 555d5db: dropped the changelog entry from this PR; the release PR adds it in the fork's single section. Dispatched the Rust CI on this branch: https://github.com/synonymdev/ldk-node/actions/runs/36661558748

@ovitrif

ovitrif commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator Author

The Rust CI run on this branch (https://github.com/synonymdev/ldk-node/actions/runs/36661558748) failed in "build (ubuntu-latest, stable)", and fail-fast cancelled the other jobs. The failure is on main too (26664614): with --features uniffi and -D warnings, rustc 1.98.1 rejects four unused imports in src/ffi/types.rs (lines 45, 48-50, 54, 63) and the deprecated bitcoin::FeeRate::from_sat_per_vb_unchecked used by the constructor at bindings/ldk_node.udl:416. This PR touches neither. The same build passes on 1.85.0 and on beta, so the test steps never ran; they need a run once main builds on stable.

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.

1 participant