Askrene and xpay improve - #9150
Conversation
|
Overall I like the improvements introduced in this PR. In this way we delegate the interpretation to the moment when we call getroutes: |
9b3f051 to
7bddd3b
Compare
|
bec4e38 to
e65c114
Compare
|
| &scidd, ×tamp, &msat)) { | ||
| /* We don't convert, just omit these */ | ||
| if (!convert_impression) | ||
| copy_data(&out, data_in, olddata - data_in); |
There was a problem hiding this comment.
Is this correct? Why is olddata >= data_in?
I thought wire's cursors moved to greater values after reading.
|
On one commit comment: Ordering is awesome! Besides the fact that impressions being relative do care about order, it can also be argued that "pure constraints" should also because older constraints are less reliable than the more recent. |
f3836ff to
386e3a6
Compare
|
386e3a6 to
f9df6f5
Compare
|
4a0e9e5 to
9083938
Compare
with
|
9083938 to
fe5fb13
Compare
|
84b7e43 to
202f985
Compare
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Pure "constraints" don't care about order (they simply clamp max and min), but "impressions" are relative, so they do. Change the hashtable to keep them timestamp sorted. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
from a tal array. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
On deletion of individual channel intel entries we need to free the pointer inside the structure. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Use a single realloc to remove old entries. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
on trim_constraints: to be sure we don't miss elements we add to the hash table after the loop and not during iteration. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
It diagnoses if the *total capacity* of the source/dest are insufficient, but not if the *known capacity* is. So we get: The shortest path is 103x1x0->105x1x0, but 103x1x0/1 layer auto.localchans says max is 77704899msat Whereas it would be better to do: We know from auto.localchans that source has maximum capacity xxx msat (in 1 channels) Similarly for the destination, we get: The shortest path is 103x1x0->105x1x0, but 103x1x0/1 layer auto.localchans says max is 77704899msat
Add PAY_INSUFFICIENT_FUNDS and PAY_ROUTE_NOT_FOUND, and give nice detailed errors for those. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSON-RPC: `getroutes` can now return PAY_INSUFFICIENT_FUNDS (215) and PAY_DESTINATION_INSUFFICIENT_CAPACITY (220) error codes.
Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Consider the case in which payment fails due to not enough "known enabled" liquidity. Notice that we cover the "known" and "enabled" cases already. But: known_enabled <= enabled and known_enabled <= known Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
…rrencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ersion. This mirrors the previous commit, where we did it for recurring offers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: Offers: we set a 10 minute expiry when we create invoices for offers in other currencies.
We don't actually need to enforce this check here: we can make that the users' responsibility. This simplifies our work quite a lot, since createinvoicerequest won't have to do a lookup any more. This can be done by the repeatpay plugin itself. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is an undocumented interface, so we can just change it. Rename "recurrence_label" to the more general "label", now we don't require it to find previous payments. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
41fcb51 to
22d100d
Compare
I can't reproduce the change in the doc examples that CI generated in the previous run. It must be a flake. |
Fix test_explain_source_dest_failure by increasing the amounts by a
factor of ten, which reduces the relative significance of on-chain fees
on the commitment transaction.
This used to fail on liquid-regtest due to insufficient liquidity on
l2->l4 to prevent channel starvation.
At line
```
l1.rpc.xpay(l4.rpc.invoice('30000sat', 'test_explain_simple_failures2', 'test_explain_simple_failures2')['bolt11'])
```
we would get
```
lightningd-2 2026-07-06T11:29:09.973Z DEBUG 02287bfac8b99b35477ebe9334eede1e32b189e24644eb701c079614712331cec0-channeld-chan#3: Adding HTLC would leave us only 19454000msat: we need 25281sat for another HTLC if fees increase from 7500perkw to 13906perkw
lightningd-2 2026-07-06T11:29:09.973Z DEBUG 02287bfac8b99b35477ebe9334eede1e32b189e24644eb701c079614712331cec0-channeld-chan#3: Adding HTLC 0 amount=30000000msat cltv=130 gave CHANNEL_ERR_CHANNEL_CAPACITY_EXCEEDED
```
Changelog-None
Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
22d100d to
3a3af52
Compare
|
Re-reviewed at 3a3af52. Everything from my July round is addressed: the Nothing below blocks merge. Filing the first two as follow-up issues. The rest are cosmetic and can be swept whenever. |
|
|
|
|
|
Some cosmetic fixes to be done when you feel like...
|
Depends on #9138
This prepwork for repeatpay improves askrene and xpay: