-
Notifications
You must be signed in to change notification settings - Fork 251
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
Time independent consensus [issue 2] #6
Time independent consensus [issue 2] #6
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.
In generally it is looking good for me. But you need to check problem with time in sandbox.
- Do not use any information from outside in sandbox tests.
exonum/src/node/mod.rs
Outdated
1 | ||
} | ||
} | ||
|
||
// FIXME find more flexible solution |
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.
Is the remark is actual?
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.
I don't fully understand the idea of the original comment - is it about the whole round_start_time
method or about time from the last block?
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.
I do not remember, but now everything seems to be looking good. Maybe later we can hold a hunt for remarks.
exonum/src/node/state.rs
Outdated
@@ -257,7 +258,8 @@ impl State { | |||
stored: StoredConfiguration, | |||
connect: Connect, | |||
last_hash: Hash, | |||
last_height: u64) | |||
last_height: u64, | |||
time: Timespec) |
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.
What is the time means? I do not understand it from code.
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.
time
is used for height_start_time
(State
field) initialization. This field is updated when the node is initialized and when switching to new height.
Should I change parameter name from time
to height_start_time
in new_height
and new
functions?
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.
Yes, I think that it will become clearer.
sandbox/src/sandbox.rs
Outdated
@@ -457,7 +457,7 @@ pub fn sandbox_with_services(services: Vec<Box<Service>>) -> Sandbox { | |||
|
|||
let inner = Arc::new(Mutex::new(SandboxInner { | |||
address: addresses[0].clone(), | |||
time: blockchain.last_block().unwrap().time(), | |||
time: get_time(), |
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.
Are you using the system time here? I think that is not a good idea because it breaks the repeatability of sandbox tests. Maybe need to use predefined constant?
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.
Fixed.
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
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
Time independent consensus (fixes #2) Former-commit-id: e171510ed388eff583e1b86387a7b3c3901bc84d
Update exonum revision.
Update core to separated keys revision
Refactoring rustfmt imports
updated favicon
#2