-
Notifications
You must be signed in to change notification settings - Fork 485
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
Fix gapless reverse blockheader search #5018
Conversation
@@ -946,14 +946,48 @@ public BlockHeader[] FindHeaders(Keccak? blockHash, int numberOfBlocks, int skip | |||
|
|||
if (skip == 0) | |||
{ | |||
static BlockHeader[] FindHeadersReversedFast(BlockTree tree, BlockHeader startHeader, int numberOfBlocks, bool reverse = false) |
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.
Why move in?
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.
To be closer to only place where it is used.
AddToMain(blockTree, block0); | ||
AddToMain(blockTree, block1); | ||
AddToMain(blockTree, block2); | ||
AddToMain(blockTree, block3); | ||
AddToMain(blockTree, block4); |
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.
Why this did not catch the issue before? Should you update this test somehow on line 444?
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.
BlockTree didn't have any blocks past the requested one, which caused endBlock
- how it was previously calculated to always be null
* Fix gapless reverse blockheader search * Increase times to stabilize pipeline * Revert "Increase times to stabilize pipeline" This reverts commit 69193f0. * disable EngineModuleTests parallelization * Revert "disable EngineModuleTests parallelization" This reverts commit 0238cd6. * fix tests (cherry picked from commit d3c4e3a)
Fixes #5017
Changes:
GetBlockHeaders
to properly supportreverse
flag.Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyTesting
Requires testing
In case you checked yes, did you write tests??