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

fix: resolve consensus halt caused by time discrepancy in network. #727

Merged
merged 5 commits into from
Oct 3, 2023

Conversation

themantre
Copy link
Contributor

@themantre themantre commented Oct 3, 2023

Description

If there is a time discrepancy in the network, even for a few seconds, there is a high chance that some validators missed votes or proposals. Prior to this PR, votes and proposals that did not belong to the current height were discarded.

This PR enhances the consensus with two improvements:

  1. It immediately moves to the next height once a block is committed. This allows us to populate the votes from the next height before the newHeight timer expires.
  2. In the consensusManager, we populate all votes and proposals belonging to upcoming heights and process them when the consensus moves to the new height.

Another improvement is the PIP that prevents nodes with a high time discrepancy from joining the network.

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #727 (1516c96) into main (3f43045) will decrease coverage by 0.07%.
The diff coverage is 95.95%.

@@            Coverage Diff             @@
##             main     #727      +/-   ##
==========================================
- Coverage   83.12%   83.06%   -0.07%     
==========================================
  Files         171      172       +1     
  Lines        7977     8011      +34     
==========================================
+ Hits         6631     6654      +23     
- Misses       1031     1042      +11     
  Partials      315      315              

Copy link
Member

@amirvalhalla amirvalhalla left a comment

Choose a reason for hiding this comment

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

@themantre
please resolve request changes.

@b00f b00f merged commit da821e1 into main Oct 3, 2023
12 checks passed
@b00f b00f deleted the fix-time-discrepancy-issue branch October 3, 2023 13:16
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.

3 participants