indra
indra copied to clipboard
[Client, node] Resolve htlc apps onchain if counterparty is unresponsive
Relies on other watcher work to be completed first.
We need to explicitly dispute htlc apps in client and node if they are close to (or past) expiring but the counterparty has not resolved them offchain.
If the client is receiving an htlc transfer, they should dispute shortly before the timeout -- note that because we allow "shortcutting" the dispute for transfers, this actually only needs to happen a few (perhaps we can go with 100?) blocks before expiry.
If the client is ending an htlc transfer and the transfer is never resolved, they should dispute shortly after the timeout (perhaps 1 day after?).
Note that disputing will totally end the channel and make it unusable in the future, requiring that users withdraw ALL funds and rotate keys.
Small addon:
If the client is ending an htlc transfer and the transfer is never resolved, they should dispute shortly after the timeout (perhaps 1 day after?).
The same way should the node dispute an unresolved transfer to a client after expiry.
Assuming an htlc timeout of 7 days.
Proposal for client dispute timeout: 1 day. If a node doesn't respond/is offline for longer than 24h something is seriously wrong and the client should go and dispute on-chain. Also the client might be offline itself for an extended time. This creates a buffer of 6 days (7 days htlc timeout) for the client to come online and broadcast this tx.
Proposal for node dispute timeout: 4 days. Clients can be offline for some time, but the node should limit the amount of funds that are locked in htlcs that it can't claim and could lead to it running dry. (EDITED from previously 6 days).
Related: retry unlocking an incoming htlc up to dispute timeout (https://github.com/connext/rest-api-client/issues/37). The node should do the same.