[bisq-network/bisq] Start pricenode providers asynchronously (#4890)

cd2357 notifications at github.com
Fri Dec 4 23:29:11 CET 2020


My main concern is this:
- let's say a pricenode cannot connect to one or more exchanges, but still starts up
  - this means that, worst case, it won't provide a price feed for some "unlucky" currencies / assets, which were only available on the currently-not-reachable exchanges
- a Bisq node connects to this pricenode for price data
- if this node wants to start a trade (or has any ongoing trade) in any of the above "unlucky" currencies, this could result in failed trades, or the inability to create/accept new trades. Also, not sure what other side-effects this would have for clients in general (NPEs, errors in UI or trade protocol, etc).

This is now avoided by the simple fact that a pricenode always provides a price for all known / expected currencies :
- If an exchange is not reachable during pricenode startup, then the startup fails until that exchange is reachable again (not ideal, I know, but at least protects Bisq nodes from the scenario above).
- If a pricenode starts with all exchanges reachable, but some exchange becomes unreachable later on, the scenario above is still not an issue, because that pricenode will serve the "cached" (or last known) price for the affected currencies or assets -- until the problematic exchange comes back online again. Actually, I think the pricenode will provide an aggregated price for the affected currencies (if the aggregate price is an average of 3 prices from 3 exchanges, and one exchange goes offline, then the pricenode will serve an aggregate price based on the current data from the 2 working exchanges + the "cached" latest known price from the 3rd exchange, until that exchange comes back online).

I admit this is mainly a theoretical concern (I didn't test it out and see errors), but it seems reasonable that these risks are possible. Most "at risk" currencies are those with a small number of "inputs" in the aggregate price, like those depending on 1-2-3 exchanges: https://bisq.wiki/Bisq_Price_Indices . For example, lots of fiat currencies have only 1 provider (BitPay).

How do you see this?

Is this an acceptable risk, or maybe am I over-estimating it?

If not, how could it be mitigated? One possible solution that comes to mind is that pricenodes periodically persist to disk the latest-known prices for all supported currencies, then if they are restarted and some exchanges are temporarily unreachable, they could report the "cached" price for those currencies until the faulty exchanges come back online. 

cc @bisq-network/pricenode-operators 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4890#issuecomment-739057552
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201204/6e455486/attachment-0001.htm>


More information about the bisq-github mailing list