tests: xpay issue and fixes#8972
Conversation
|
This also happens with This is a direct pay from l1 to l2 with an "any" offer aswell and a fetched invoice for 10000msat. Notice how both |
|
Weird. Some line above in the same test there is a BOLT11 test payment to a direct peer with no weird fees. Could it be the blinded path adding this fee? |
|
Very possible, look at the path from the other error i sometimes get above: |
|
I am able to reproduce the flaky test locally I am looking into it. It looks like some memory un-initialized in the bolt12 decoded structure. |
|
OK, so l2 gives a blinded path to l1, which starts with l1. l1 should realize that and not charge itself fees, but doesn't. Diagnosing now. |
|
Ah, this is cool! So, xpay specifies layers like so:
This means we don't set zero fees on the blinded path, since we apply layers in order (as documented). More interestingly, if you "fix" this, the payment fails: pyln.client.lightning.RpcError: RPC call failed: method: xpay, payload: {'invstring': 'lni1qqgpydqs7v2tvcagxe3hjfdmpmtp6q3qqc3xu3s3rg94nj40zfsy866mhu5vxne6tcej5878k2mneuvgjy83pmsrsx2ttuetmu92txqjepkyaaad9u55zp86qf734n5mg6dmd7yv7das9gyzx6nru5rnk63r2rytcajmhh6pj3hjxjzgw8zpx528wr4zulj8qgpry78qzse0fsxqyqt2cny0rk62ec88w8k2tvvn2hlu0s0gcf83mqgqxdv3zcmg9964yw30648fqaea7q2pr9u9h5zuc4jkqny9hzp6rn84tgvavct76pjlz7pulcx6gfecut7kyncsynjqf8eza33dhgzcfvcq2hhn4z38vmwamep7r2kv3ttq7fu5wzysqqe24akse2k5hndly934he0mvz6tyty904ujayfznh8yt05xk6rf706qagd4y7kfw8pl56wze3trz80685zpvggr8pzcqtf9kns8fn8a0nvtxwdyrhr4h7vh3gp5sqzyfdgag2c80xd9qgqxyfhyvyg6pdvu4tcjvpp7kkal9rp57wj7xv4pl3ajku70rzy3pafqyfcs2sq9sggrjrya2te7jnnnhrqjrpxjrzk76028y9fheacmxp4q9ps46kc00wq2plgql5pcr9947v4a7z49nqfvsmzw77kj722pqnaqylg6e6d5dxaklzx0x7cz49fmkr3eq50zhln30j7h5p49ajp09annwk66kt6dj0mjgml4lresyqem4qcvxj7dakxxynvcz8sf0w0pvqn0zsadum84u9qqdad7ke9ylsqyy5g8stg6yw6ljl9rgaj0meu4nq8nm2eak6dm4gnp03ykes2jq0fhcjw3ts237072hqstrsr0mhkttrr5nm3pnr5tvejxr92hwpcmamj5lksr83ytznav5pwp6dfym5jqg475rq4rvx374t7yncgstan8zukhhzrsqvh95sal4n8vg9gfeur0cjf8wcsh63lmsrjdflp3fc5nnnv6xpttnf0jawdrp6zzmzcj6wdpg8xchvz8yrazrsqqqqqpqqqqqzsqpvqqqqqqqqqqqqqqqqqqqwjcqqqqqq9yq35uk8g64qszza9777w4ua0pgtc6zjkgeqa4gvshfuf8k82434d05lr2kdx05592qgn3ptsrqgqqpvppqvuytqpdyk6wqaxvl47d3vee5swuwklej79qxjqqg394r4ptqaue4uzqj4p9mp3xku9a7dw4gwej0ah75et3mfwgn585qhx5knp7005ty6wp9wedpw43lell4svkhckxqd6hpvs48k2myjq2cp624226g5yaj4s'}, error: {'code': 209, 'message': "Failed after 1 attempts. Unexpected error (invalid_onion_blinding) from final node: disabling the invoice's blinded path (0x0x0/1) for this payment. Then routing failed: We could not find a usable set of paths. The destination has disabled 1 of 1 channels, leaving capacity only 0msat of 1515000msat."} This is because, to avoid probing, the (encrypted) inside of the blinded path insists that the fee be paid, for important obfuscation reasons. In summary, this is weird behavior, but we shouldn't fix it. If we override this check for local payments, it would allow any user of the node (who may not be privileged with the ability to use the node keys to decrypt the onion) to probe the next hop in this case. |
|
Oh, and the reason this changed? We use blinded paths for the case where our node doesn't advertize addresses: since l2's addresses are all localhost, they don't get advertized. So it uses an incoming node, and that's l1. This can be fixed by using |
This is, fascinatingly, a different bug! I've got a reproduce for exactly this, and as you suggested, I fixed decode to print it. I'll get to the bottom of this too... |
|
@daywalker90, @rustyrussell: false alarm this is not an issue it was just missing liquidity and expected behavior (see #9009). |
f6ac3ae to
933010c
Compare
|
Your diagnosis is correct, but it should always choose l1 (which has incoming capacity) not l3 (which does not). It is a corner case, though. The final commit here fixes this. |
…n a direct route Changelog-None
Since v25.02 we have opted to create blinded paths if we don't, ourselves, have an advertized address. In our tests, we don't. So, we get unreliable results. The blinded path entry point l2 chooses might be l1, or might be l3. If it chooses l1, we get an additional fee (which, even though we're the origin, we have to pay as blinded path fees a compulsory!). If it chooses l3, we hit a different bug: see next patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Weird we didn't print this before! Reported-by: https://github.com/Lagrang3 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
It depends on gossip_store order, so it's not reliable. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…nown other channels. "htlc_max" reflects the max for a single HTLC, *capped by* the spendable capacity of the peer. "capacity" here means the total of known incoming channels to the peer. We should not consider channels which cannot pay us! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
listincoming is our (undocumented) internal command for getting more information about neighbors for routehints and blinded paths. These should not list unannounced nodes, as they may not have public channels. (Also use gossmap_chan_set instead of testing cupdate_off directly). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
933010c to
bb7b31b
Compare
I noticed this in one of my plugin's tests.
This is also quite flaky on my local tests with this result instead:
pyln.client.lightning.RpcError: RPC call failed: method: xpay, payload: {'invstring': '<removed>'}, error: {'code': 205, 'message': 'Failed: We could not find a usable set of paths. The shortest path is 103x1x0->103x2x0->0x0x0, but 0x0x0/1 exceeds htlc_maximum_msat ~0msat'}