-
-
Notifications
You must be signed in to change notification settings - Fork 290
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: the unknown block sync timeout #6031
Conversation
// So we are adding a particular delay to ensure that the `unknownBlockSync` is enabled. | ||
const syncStartSlot = this.chain.clock.currentSlot; | ||
// Having one epoch time for the node to connect to peers and start a syncing process | ||
const epochCheckFotSyncSlot = syncStartSlot + SLOTS_PER_EPOCH; |
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 think one epoch would be enough time margin for a node to connect to peers and do the syncing before we start checking the sync progress. But this time could be changed based on node behavior.
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.
the comment and solution look great, I just don't feel right having this fix in prod code because onClockEpoch
is designed to witness the genesis event as well.
Could you move this code to the above if/else code block for test code only? something like:
if (!opts.disableRangeSync) {
// prod code
...
this.chain.clock.on(ClockEvent.epoch, this.onClockEpoch);
} else {
// test code, this is needed for Unknown block sync sim test
...
// TODO: fix sim test here
}
Performance Report✔️ no performance regression detected 🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
// So we are adding a particular delay to ensure that the `unknownBlockSync` is enabled. | ||
const syncStartSlot = this.chain.clock.currentSlot; | ||
// Having one epoch time for the node to connect to peers and start a syncing process | ||
const epochCheckFotSyncSlot = syncStartSlot + SLOTS_PER_EPOCH; |
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.
const epochCheckFotSyncSlot = syncStartSlot + SLOTS_PER_EPOCH; | |
const epochCheckForSyncSlot = syncStartSlot + SLOTS_PER_EPOCH; |
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.
Will fix this typo in upcoming PR.
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.
Fixed by @tuyennhv already, see 1f36e8d
🎉 This PR is included in v1.12.0 🎉 |
Motivation
Make the sim tests stable.
Description
Found this edge case which was causing timeout for sim test quite often.
If a node is started on the epoch boundary then the
unknownBlockSync
get disabled and node hang up on the head.Steps to test or reproduce