near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.32k stars 623 forks source link

A tool to estimate time of protocol voting and protocol upgrade #12107

Open jancionear opened 1 month ago

jancionear commented 1 month ago

Protocol upgrade in NEAR works as follows:

As an example:

The protocol upgrade to version 201 happened at 2024-01-03 10:00 UTC. (In the real world the numbers aren't that pretty because epochs aren't exactly 12 hours long)

In general we prefer protocol upgrades to happen during working hours of NEAR engineers, which is around 8-22 UTC, so that they can go and fix any problems that could arise because of the upgrade. Because of that we try to set the voting dates to values which will cause the protocol upgrade to happen at the desired time.

It would be great to have a tool which:

Right now the process of estimating voting and upgrade dates is manual and a bit error prone.

### Tasks
- [ ] https://github.com/near/nearcore/pull/12114
- [ ] feat: show time based on the given time zone
- [ ] feat: If the voting date is X, when will the protocol upgrade happen?
- [ ] feat: Given a day of the voting date find the hour that maximizes the probability that the upgrade happens during working hours