Repository navigation
Keep the default routing fee limit if none is given - #1221
Merged
tnull merged 1 commit intoNov 10, 2026
Merged
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
tnull
reviewed
Nov 10, 2026
tnull
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! Looks good, but let's drop the tests as we don't need to cover that simple of behavior (and the tests can't assert uniformity of behavior anyways)
ajaysehwal
force-pushed
the
fix-default-routing-fee-limit
branch
from
November 10, 2026 09:49
ec3a909 to
1517049
Compare
tnull
approved these changes
Nov 10, 2026
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.
The docs for
route_parameterssay the given values override the defaults per field.max_total_routing_fee_msatis anOptionwhereNonemeans "use the default" (1% of the amount plus 50 sats). LDK honors this for BOLT11 and BOLT12 payments, but spontaneous payments and BOLT11 probes copied the field unconditionally. Passing route parameters without a fee limit therefore replaced the default withNone, meaning no limit at all. This was found vialdk-server, whose CLI always sends route parameters forspontaneous-send(lightningdevkit/ldk-server#326).This moves the logic into one helper that only overrides the fee limit when the config sets one, and uses it in
SpontaneousPayment::send_inner,Bolt11Payment::send_probesandsend_probes_using_amount. Other fields are applied as before, and an explicit limit, including 0, still overrides the default.Notes:
send_payment_for_static_invoiceassigns the fee limit unconditionally, so that needs an LDK fix.Config::route_parametersuses the same helper, so a config without a fee limit now keeps the default too.Tests: new unit tests in
config.rscover the unset case (the default is kept and the other fields are applied) and explicit limits (0, 1,234,u64::MAX). The first test fails on the old behavior.cargo test --libpasses, and I didn't run the integration tests.