spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.24k stars 3.01k forks source link

Lightning payment fails after 25+ attempts #7987

Open PanosChtz opened 1 year ago

PanosChtz commented 1 year ago

I have been using lightning payments for the last few months quite often, but now all of my payments seem to fail all the time. After providing the deposit request, the payment does not go through and I get an error window "Payment failed Giving up after 25 (or sometimes more) attempts". In the lightning network I am connected to 4 peers, 15K nodes and 83K channels. I also tried trampoline routing with the same results.

ecdsa commented 1 year ago

which trampoline(s) are you connected to? can you provide a log?

PanosChtz commented 1 year ago

The Node alias says "Electrum trampoline". Also when I right click on the failed payment in the "send queue", I get a table with columns "Hops", "Channel ID" and "Message". In all table rows, the hops are 4, and the message is TEMPORARY_CHANNEL_FAILURE.

ecdsa commented 1 year ago

the information you are giving is not sufficient. please enable logs, and share one, if you want someone to investigate

AlistairTB commented 10 months ago

Having the same issue for a couple months. Log attached. Thank you in advance!

LN.log

SomberNight commented 10 months ago

@AlistairTB

50 mBTC is a lot for a single HTLC -- and for it to succeed, all channels in the path need to have sufficient liquidity.

AlistairTB commented 10 months ago

New log attached.

LN.log electrum445android.png

SomberNight commented 10 months ago

@AlistairTB Does the receiver have enough incoming capacity to be able to receive on its channel?

AlistairTB commented 10 months ago

Yes.

LN Channel Capacity Info.jpg

AlistairTB commented 10 months ago

Is there anything else I can provide to help troubleshoot? Is there sufficient evidence of a problem to warrant reopening this issue?

Thanks.

SomberNight commented 10 months ago

Well the logs look interesting. I can see that the MPP logic is not smart enough in your case, but that still does not explain what is going on. It seems hard to believe that there is no path to carry 5 mbtc between walletofsatoshi and ACINQ.

Could you perhaps try with increasingly smaller and smaller amounts, to see if you can get any money through at all?

AlistairTB commented 10 months ago

Ok. I tried sending .00005 and it worked! 00005.log

Then I up'd it to .0005 and it worked! 0005.log

Then I up'd it again to .005 and it got stuck after 3 retries, so I quit (and unfortunately deleted the log file), and retried the TX...

and now it looks like the TX is pending (?) and the channel is "disconnected", and apparently stuck.

005-disconnected.log

I guess the new question is how to reconnect the channel?

Screenshot from 2023-08-10 08-32-25

SomberNight commented 10 months ago

I guess the new question is how to reconnect the channel?

I think their node (walletofsatoshi) is offline atm.

AlistairTB commented 10 months ago

Update... Payment failed and the channel is now Open.

So I guess this really is a liquidity problem. I will test further by sending as many .0005 as I can stand until either the middlemen can't keep up, or my channel is full again.

AlistairTB commented 10 months ago

If you concur, feel free to close this ticket again and sorry for the distraction.

AlistairTB commented 10 months ago

Awhile ago, I was troubleshooting a different payment failure with bitrefill and they were trying to look at the payment paths and I was unable to give them the right node IDs to follow - they didn't like or couldn't see what my electrum wallet was telling me as far as "remote node" and/or "channel id"... Does Electrum wallet use a hidden or obfuscated LN node for my channels? And if so, what would be the remote node ID I could give that second or third party to dig deeper on my part? I will use this info to try and identify higher payment amount failures with WoS and/or ACINQ now.

Thanks

SomberNight commented 10 months ago

So I guess this really is a liquidity problem. If you concur, feel free to close this ticket again and sorry for the distraction.

At the very least we should improve the MPP sending logic for the non-trampoline case, so let's keep it open for now.

But there really is a liquidity issue. I now have a channel with walletofsatoshi and another with ACINQ and seeing the same thing when sending between them. In fact I have channels with other nodes and in general having a hard time sending "to ACINQ". @ecdsa is says "ACINQ is a sink" in the graph and eats up all the liquidity. I also have a channel with the "Electrum trampoline" which we run and it has fat direct channels with ACINQ -- via that node I can pay successfully.

Does Electrum wallet use a hidden or obfuscated LN node for my channels?

The channels Electrum opens are unannounced ("private channels"), so they cannot be found in LN explorers/etc (they are not in the gossip). In the log, when sending an htlc, this applies to "edge 0" -- the first edge in the path is your own channel, which cannot be found in the public graph. The last edge is often unannounce/private too -- like in your case here, as that too was opened by an electrum client.

20230808T215227.083397Z |     INFO | lnpeer.Peer.[LNWallet, 035e4ff418-513a0c5a] | lnpeer.pay len(route)=4
20230808T215227.083528Z |     INFO | lnpeer.Peer.[LNWallet, 035e4ff418-513a0c5a] |   0: edge=772945x757x1 hop_data=<OnionHopsDataSingle. is_tlv_payload=True. payload={'amt_to_forward': {'amt_to_forward': 500052500}, 'outgoing_cltv_value': {'outgoing_cltv_value': 802605}, 'short_channel_id': {'short_channel_id': <ShortID: 788072x1925x1>}}. hmac=None>
20230808T215227.083621Z |     INFO | lnpeer.Peer.[LNWallet, 035e4ff418-513a0c5a] |   1: edge=788072x1925x1 hop_data=<OnionHopsDataSingle. is_tlv_payload=True. payload={'amt_to_forward': {'amt_to_forward': 500051000}, 'outgoing_cltv_value': {'outgoing_cltv_value': 802565}, 'short_channel_id': {'short_channel_id': <ShortID: 788080x1537x1>}}. hmac=None>
20230808T215227.083719Z |     INFO | lnpeer.Peer.[LNWallet, 035e4ff418-513a0c5a] |   2: edge=788080x1537x1 hop_data=<OnionHopsDataSingle. is_tlv_payload=True. payload={'amt_to_forward': {'amt_to_forward': 500000000}, 'outgoing_cltv_value': {'outgoing_cltv_value': 802421}, 'short_channel_id': {'short_channel_id': <ShortID: 772875x567x2>}}. hmac=None>
20230808T215227.083805Z |     INFO | lnpeer.Peer.[LNWallet, 035e4ff418-513a0c5a] |   3: edge=772875x567x2 hop_data=<OnionHopsDataSingle. is_tlv_payload=True. payload={'amt_to_forward': {'amt_to_forward': 500000000}, 'outgoing_cltv_value': {'outgoing_cltv_value': 802421}, 'payment_data': {'payment_secret': b'\xe7D\xe3\x046\x03\xc7[\x95\x1cp\xec\x14\x0f\x15[.\x1dN\xd35\xd2\x11\x13\xd9\x92\x9b\xdbM:\x8eA', 'total_msat': 500000000, 'amount_msat': 500000000}}. hmac=None>
20230808T215227.085841Z |     INFO | lnpeer.Peer.[LNWallet, 035e4ff418-513a0c5a] | starting payment. len(route)=4.
AlistairTB commented 10 months ago

Somewhat understood! I will open a channel to "Electrum trampoline" to get around the current issues with larger transfers to ACINQ. What, if any, idiot friendly tools are available to visually identify liquidity problems like this?