Conversation
mkalinin
reviewed
Jul 17, 2019
Contributor
mkalinin
left a comment
There was a problem hiding this comment.
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()) |
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's a draft to solve the #63 issue.
The idea is to have several time streams:
SystemTimewith system time,NetworkTimewith NTP servers corrected system time,StatisticsTimewith time estimated from network objects such as blocks.And next we have
TimeStrategy's designed to provide safeTimeticker for slot production and other events. Normally we useNetworkTimefor 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 useStatisticsTimeas node time source. We are not usingStatisticsTimenormally because it has a lot of variance and bad precision for usual days.