pay: Limit splitting when CLTV budget exhausted #8733
+108
−0
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 payment fails due to CLTV budget constraints, the adaptive splitter creates excessive sub-payments before hitting its lower amount limit. Issue #8167 showed partid reaching 5787+.
The fix adds a
cltv_budget_exceededflag and limits split depth to 3 when set.Depth 3 means:
This gives max 8 leaf payments exploring different amounts, which empirical testing showed is sufficient for getroute to find lower-constraint paths when they exist. The fix converts O(2^n) exponential to O(1) constant.
Depth counts only SPLIT operations, not retries. The
retry_pay_modalso creates child payments, but these are retries of the same amount, not splits. Without this distinction, retries would be incorrectly counted as depth, blocking legitimate splits prematurely.Fixes #8167