farcaster-node icon indicating copy to clipboard operation
farcaster-node copied to clipboard

Add ability to re-attempt auto-funding swap if insufficient mature outputs

Open Lederstrumpf opened this issue 3 years ago • 2 comments

When operating multiple swaps, failure to autofund is quite frequent when operating (far) more swaps in parallel than UTXOs available and mostly ephemeral due to

  1. Monero RPC: not enough unlocked money (E needed_money + min_fee > unlocked_balance_subtotal. THROW EXCEPTION: error::not_enough_unlocked_money)
  2. Bitcoin: too many descendants from unconfirmed UTXO (too-long-mempool-chain, too many descendants for tx ... [limit: 25])

We should have the ability to re-attempt autofund whenever the block height gets incremented, but we also should not introduce the risk that the auto-fund does eventually succeed, but the user has already funded manually too (in which case, the swap should cancel in Alice's case, or in Bob's case only lock the amount negotiated).

So if the autofunding fails, user should either explicitly request another attempt, or it should reattempt until user requests auto-funding information, and then autofunding stops.

Lederstrumpf avatar May 20 '22 09:05 Lederstrumpf

This is done in #686 . @Lederstrumpf how do you wan to proceed here?

sedited avatar Aug 31 '22 16:08 sedited

#686 addressed failure if monero daemon didn't respond in time. The cases described in this issue are related to too few mature outputs. I've renamed it to make explicit.

As I described in #686, I'm on the fence whether or not we want auto-funding in this case (slightly leaning towards not). So I'm fine with both keeping it open or closing it.

Lederstrumpf avatar Sep 02 '22 11:09 Lederstrumpf