[bisq-network/bisq] Use the index of a seed node address in the list of nodes at the (#4445)

wiz notifications at github.com
Sat Aug 29 07:48:18 UTC 2020


I ran this on wizseed3 and it restarted once in a day during the 9th hour of the day, so the restart code tested fine. However, I have a few comments on the implementation used to decide when to restart. Are you sure it's a good idea to sort the list of hostnames before deriving the IDs? By doing it that way, whenever we add new seednodes to the list it will change all the IDs, and since not everyone will upgrade on the same day, this might cause 2 seednodes to have the same ID and restart at the same time, causing the exact issue we are trying to prevent from happening.

Alternatively, why not use a deterministic function to derive a number from the digest of the onion hostname? For example, since there are 1440 minutes in a day, so if you take the the md5sum of the hostname `wizseed3d376esppbmbjxk2fhk2jg5fpucddrzj2kxtbxbx4vrnwclad`, which is `0xd633dfb94a557650c94b995f4c42bf61`, and mod that by 1440 you get 289, so the node should restart on the 289th minute of every day. This is quite safe because it only takes a node about a minute to restart, and the chance of 12 seednodes colliding in a 1440 namespace is less than 1%, which seems like it would be more reliable than only using the 24 hours of a day.

Additionally, regardless of which implementation is used, the restart code should use UTC regardless of the timezone that the server is set to. Some servers have their timezone set to local times which would offset the deterministic restart time.

-- 
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/4445#issuecomment-683252617
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200829/a344265f/attachment.html>


More information about the bisq-github mailing list