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

expose historic average gas price data #1861

Open
janmichek opened this issue Jul 23, 2024 · 7 comments
Open

expose historic average gas price data #1861

janmichek opened this issue Jul 23, 2024 · 7 comments
Assignees

Comments

@janmichek
Copy link

It should be possible as discussed here

image

aeternity/aescan#857

@sborrazas
Copy link
Contributor

@hanssv is there any way to obtain the gas price from a previous historical block and not just top blocks?

@hanssv
Copy link
Member

hanssv commented Jul 23, 2024

No, there is no way to retrieve historical data in the same format as the newly added endpoint. There is a (fair) bit of scanning and computing involved so adding this for an arbitrary height is not a great idea as @dincho explain. For the top height it is cached, but that approach doesn't scale.

I don't know the context, but isn't this exactly the kind of data you'd expect the mdw to computed during sync/scan and then provide?

@sborrazas
Copy link
Contributor

@hanssv the mdw services stay at the top node height at all times, and even if we started syncing the node from height 0 we do not stop the node, get the top height data and have the node resume the syncing. Also, the mdw syncing might be too fast for the node syncing or the other way round. We can only implement it if we can reliably obtain information from the past

@hanssv
Copy link
Member

hanssv commented Jul 23, 2024

Sorry, what? Isn't the mdw a service that aggregates, stores and provides historical data? (For example it provides information about transactions where one of the values is gas price, so how you couldn't yourself compute historical gas prices is beyond me?) If the node is supposed to provide all the necessary data in an aggregated format I'm not sure what the purpose of the mdw is?

@sborrazas
Copy link
Contributor

mdw grabs the node blocks from height 0 and begins processing them all up until the end using node functions, indexing information that the node does not provide via it's public API

@hanssv
Copy link
Member

hanssv commented Jul 23, 2024

👍 sounds like indexing historical gas prices fits that description perfectly - you would have to do a little bit of arithmetics, but doing that once while going from 0 to the top is definitely the right way. (Compared to digging up an hours worth of microblocks to compute it on-the-fly)

@sborrazas
Copy link
Contributor

👍 sounds like indexing historical gas prices fits that description perfectly - you would have to do a little bit of arithmetics, but doing that once while going from 0 to the top is definitely the right way. (Compared to digging up an hours worth of microblocks to compute it on-the-fly)

Cool, we'll try to mimic the arithmetics the node does. Thank you 🙏

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

No branches or pull requests

3 participants