Maker closes channel due to unconfirmed funding transaction #440
Comments
It seems the issue is only happening when closing a channel. There is a state between an openend channel until it gets closed again where the channel appears to be unavailable resulting in the following error when trying to open a CFD.
|
Judging from the rust-lightning code, it looks like this error should only happen upon a reorg https://github.com/lightningdevkit/rust-lightning/search?q=Funding+transaction+was+un-confirmed. However, I couldn't identify a reorg when watching closely at http://localhost:5000/blocks/recent. |
Also it looks like that if the wallet is not synced the short channel id is not yet set, so we have to wait some time before opening a CFD succeeds. I guess this was always the case, but wasn't that obvious since we synced much more frequent than now. Note, we are now syncing only once a minute - and this is about the time you have to wait to open a cfd after opening a channel. @bonomat What was the reason for reducing the frequency? as this seems also to be the reason for #427. |
Tested on testnet
|
@luckysori: It looks like this scenario only happens after a channel has been closed. I have the suspicion that we are using something like first channel somewhere. I haven't found anything in our code. Can you have a look at our rust-lightning fork? |
Does it happen every time a channel has been closed or just sometimes? I thought it only happened sometimes, which is why the source of the bug has been hard to pin down thus far. |
The reasoning for this was that scanning the blockchain is expensive and usually things don't happen that fast on-chain, e.g. we have 10 min block time. |
I don't think this is related. The issue might come from us syncing the frontend in two steps: |
For me it happened every time.. and only when I close a channel. |
I agree on confirmed transactions, but what about transactions in the mempool..? these could come very quickly and would already provide some feedback to the users actions? |
Unfortunately we cannot sync only the mempool and querying against electrs is unfortunately expensive. On a different note: I know that people are always pushing for speed, but a transaction in mempool might not mean anything yet. It can drop out due to low fees (happened to us before), or it can be replaced by another (happened as well). Meaning, doing an action based on an external transaction (not created from within our app) based on seeing it in the mempool is not the best idea. |
This was hopefully solved by @luckysori in get10101/bdk-ldk@c66ad84 |
some wallets have a switch "better UX / safety" in their settings so that the user can choose which behaviour they prefer - awaiting for more confirmations or showing things ASAP at the risk of it dropping out of the mempool |
env: regtest
Even though I am fauceting several times after opening a channel.
How to reproduce
This might not be necessary, but I always did in my test scenarios. At least it verifies that the channel is actually usable.
--- It seems at this point we are in a broken state, opening a CFD will fail, even though we got a ChannelReady event.
Eventually the channel will be force-closed with the message above.
The text was updated successfully, but these errors were encountered: