-
Notifications
You must be signed in to change notification settings - Fork 47
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
[CATCHUP] Init Consensus with 2 views to prevent Double Vote/Propose #3648
Conversation
} | ||
|
||
/// reset last actions to genesis so we can resend events in tests | ||
pub fn reset_actions(&mut self) { |
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 there a way to gate this to tests only? or do we want to potentially use it elsewhere in the future
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 tried to gate this for test but it causes a whole bunch of issues because lots of the byzantine code isn't gated for test etc. I'll follow up with the gating because we should gate this
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
Closes #3626
This PR:
This PR adds a new start parameter to consensus which is the view we last "actioned" in. An action is voting or proposing for DA/Quorum. The PR also enforces that we don't send double actions by checking in the network task if we've already sent something for the view we are about to transmit a vote/proposal to or a higher view. This means if we propose in view 10 we can't then propose for view 9. We should never want to do this.
The PR also adds the consensus shared state to the byzantine behaviors so that they can reset the last actioned view so their byzantine sends are not blocked.
This PR does not:
This PR doesn't apply to DA votes because after view sync we can often legitimately get a proposal for view n and n+1 in either order. If we handle the n+1 view first we don't want to not vote for view n
Key places to review:
-Changes to the
HotshotInitializer
network.rs
Consensus