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: estimate time by offset #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

mujahidkay
Copy link
Member

@mujahidkay mujahidkay commented Jan 8, 2025

Description

Closes: #5

This PR adds an -offset arg to the estimator to more accurately estimate the expected time of a future block

Without offset

❯ go run main.go -height 17842500 -rpc https://main-a.rpc.agoric.net:443 -samples 1000
Mean Block Time: 14.825253s (1000 samples)
Estimated time for height 17842500:
        Local: Sat Jan 11 14:57:16 PKT 2025
          UTC: Sat Jan 11 09:57:16 UTC 2025
   Asia/Tokyo: Sat Jan 11 18:57:16 JST 2025
Australia/NSW: Sat Jan 11 20:57:16 AEDT 2025
Asia/Istanbul: Sat Jan 11 12:57:16 +03 2025
   US/Pacific: Sat Jan 11 01:57:16 PST 2025
   US/Eastern: Sat Jan 11 04:57:16 EST 2025
****** WARNING ******
Insufficient time for voting period: 70h5m55.450267553s
****** WARNING ******

With offset

❯ go run main.go -height 17842500 -offset 7.2d  -rpc https://main-a.rpc.agoric.net:443 -samples 1000
Mean Block Time: 14.762233s (1000 samples)
Estimated time for height 17842500:
        Local: Fri Jan 10 19:59:43 PKT 2025
          UTC: Fri Jan 10 14:59:43 UTC 2025
   Asia/Tokyo: Fri Jan 10 23:59:43 JST 2025
Australia/NSW: Sat Jan 11 01:59:43 AEDT 2025
Asia/Istanbul: Fri Jan 10 17:59:43 +03 2025
   US/Pacific: Fri Jan 10 06:59:43 PST 2025
   US/Eastern: Fri Jan 10 09:59:43 EST 2025
****** WARNING ******
Insufficient time for voting period: 51h9m11.308282955s
****** WARNING ******

Since we were targeting Friday 10th 14 UTC, the latter seems more accurate than the former. Since I did not have any other data points, so this is the only verification I did.

@mujahidkay mujahidkay self-assigned this Jan 8, 2025
@mujahidkay mujahidkay requested a review from mhofman January 8, 2025 12:01
@mujahidkay mujahidkay marked this pull request as ready for review January 8, 2025 12:01
@mhofman mhofman requested a review from gibson042 January 8, 2025 18:03
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.

Estimate by offset
1 participant