-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Get estimated count of blocks when cache is empty #2002
Conversation
Pull Request Test Coverage Report for Build b28c70cd-417c-4911-8ede-ff5e1b76ee5d
💛 - Coveralls |
@@ -1997,7 +1997,9 @@ defmodule Explorer.Chain do | |||
cached_value = BlockCountCache.count() | |||
|
|||
if is_nil(cached_value) do | |||
block_consensus_count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saneery should we remove or mark with the comment, that block_consensus_count function is not used anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I think, we can just remove this function
Motivation
Replace
block_consensus_count
function with an estimated count of blocks when the cache is empty.Get 90% of the estimated count, because consensus blocks are ~90% of the total count.