-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ETH swap client connectivity stops the recovery of BTC funds #1733
Comments
When xud starts up, we do have a brief wait for all swap clients to try to come online (I believe it's 5 seconds) before we move onto other initialization tasks including recovering crashed swaps. We could potentially change this but I don't see this as an issue assuming I'm understanding correctly and it doesn't delay things more than a few seconds. But even when do attempt to claim our funds after a crash, we often times do rely on the outgoing swap client to retrieve the preimage for us. Based on the logs in outcome 2, it looks like we try to fetch the preimage for the outgoing payment from the connext client, but connext is reporting that the payment is still pending (and thus has no preimage to give us). Are you certain in this case that the connext payment has gone through? |
As discussed internally, it is expected to use the outgoing payment swap client to retrieve a missing preimage. Hence outcome 1 behaviour not a problem. Regarding outcome 2 - I played a bit with the taker delay / maker crash timing, but didn't manage to reproduce it.
Looks like it's working properly. But to verify connext payment anyway, i've put the ETH balance assertion (outgoing payment) before the BTC one (incoming payment). |
Background
In a scenario where, during a swap, the maker xud node crashes while the taker is delaying his settlement, the recovery procedure is being cancelled once one of the swap clients isn't available, even if it's not related to the funds to be recovered.
For example, when maker has an incoming payment in BTC, and outgoing payment in ETH, it looks like Connext client being temporarily offline stops the recovery of BTC funds:
(outcome 1)
Sometimes, on the same scenario, the BTC aren't being recovered at all. The difference is perhaps due to the exact timing of the taker settlement and the maker crash.
(outcome 2)
Steps to reproduce
testMakerCrashedAfterSendDelayedSettlementConnextOut
test is implemented in the connext_instability_recovery_issue branch. All other instability tests are disabled.In the test, the recovery procedure intervals were tweaked to 5sec.
The test currently asserts only that BTC funds were recovered after 10sec wait. This means that in outcome 1, the test are passing, but the issue can be seen consistently in the logs. The test happen to fail only in outcome 2.
To run locally:
Latest CI run:
https://github.com/ExchangeUnion/xud/runs/869600254 (logs are printed for inspection even when test passes).
Expected behaviour
BTC funds should be recovered independently of ETH swap client connectivity.
The text was updated successfully, but these errors were encountered: