Skip to content

Created a task for calculate the avg time for new blocks added#91

Open
bezerrablockchain wants to merge 2 commits intodevelopfrom
rb-dao-756
Open

Created a task for calculate the avg time for new blocks added#91
bezerrablockchain wants to merge 2 commits intodevelopfrom
rb-dao-756

Conversation

@bezerrablockchain
Copy link
Copy Markdown
Contributor

As requested by Tobby, we should find a more precise way to determine the time between blocks creation

Copy link
Copy Markdown
Contributor

@cybervoid0 cybervoid0 left a comment

Choose a reason for hiding this comment

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

I would suggest fetching all blocks between the latest block and the reference block (or at least several of them to have better statistical data) and using their timestamps to calculate the average block time. This approach would provide a more accurate average by capturing any variations in block times over the specified range.
At least if I understood the task right

@bezerrablockchain
Copy link
Copy Markdown
Contributor Author

I would suggest fetching all blocks between the latest block and the reference block (or at least several of them to have better statistical data) and using their timestamps to calculate the average block time. This approach would provide a more accurate average by capturing any variations in block times over the specified range. At least if I understood the task right

I am not sure! This approach may lead to a period of time that is not reflecting the "actual" processing blocks time. Lets say someone picks up a block with a high network dificulty, this could result in a AVG bigger than just look in the past for an amount of blocks starting by the last one

}

const referenceQuantity = parseInt(referenceBlockQuantity, 10);
if (!currentBlock) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we add the check the second time?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should it be !referenceQuantity?

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.

3 participants