-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Implement Precise Ticker for Slot Interval #511
Comments
@rawfalafel are you referring to |
@danielschonfeld yeah, thanks! Sent with GitHawk |
I am no expert on this, but from reading Russ Cox's comments and code examples, it seems to me that both him and the original OP come to agreement that there is no drift problem with Go or their ticker implementation. It seems that the problem is between the virtualized environment (Azure VM in this case) and the real world clock. Russ also goes on to say that Go's implementation will generally stay loyal to the start time its aligned to. Having that said, raises two questions:
|
We're also making the assumption that the wall time is always correct, but the monotonic clock might be too fast or too slow.
Right. Go's ticker stays loyal to the monotonic clock, even though the monotonic clock isn't aligned with the wall clock. I realized I left out an important detail. We're assuming that the wall clock is always in sync with every other node's wall clock using NTP server. We can verify this by occasionally comparing |
Could be useful perhaps to check NTP at each cycle transition as that is a sensitive point for all beacon clients |
Closed by #635 |
Background
In the current spec, new blocks are allowed to advance the chain every
slotDuration
seconds. As a concrete example, if the genesis block is published at timeT
, the first block can be published at timeT+slotDuration
, the second block timeT+2*slotDuration
, etc. Prysm currently has a naive implementation that uses the standard library Ticker, but it has two issues.T+N*slotDuration
, whereN
is a non-negative integer. This means that the ticker will be "off beat" from the correct beat, even if the interval length is correct.Requirements
Replace the current naive ticker with a ticker that addresses both issues above. It's probably best to confirm that clock drift is an issue, although this thread seems to confirm that it is. The thread also contains a sample solution by Russ Cox -- that may be helpful 😃
The text was updated successfully, but these errors were encountered: