-
Notifications
You must be signed in to change notification settings - Fork 9
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
[WIP] Features safe time #156
base: develop
Are you sure you want to change the base?
Conversation
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.
Quite a good start in general. I left some comments and suggestions that could be useful.
util/time/src/main/java/org/ethereum/beacon/time/provider/SystemTime.java
Outdated
Show resolved
Hide resolved
util/time/src/main/java/org/ethereum/beacon/time/provider/SystemTime.java
Outdated
Show resolved
Hide resolved
StatisticsTime statisticsTime, | ||
int allowedDelta) { | ||
this.timeProcessor = new SimpleProcessor<Time>(scheduler, "NetworkFirstStrategy"); | ||
Flux.from(networkTime.getTimeStream()) |
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.
May we have a component with two inbound streams and a single processor that handles them both?
util/time/src/main/java/org/ethereum/beacon/time/provider/NetworkTime.java
Outdated
Show resolved
Hide resolved
util/time/src/main/java/org/ethereum/beacon/time/provider/NetworkTime.java
Outdated
Show resolved
Hide resolved
…emTime.java Co-Authored-By: Mikhail Kalinin <noblesse.knight@gmail.com>
Co-Authored-By: Mikhail Kalinin <noblesse.knight@gmail.com>
…kTime Co-Authored-By: Mikhail Kalinin <noblesse.knight@gmail.com>
…kTime Co-Authored-By: Mikhail Kalinin <noblesse.knight@gmail.com>
It's a draft to solve the #63 issue.
The idea is to have several time streams:
SystemTime
with system time,NetworkTime
with NTP servers corrected system time,StatisticsTime
with time estimated from network objects such as blocks.And next we have
TimeStrategy
's designed to provide safeTime
ticker for slot production and other events. Normally we useNetworkTime
for it but if the difference between network time and statistics time is too big we suppose that network time is under attack, so we are starting to useStatisticsTime
as node time source. We are not usingStatisticsTime
normally because it has a lot of variance and bad precision for usual days.