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

[CATCHUP] Init Consensus with 2 views to prevent Double Vote/Propose #3648

Merged
merged 12 commits into from
Sep 5, 2024

Conversation

bfish713
Copy link
Collaborator

@bfish713 bfish713 commented Sep 4, 2024

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

  • Changes in network.rs
  • Changes to Consensus

@bfish713 bfish713 changed the title Bf/init views [CATCHUP] Init Consensus with 2 views to prevent Double Vote/Propose Sep 5, 2024
@bfish713 bfish713 marked this pull request as ready for review September 5, 2024 14:17
}

/// reset last actions to genesis so we can resend events in tests
pub fn reset_actions(&mut self) {
Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Contributor

@jparr721 jparr721 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bfish713 bfish713 merged commit fb9f0e0 into main Sep 5, 2024
37 checks passed
@bfish713 bfish713 deleted the bf/init-views branch September 5, 2024 18:00
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.

[CATCHUP] - Different Parameters for Start View and Last Voted View
4 participants