-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(release): Add epoch start estimator script #12114
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12114 +/- ##
==========================================
- Coverage 71.56% 71.56% -0.01%
==========================================
Files 821 821
Lines 165303 165303
Branches 165303 165303
==========================================
- Hits 118300 118295 -5
+ Misses 41873 41870 -3
- Partials 5130 5138 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Not needed for this PR but it would be nice to have an argument to set a specific timezone. |
epoch_length_seconds = epoch_length / 1e9 # Convert to seconds | ||
epoch_lengths.append(epoch_length_seconds) | ||
|
||
print(f"Epoch {i+1}: {epoch_length_seconds} seconds") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to print the actual epoch height instead of 1 2 3 ...? Same for the future epochs.
Also the time in seconds isn't very readable, would be nicer to have something like: 14h 20m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not straight forward.
|
||
|
||
# Function to approximate future epoch start dates | ||
def predict_future_epochs(starting_epoch_timestamp, avg_epoch_length, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One observation - the tool predicts that the next epoch will start in 11 hours, but debug-ui says it'll happen in 13 hours.
I wonder where the discrepancy comes from 🤔 Maybe debug-ui doesn't use exponential average. /cc @robin-near
help="Number of future epochs to predict.") | ||
|
||
args = parser.parse_args() | ||
main(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very useful, thank you for making this!
To resolve #12107 I would love to have two more things:
- If the voting date is X, when will the protocol upgrade happen?
- Given a day of the voting date find the hour that maximizes the probability that the upgrade happens during working hours
But that can be done in follow up PRs
0512b47
to
873fc4a
Compare
Usage:
Example output