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

Need to be able to get the average block time from the API #1919

Closed
BLuEScioN opened this issue Apr 1, 2024 · 9 comments · Fixed by #1963
Closed

Need to be able to get the average block time from the API #1919

BLuEScioN opened this issue Apr 1, 2024 · 9 comments · Fixed by #1963
Assignees

Comments

@BLuEScioN
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In order to complete the new explorer blocks page I will need to be able to get the average block time from the API

Here is the blocks page explorer design where you can see I need to referenece the average block time

Image

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@BLuEScioN BLuEScioN moved this to 🆕 New in API Board Apr 1, 2024
@zone117x
Copy link
Member

zone117x commented Apr 3, 2024

Can you please add a bit more detail to this request? Do you want a new endpoint that simply returns the average stacks block time over the last 24 hours (as indicated in the design image)?

@andresgalante andresgalante moved this from 🆕 New to 📋 Backlog in API Board Apr 8, 2024
@BLuEScioN
Copy link
Collaborator Author

@zone117x There are three ways that the explorer wants to use average (nakamoto) stacks block time:

  1. Know the precise timestamp when a (nakamoto) stacks block was mined. In this case, the explorer will list the timestamp and the block time can be inferred from the block time. See image

image

  1. The average stacks block time over 24 hours. We want to use this information just as you can can see in the 1st image.
  2. Know what the average stacks block time was within a btc block. See image

image

For 1) I think this information can provided via the blocks api
For 2) an endpoint for the average block time in the last 24 hours would solve the problem at hand. Although having an endpoint just for this seems like one off work.
For 3) it would sense to include this information in the burn block api imo. Hopefully the work for 2) can be leveraged to solve for this case as well

@zone117x
Copy link
Member

zone117x commented Apr 8, 2024

For 1) this should be ready, stacks blocks times were added a bit ago, but were accidentally left out of some of the endpoints, that was fixed in #1921 (we might need to deploy a new version for you to see the changes)

I agree for 2 and 3

@BLuEScioN
Copy link
Collaborator Author

This feature will not be public until we activate epoch 3 so I think we have some time to get this done. When do you expect we can fit this work in and what's your ETA for it?

@BLuEScioN
Copy link
Collaborator Author

Any update on 2 and 3?

@BLuEScioN
Copy link
Collaborator Author

@smcclellan Do you have any updates on this?

@zone117x
Copy link
Member

I think we can have a MVP for this by end of week

@zone117x zone117x self-assigned this Apr 23, 2024
@zone117x zone117x moved this from 📋 Backlog to 🏗 In Progress in API Board Apr 23, 2024
@BLuEScioN
Copy link
Collaborator Author

@zone117x Any updates here?

@zone117x
Copy link
Member

@BLuEScioN you were added for review on the referenced PR #1962

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants