dcrdex icon indicating copy to clipboard operation
dcrdex copied to clipboard

testing: need live reorg testing

Open buck54321 opened this issue 5 years ago • 4 comments
trafficstars

All of the harnesses are equipped to perform reorgs, but none of our live tests are using the functionality yet. Also, a btc testnet reorg appears to be responsible for some recent chaos on the testnet DEX server.

buck54321 avatar Aug 25 '20 16:08 buck54321

Symptom 1: On the server, it appears that txns going back to mempool after being mined is not handled correctly. In (*TXIO).confirmations, I'm seeing mainchainBlock, found := btc.blockCache.atHeight(txio.height) returning with !found. This is being claled from (*Swapper).redeemStatus.

Symptom 2: On the client, (*trackedTrade).swapMatches is hitting e.g. "btc coin XXX not found" when looking up swap inputs in the t.coins map. It's not clear how this happened though.

chappjc avatar Aug 25 '20 16:08 chappjc

We also need to allow for new best tip to be of a lower height than the previous best.

chappjc avatar Aug 25 '20 17:08 chappjc

Wanted to bring this up even, forgot somehow. I recently tried using the ./reorg script in the asset harnesses to trigger reorgs but was unsuccessful. I'll try it again and report the unexpected results; and the other steps I took to get a reorg to occur.

itswisdomagain avatar Aug 25 '20 20:08 itswisdomagain

We should reevaluate this issue with https://github.com/decred/dcrdex/pull/669 merged. I think BTC's reorg script is just fine as it's not complicated by the need for voters on the side chains, but I don't know for sure.

chappjc avatar Aug 31 '21 16:08 chappjc