-
Notifications
You must be signed in to change notification settings - Fork 267
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
Improving remasc blocks retrieval; removing unused BlockStore method #1047
Conversation
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.
LGTM only a minor comment
Block currentBlock = blockStore.getBlockByHashAndDepth( | ||
executionBlock.getParentHash().getBytes(), | ||
remascConstants.getMaturity() - 1 - uncleGenerationLimit | ||
// this search is noe optimized if have certainty that the execution block is not in a fork |
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.
Is this change on the comment intended?
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, the algorithm supports the existence of a fork, but it could be degraded to the original algorithm performance if the fork involves > blocks than the remasc maturity parameter
Block currentBlock = blockStore.getBlockByHashAndDepth( | ||
executionBlock.getParentHash().getBytes(), | ||
remascConstants.getMaturity() - 1 - uncleGenerationLimit | ||
// this search is noe optimized if have certainty that the execution block is not in a fork |
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.
Minor typo: noe should be replaced by not
LGTM! I only found a minor typo, @ajlopez please fix it and I will approve the PR. |
4625478
to
08d3386
Compare
Remasc precompiled contract usually retrieved 4000 blocks in mainchain, each time. Now, the retrieve of the execution block (current block - maturity aprox) was replaced by an algorithm using in other uses cases. The old method used was removed.