decred / dcrdex

The Decred Decentralized Exchange (DEX), powered by atomic-swaps.
Other
182 stars 90 forks source link

epoch progress bar/line #831

Open chappjc opened 3 years ago

chappjc commented 3 years ago

The market page could use a epoch progress indicator somewhere. Maybe one of those very very thin lines that perpetually cycles. I'd suggest below the "Place order to Buy/Sell Asset" button

buck54321 commented 3 years ago

Any thoughts on how to handle time syncrhonization? Does the epoch end at now%dur == 0, or our best guess for the server's srv_time%dur == 0?

chappjc commented 3 years ago

For a while I thought we'd do our best based on the orderbook messages we have, maybe add a new one, but even if there is one that occurs right at epoch change (not after preimage responses), it would still be subject to network latencies. Now I'm thinking we take the now approach because this will encourage users to sync their clocks. On the other hand, that would only be fair if the server itself had some ntp capability.

chappjc commented 3 years ago

No one else has asked for this, and given the clock sync challenges, I'm OK with this issue. We can reopen if it still seems like a good feature.

chappjc commented 3 years ago

@jholdstock Has requested this, so reopening.

The solution isn't clear though. There is no message from the server when the epoch cycles (match_proof ntfn can be delayed seconds after epoch close). Also such a message would have network latency. Alternatively, client could do this on their own (without server message) using their knowledge of epoch duration and their own system clock. This carries inaccuracies from their own clock and server's clock.

Also, just because a user submits their order on the frontend before this progress indicator cycles does NOT mean that the order makes it into that epoch. The user only knows what epoch the order is in when they receive a response from the server. (As an aside, this is why we probably need to make the order verification dialog modal.) So I have concerns about misleading the user.