Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Fix fork detection #10839

Merged
merged 3 commits into from
Jun 30, 2020
Merged

Fix fork detection #10839

merged 3 commits into from
Jun 30, 2020

Conversation

carllin
Copy link
Contributor

@carllin carllin commented Jun 29, 2020

Problem

Current fork detection mechanism will report a fork whenever vote bank.slot() != Some(reset_bank.slot()). However, there are cases when this is true and no fork exists. For instance, if some validators are falling behind and we can't vote due to a threshold failure, then vote bank will be None.

Summary of Changes

Switch to simpler fork detection, if heaviest bank is not a descendant of the last vote, then a fork must exist.
Fixes #

@carllin carllin added the v1.2 label Jun 29, 2020
@carllin carllin requested a review from sakridge June 29, 2020 22:19
sakridge
sakridge previously approved these changes Jun 29, 2020
Copy link
Contributor

@sakridge sakridge left a comment

Choose a reason for hiding this comment

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

lgtm

@mergify mergify bot dismissed sakridge’s stale review June 29, 2020 23:26

Pull request has been modified.

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #10839 into master will decrease coverage by 0.0%.
The diff coverage is 54.5%.

@@            Coverage Diff            @@
##           master   #10839     +/-   ##
=========================================
- Coverage    81.9%    81.8%   -0.1%     
=========================================
  Files         303      303             
  Lines       71087    71099     +12     
=========================================
- Hits        58227    58220      -7     
- Misses      12860    12879     +19     

@carllin carllin merged commit 4b93a7c into solana-labs:master Jun 30, 2020
mergify bot pushed a commit that referenced this pull request Jun 30, 2020
* Fix fork detection

Co-authored-by: Carl <carl@solana.com>
(cherry picked from commit 4b93a7c)
carllin added a commit that referenced this pull request Jun 30, 2020
* Fix fork detection

Co-authored-by: Carl <carl@solana.com>
(cherry picked from commit 4b93a7c)
carllin added a commit that referenced this pull request Jun 30, 2020
* Fix fork detection

Co-authored-by: Carl <carl@solana.com>
(cherry picked from commit 4b93a7c)
mergify bot added a commit that referenced this pull request Jun 30, 2020
* Fix fork detection

Co-authored-by: Carl <carl@solana.com>
(cherry picked from commit 4b93a7c)

Co-authored-by: carllin <wumu727@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants