ACINQ / eclair

A scala implementation of the Lightning Network.
Apache License 2.0
1.24k stars 266 forks source link

A valid channel closed by Eclair Mobile without human intervention #1094

Closed jsarenik closed 4 years ago

jsarenik commented 5 years ago

Today I got a perfectly valid channel closed. On Android. Eclair Mobile 0.4.8.

New-line feeds added for readability:

local/remote feerates are too different:
remoteFeeratePerKw=2781
localFeeratePerKw=45000

It was like this. I was randomly checking everything is OK before going to a bitcoin caffee, so I turned on Eclair Mobile, waited a while to see the channel is online. Everything was fine. I turned off WiFi (hoping to save some energy with this old phone) and the notification appeared about the channel being closed uncooperatively by my side. What? I did not do anything to close the channel. Maybe there is a bug which would let interpret a half-received message anyway and that would cause this strange behavior.

Time: ~14:38 EU time, today (2019-08-04)
Peer Node Id: 03864ef ... a3f8f (acinq mainnet node)
Funded by the peer
...Let me know what other information I shall provide, but I think all you can find is that my node initiated an unilateral closing of a channel...

I would expect the valid channels to stay up and to not be closed by magic on "my" side.

It closed the channel without asking any question.

In order to reproduce, I think you can try to turn off WiFi the moment Eclair Mobile receives gossip about feerate.

0.4.8 installed from the Play Store

Android 8.1.0 (crDroid) on Samsung S4 mini

A similarly sounding issue: https://github.com/ACINQ/eclair/issues/640 The relevant source from where the channel-closing message is: See https://github.com/ACINQ/eclair/blob/master/eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelExceptions.scala#L56

I did not have logging turned on when it happened.

No loss of funds. They will be sent to me after refund delay. Let me know how I can help in order that this issue is fixed and does not happen to anyone again.

araspitzu commented 5 years ago

Hi @jsarenik in your case eclair was prompted to unilateral-close the channel becuase the feerate mismatch went over the tolerance threshold. The two parties involved in the channel usually see different on-chain feerates and the funding side is tasked with sending an update_fee message to ask the remote side to sign a new commitment (with up-to-date feerate) but the remote can also decide that the new feerate is too high to continue operating the channel and if that's the case it will close it.

Note that https://github.com/ACINQ/eclair-mobile is a better place to report mobile app related issues.

sstone commented 5 years ago

Hi Jan! As described above, fee mismatch errors are unfortunately linked to how LN is currently designed and cannot be completely eliminated yet, but protocol changes have bee proposed to improve this and some could be implementable soon. It has become very rare but valid channels can still get closed because of fee disagreements between you and the nodes you're connected to.

You scenario is interesting, losing the network cannot make us mi-interpret half-received messages, and I don't think it has an impact on local fee estimation and suspect that it's just a coincidence but it's worth investigating.

Can you confirm whether you were on testnet or mainnet (endurance is on testnet but 0386... is on mainnet) ?

jsarenik commented 5 years ago

@araspitzu thanks for pointing me to mobile repo. I will use that next time.

@sstone Oops, sorry, not endurance. It was all on mainnet (editing). Are there any checksums of received fee estimation messages being computed on higher (not TCP) level?

jsarenik commented 5 years ago

This may be related: https://github.com/ACINQ/eclair-mobile/issues/118 but in my case I was connecting the latest (0.4.8) version of Eclair Mobile with the official mainnet Acinq node and the channel close happened on the Mobile side.

t-bast commented 4 years ago

Closing this stale issue. There is activity in the spec to leverage CPFP and RBF which will allow us to move fee management to the bitcoin wallet instead of the channel management. That will get rid of those issues.