-
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
[Core Plugin DBFT] include consensus time into block interval #3637
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ private class Timer { public uint Height; public byte ViewNumber; } | |
private ICancelable timer_token; | ||
private DateTime block_received_time; | ||
private uint block_received_index; | ||
private DateTime onPrepareReceivedTime; | ||
private uint onPrepareBlockIndex; | ||
private bool started = false; | ||
|
||
/// <summary> | ||
|
@@ -95,9 +97,10 @@ private void InitializeConsensus(byte viewNumber) | |
else | ||
{ | ||
TimeSpan span = neoSystem.Settings.TimePerBlock; | ||
if (block_received_index + 1 == context.Block.Index) | ||
if (block_received_index + 1 == context.Block.Index && onPrepareBlockIndex + 1 == context.Block.Index) | ||
{ | ||
var diff = TimeProvider.Current.UtcNow - block_received_time; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likely |
||
// Include the consensus time into the consensus intervals. | ||
var diff = TimeProvider.Current.UtcNow - onPrepareReceivedTime; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this methodology can trigger strange behaviors in a real scenario, after change views, delays and etc... |
||
if (diff >= span) | ||
span = TimeSpan.Zero; | ||
else | ||
|
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.
This is required? seems a fix for a different thing