Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Ensure end-to-end that challenging network exits works properly #23

Open
attente opened this issue Jul 25, 2018 · 0 comments
Open

Ensure end-to-end that challenging network exits works properly #23

attente opened this issue Jul 25, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@attente
Copy link
Contributor

attente commented Jul 25, 2018

Looking at the server and client library code, I don't think this is working currently. The issue is that the timestamp the server sends back to the clients is time.Now().Unix(). The contract uses now >= timestamp to check if the timestamp has expired or not.

In other words, the contract thinks the timestamp is when the match expires, and the server thinks the timestamp is when the match began.

The server needs to add DGame.MatchDuration() to time.Now().Unix() to align with what the contract expects. This is better than adding it to the check on the contract side because doing it properly like that would require checking that the player is playing the correct game as well.

To add to that, the server should be monitoring exits as well, and cancel any ones for which it possesses a valid signed timestamp of.

@attente attente added the bug Something isn't working label Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant