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
Earlier prevention of processing if no parent state #6871
base: master
Are you sure you want to change the base?
Conversation
d32cdc2
to
1786ccb
Compare
…rocess-when-no-parent-state
if (shouldProcess) | ||
{ | ||
BlockHeader? parentHeader = _blockTree.FindHeader(headers[0].ParentHash!); | ||
if (parentHeader is not null && !_stateReader.HasStateForBlock(parentHeader)) |
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.
Can't we do it with full state finder and just check if the full state number is < parent header? I just don't like unnecessary change, probably not a big deal.
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.
Actually, it could be the case that the state was downloaded (in another thread) and the state is the parent of parent causing this to never pass.
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.
So we need to check for every block looks like
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.
I guess would be perfect to track what state is being downloaded and download blocks without processing till that block + don't download if potential state is not known
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.
Make sync event driven, not state-check-on-timer driven?
Fixes hive tests related to synchronization
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing (manual)
If yes, did you write tests?