Skip to content

Add unannounced_channel_max_inbound_htlc_value_in_flight_percentage#4529

Open
tankyleo wants to merge 1 commit intolightningdevkit:mainfrom
tankyleo:2026-04-add-max-inflight-knob-for-unannounced-channels
Open

Add unannounced_channel_max_inbound_htlc_value_in_flight_percentage#4529
tankyleo wants to merge 1 commit intolightningdevkit:mainfrom
tankyleo:2026-04-add-max-inflight-knob-for-unannounced-channels

Conversation

@tankyleo
Copy link
Copy Markdown
Contributor

@tankyleo tankyleo commented Apr 1, 2026

    Add `unannounced_channel_max_inbound_htlc_value_in_flight_percentage`

    Users can now configure two different max percentages for the channel
    value that can be allocated to inbound HTLCs, one for announced
    channels, and another for unannounced channels.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 1, 2026

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

@tankyleo tankyleo requested a review from TheBlueMatt April 1, 2026 06:37
@ldk-claude-review-bot
Copy link
Copy Markdown
Collaborator

ldk-claude-review-bot commented Apr 1, 2026

Review Summary

No new issues found. All three issues from the previous review have been addressed:

  1. Deserialization backwards-compatibility regression — Fixed. Both read and write paths now use get_legacy_default_holder_max_htlc_value_in_flight_msat() which hardcodes MAX_IN_FLIGHT_PERCENT_LEGACY.

  2. Missing unit test for announced channel path — Fixed. test_configured_holder_max_htlc_value_in_flight now calls do_test_configured_holder_max_htlc_value_in_flight(true) and do_test_configured_holder_max_htlc_value_in_flight(false).

  3. Doc nit — Was retracted; the doc correctly says "Default value: 10".

Cross-cutting Note

The default in-flight percentage for unannounced channels changes from 10% to 25%. Since announce_for_forwarding defaults to false, and create_unannounced_chan_between_nodes_with_value() doesn't pin the in-flight percentage, many existing tests (~30+ across offers_tests.rs, priv_short_conf_tests.rs, interception_tests.rs, onion_route_tests.rs) will silently see their unannounced channel in-flight limits increase from 10% to 25%. This appears intentional and is unlikely to cause test failures, but the often_offline_node_cfg() function in async_payments_tests.rs demonstrates good practice by explicitly pinning the old default for tests that depend on specific capacity behavior.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 93.15068% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.01%. Comparing base (450c03a) to head (3644da0).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/util/config.rs 66.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4529      +/-   ##
==========================================
- Coverage   87.10%   87.01%   -0.10%     
==========================================
  Files         163      163              
  Lines      108740   108792      +52     
  Branches   108740   108792      +52     
==========================================
- Hits        94723    94669      -54     
- Misses      11531    11626      +95     
- Partials     2486     2497      +11     
Flag Coverage Δ
fuzzing 39.37% <60.00%> (-0.83%) ⬇️
tests 86.20% <95.65%> (-0.01%) ⬇️

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.

@tankyleo tankyleo force-pushed the 2026-04-add-max-inflight-knob-for-unannounced-channels branch from 24ba2e5 to 887ca41 Compare April 1, 2026 08:22
Users can now configure two different max percentages for the channel
value that can be allocated to inbound HTLCs, one for announced
channels, and another for unannounced channels.
@tankyleo tankyleo force-pushed the 2026-04-add-max-inflight-knob-for-unannounced-channels branch from 887ca41 to 3644da0 Compare April 1, 2026 08:40
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.

3 participants