Skip to content
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

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Draft

[WIP] Features safe time #156

wants to merge 11 commits into from

Conversation

zilm13
Copy link
Member

@zilm13 zilm13 commented Jul 2, 2019

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 safe Time ticker for slot production and other events. Normally we use NetworkTime 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 use StatisticsTime as node time source. We are not using StatisticsTime normally because it has a lot of variance and bad precision for usual days.

@zilm13 zilm13 requested a review from mkalinin July 2, 2019 18:28
Copy link
Contributor

@mkalinin mkalinin left a 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.

StatisticsTime statisticsTime,
int allowedDelta) {
this.timeProcessor = new SimpleProcessor<Time>(scheduler, "NetworkFirstStrategy");
Flux.from(networkTime.getTimeStream())
Copy link
Contributor

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?

zilm13 and others added 6 commits August 2, 2019 19:47
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants