Repository navigation
Flag peers that leave liquidity fees unpaid - #3416
Merged
Merged
Conversation
When signing a liquidity purchase paid with from_future_htlc, we now flag our peer as suspicious if some of its fees cannot be collected from its pending payments, as we already do when funded HTLCs are failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Underpaid liquidity purchases are now tracked by funding txid instead of payment hash, and are only cleared by the node operator (using enableFromFutureHtlc) or when restarting. Failed relays are still keyed by payment hash. Both count towards max-suspicious-peers, and each is reported in its own metric. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
When a liquidity purchase is aborted before its funding transaction is published, we haven't lost any fees: we now remove the corresponding underpaid entry, and fail the upstream HTLCs of its funded payments. We handle this event regardless of our connection state, since it is sent asynchronously by the channel. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sstone
approved these changes
Oct 27, 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.
When a peer buys liquidity using
from_future_htlc, we take the risk of not being paid, and rely on our suspicious peers mechanism (max-suspicious-peers) to bound that risk. But a peer could withdraw the payments that should pay the fees before the purchase is signed (withwill_fail_htlc, by letting the proposal time out, or by disconnecting): we then signed the funding transaction without recording any fee debt, and the peer was never flagged, so it could repeat this indefinitely.This PR:
from_future_htlcpurchase leaves some of its fees unpaidenableFromFutureHtlc) or on restartReported-by: @erickcestari