-
Notifications
You must be signed in to change notification settings - Fork 33
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: added MAXIMUM_GOSSIP_CLOCK_DISPARITY into account to distinguish future slots #1316
Conversation
After various tests, I've spotted no more warnings related to blocks being received a couple of milliseconds before. while still seeing them in the main branch, specially at different times of the day. |
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. I think we should simplify the current_slot logic. There's at least three different ways to calculate it and it's not clear when to use which. Out of scope of this PR though.
@doc """ | ||
Get the current chain slot based on the system time. | ||
|
||
TODO: There are just 2 uses of this function outside this module: |
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.
If there's a TODO, please add an issue and refer to it inside the todo. If not, remove the TODO.
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 TODO was old, you are right, I didn't saw this comment immediately. Removing it in the other PR now that I need to merge main again!
Completely agree, now at least the 2 more used functions are in the same module but we still need to unify them, I'll add an issue! |
#1322 was created! |
Motivation
This PR fixes an issue where some blocks where ignored (6000656 started at 21.11.12 for us)
WARNING 21:11:11.831 [Gossip] Block ignored, reason: "Block is from the future: block.slot=6000656. Current slot: 6000655.".
Description
In fact, the blocks where being received in time, just a couple of milliseconds before we made the transition, having into account
MAXIMUM_GOSSIP_CLOCK_DISPARITY
in the calculation, allow us to process the block at the time.I also moved the current_slot function from
Store
toForkChoice
, to have both depending on the same calculation. There is an outstanding function that previously used the oldClock.get_current_time/0
that is using the system time since then, I added a comment where it is used for future reference, the function is:get_current_chain_slot/0
.Resolves #1315