Skip to content
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: predict protocol upgrade time based on voting date #12202

Merged
merged 18 commits into from
Oct 15, 2024

Conversation

stedfn
Copy link
Contributor

@stedfn stedfn commented Oct 10, 2024

Usage:

python3 estimate_epoch_start_time.py --chain_id mainnet --voting_date "2024-10-15 00:20:00"

Example Output
Epoch -1: 13 hours, 42 minutes
Epoch -2: 13 hours, 37 minutes
Epoch -3: 13 hours, 15 minutes
Epoch -4: 13 hours, 37 minutes

Exponential weighted average epoch length: 13 hours, 33 minutes
Predicted start of epoch 1: 2024-10-11 00:24:31 UTC+0000 Friday
Predicted start of epoch 2: 2024-10-11 13:58:19 UTC+0000 Friday
Predicted start of epoch 3: 2024-10-12 03:32:06 UTC+0000 Saturday
Predicted start of epoch 4: 2024-10-12 17:05:54 UTC+0000 Saturday
Predicted start of epoch 5: 2024-10-13 06:39:42 UTC+0000 Sunday
Predicted start of epoch 6: 2024-10-13 20:13:29 UTC+0000 Sunday
Predicted start of epoch 7: 2024-10-14 09:47:17 UTC+0000 Monday
Predicted start of epoch 8: 2024-10-14 23:21:04 UTC+0000 Monday
Predicted start of epoch 9: 2024-10-15 12:54:52 UTC+0000 Tuesday
Predicted start of epoch 10: 2024-10-16 02:28:40 UTC+0000 Wednesday

Voting date falls into epoch 8.
Protocol upgrade will happen at the start of epoch 10: 2024-10-16 02:28:40 UTC+0000 Wednesday

@stedfn stedfn self-assigned this Oct 10, 2024
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.83%. Comparing base (bef29bc) to head (cd945de).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12202      +/-   ##
==========================================
- Coverage   71.84%   71.83%   -0.02%     
==========================================
  Files         827      827              
  Lines      166690   166716      +26     
  Branches   166690   166716      +26     
==========================================
- Hits       119763   119760       -3     
- Misses      41710    41736      +26     
- Partials     5217     5220       +3     
Flag Coverage Δ
backward-compatibility 0.17% <ø> (-0.01%) ⬇️
db-migration 0.17% <ø> (-0.01%) ⬇️
genesis-check 1.25% <ø> (-0.01%) ⬇️
integration-tests 38.92% <ø> (+<0.01%) ⬆️
linux 71.50% <ø> (-0.03%) ⬇️
linux-nightly 71.42% <ø> (-0.02%) ⬇️
macos 53.34% <ø> (-0.93%) ⬇️
pytests 1.57% <ø> (-0.01%) ⬇️
sanity-checks 1.37% <ø> (-0.01%) ⬇️
unittests 65.62% <ø> (-0.02%) ⬇️
upgradability 0.21% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@VanBarbascu VanBarbascu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the parser functions, it looks good. Feel free to merge it after you fix it.
Thanks!

debug_scripts/estimate_epoch_start_time.py Show resolved Hide resolved
debug_scripts/estimate_epoch_start_time.py Outdated Show resolved Hide resolved
@stedfn stedfn marked this pull request as ready for review October 15, 2024 10:16
@stedfn stedfn requested a review from a team as a code owner October 15, 2024 10:16
@stedfn stedfn requested review from saketh-are and removed request for a team and saketh-are October 15, 2024 10:16
@stedfn stedfn changed the base branch from stefan/feat/timezone_support to master October 15, 2024 11:12
@stedfn stedfn enabled auto-merge October 15, 2024 11:55
@stedfn stedfn disabled auto-merge October 15, 2024 12:00
@stedfn stedfn enabled auto-merge October 15, 2024 12:31
@stedfn stedfn added this pull request to the merge queue Oct 15, 2024
Merged via the queue into master with commit 8be015e Oct 15, 2024
29 of 30 checks passed
@stedfn stedfn deleted the stefan/feat/predict_upgrade_time branch October 15, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants