Conversation
pm47
reviewed
Sep 11, 2026
|
|
||
| private fun badRequest(message: String): Nothing = throw BadRequestException(message) | ||
|
|
||
| private suspend fun payInvoice(amount: MilliSatoshi, invoice: Bolt11Invoice, trampolineFeesOverride: TrampolineFees?): SendPaymentResult { |
Member
There was a problem hiding this comment.
This needs to be done in lightning-kmp.
Author
There was a problem hiding this comment.
Fixed. The manual PayInvoice / PayOffer send/wait flow has been removed from phoenixd. This now uses the high-level lightning-kmp APIs added in ACINQ/lightning-kmp#875.
Author
|
Updated this PR based on the review feedback. Main changes:
Verification:
|
ca-ruz
force-pushed
the
add-trampoline-fee-override
branch
from
September 15, 2026 21:26
aea88cb to
abf4a6b
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.
Summary
This PR adds optional trampoline fee override parameters for outgoing Lightning payments.
The following endpoints now accept:
trampolineFeeBaseSattrampolineFeeProportionaltrampolineFeeCltvExpiryDeltaSupported endpoints:
/payinvoice/payoffer/paylnaddress/lnurlpayphoenix-clialso exposes matching flags for the same commands.When these parameters are absent, behavior is unchanged and phoenixd uses its default configured trampoline fee.
Context
This came out of investigating Ambrosia PoS using phoenixd as its Lightning backend.
In the observed failures, Ambrosia submitted outgoing payments to phoenixd, phoenixd accepted the payment attempt, sent an HTLC through its trampoline/LSP peer, and then received a downstream failure. One plausible failure mode is that the trampoline node may require a higher fee or CLTV delta than phoenixd’s default single trampoline fee tier.
lightning-kmp already supports
trampolineFeesOverrideon outgoing payment commands. Phoenix mobile also has a similar concept where the send flow can pass a selectedTrampolineFeesvalue. phoenixd did not expose that capability through its HTTP API or CLI.This PR exposes that existing lower-level capability so clients can opt into a higher trampoline fee policy when appropriate, without changing phoenixd’s default fee behavior for all users.
Note: this PR depends on ACINQ/lightning-kmp#875, which exposes trampoline fee overrides in the high-level
Peer.payInvoice(...)andPeer.payOffer(...)APIs.Compatibility
This is intended to be backward-compatible:
Notes
The override is intentionally per request. This avoids silently increasing fees globally and lets clients decide when a higher trampoline fee is acceptable for their own UX or retry policy.
The CLTV override is optional. If only
trampolineFeeBaseSatandtrampolineFeeProportionalare provided, phoenixd keeps the default trampoline CLTV expiry delta.Tests
Added tests for:
Tested with:
./gradlew jvmTest --tests "fr.acinq.phoenixd.TrampolineFeesOverrideTestsCommon" ./gradlew jvmTest