-
Notifications
You must be signed in to change notification settings - Fork 43
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
What exactly to do when lnd or raiden is disconnected #684
Comments
We shouldn't disconnect from peers, as losing connectivity to lnd only means that one currency is impacted, so I think the better route is to temporarily disable all affected trading pairs. That would update the handshake with our peers to let them know we aren't supporting that pair (which in turn would make them drop all our orders for that pair) and would fail any rpc calls to place an order (or execute a swap) for that trading pair. We would also want to drop orders for that trading pair locally. |
Other opinions? @offerm @erkarl @moshababo ? |
|
I verified that we actually do connect to peers on startup even without a connection to lnd, however we are advertising the trading pair that we don't have an lnd connection for and that needs to change. |
We already have the ability to add and remove trading pairs (see |
Great, anything that still needs to be defined? |
Good to go? @sangaman |
Dependency: #762 |
Great that we have most of it! As far as I understand we still have to handle:
I would use the regular Added testing this to the TODO's for xud-simulation tests:
|
I was thinking 30s or a minute, either is fine with me. We already have the logic in place to invalidate all own orders for an affected pair, so that's no big deal. Broadcasting all orders again is a new feature though. This would require us to track invalidated own orders separately within xud (currently we just get rid of them). It also means that we could have a lot of re-validated orders match immediately - would the re-validated orders become the takers in that case? It's certainly doable, but I'm thinking that it might just be better to expect exchanges to resend their orders to xud when a trading pair comes back online. |
Yes, I believe we need to take the orders out of the order book and store them somewhere else.
Exchanges in no-matching mode track orders on their own. Any other node in matching mode would permanently loose all these orders - not good. Also, how would the exchange re-sending orders to xud and xud in turn immediately sending it to the order book be any different from xud doing that directly? Exchanges would have to implement a separate logic to handle these cases. Let's do it for them!
Good point, this has to be avoided. The taker/maker side should never change before and after the swap client disconnect event. As a matter of fact, all own orders residing in the order book are maker orders and that's how the situation should be after the disconnect event. An idea how to do this:
|
OK, I think that can be done. But the way you described it there could be orders that overlap in price but don't "match" because they are both treated as makers, but I guess that's the desired outcome in this case? |
All own orders in the order book are maker orders. So that's what these were before and that's what they should be after swap client disconnect.
don't see how this can happen, then they should have matched before already. Note: as I described it, we don't allow any old or new peer orders or new own orders (place orders) while swap client is disconnected.
Anyways, yes that's the desired outcome. Still would be interested in how a price overlap of two own orders which were like this in the order book before can occur. |
When we request the orders from peers that we missed while we weren't accepting orders, we could get orders that match the orders we put aside. But they will both be "maker" orders in this case. |
Now I understand what you mean. Yes there can be a price match but there won't be a match/swap triggered, because |
Yup I think so. |
Dependent on @erkarl 's |
Ensuring lnd and raiden are up can be done by docker, above dependency |
Prerequisite: #573
This issue is about answering the question: What should we do if we
xud
identifies via #573 that it is not properly connected to LND?Current opinions:
a) disconnect from all peers
Good: easy
Bad: doesn't differentiate between e.g. LND and Raiden
b) Throw an error through gRPC and revoke all trading pairs with swap protocol LND. Also disable all peerOrders with swap protocol LND. Same with Raiden.
Good: considers different swap clients (LND, Raiden)
Bad: Complicated
The text was updated successfully, but these errors were encountered: