Skip to content

Prioritize private channels when relaying payments#3248

Merged
t-bast merged 1 commit intomasterfrom
relay-prioritize-private-channels
Feb 11, 2026
Merged

Prioritize private channels when relaying payments#3248
t-bast merged 1 commit intomasterfrom
relay-prioritize-private-channels

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Feb 10, 2026

When relaying payments, we want to select private channels first and keep as much liquidity available as possible in public channels, to ensure that we don't send a channel_update that would otherwise disable the public channel (and thus make the private channels also unusable since they aren't visible by path-finding algorithms) or limit the htlc_maximum_msat of this public channel (which also indirectly applies to private channels).

@t-bast t-bast requested a review from pm47 February 10, 2026 13:25
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.36%. Comparing base (f93d02f) to head (23381fa).
⚠️ Report is 78 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3248      +/-   ##
==========================================
+ Coverage   86.43%   88.36%   +1.93%     
==========================================
  Files         242      218      -24     
  Lines       22607    20575    -2032     
  Branches      832      827       -5     
==========================================
- Hits        19541    18182    -1359     
+ Misses       3066     2393     -673     
Files with missing lines Coverage Δ
...a/fr/acinq/eclair/payment/relay/ChannelRelay.scala 95.18% <100.00%> (-1.45%) ⬇️

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@t-bast t-bast force-pushed the relay-prioritize-private-channels branch from 1498c6e to 6abf54d Compare February 10, 2026 17:53
@t-bast t-bast force-pushed the relay-prioritize-private-channels branch from 6abf54d to 654be15 Compare February 11, 2026 08:44
When relaying payments, we want to select private channels first and
keep as much liquidity available as possible in public channels, to
ensure that we don't send a `channel_update` that would otherwise
disable the public channel (and thus make the private channels also
unusable since they aren't visible by path-finding algorithms) or
limit the `htlc_maximum_msat` of this public channel (which also
indirectly applies to private channels).

We also change the order in which we select channels that have the
same visibility: we prioritize channels with smaller balances, to
ensure that we keep our larger balances for larger payments. When
balances are equal, we prioritize the largest channel, which creates
a larger inbound liquidity to allow receiving larger payments.
@t-bast t-bast force-pushed the relay-prioritize-private-channels branch from 654be15 to a070fdb Compare February 11, 2026 10:02
@t-bast t-bast merged commit aff16b2 into master Feb 11, 2026
1 check passed
@t-bast t-bast deleted the relay-prioritize-private-channels branch February 11, 2026 10:21
@CoderBoogs
Copy link

Question: Is this only between private payments between 2 acinq peers to go straight between them.

Or for the broader Ln network?

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.

4 participants