RFC35/Common Ancestor: Modifying the forkchoice rule#425
Merged
Conversation
JekaMas
reviewed
Jun 23, 2022
JekaMas
reviewed
Jun 23, 2022
JekaMas
reviewed
Jun 23, 2022
JekaMas
reviewed
Jun 23, 2022
JekaMas
reviewed
Jun 23, 2022
JekaMas
reviewed
Jun 23, 2022
JekaMas
reviewed
Jun 24, 2022
JekaMas
reviewed
Jul 5, 2022
Codecov Report
@@ Coverage Diff @@
## develop #425 +/- ##
===========================================
+ Coverage 56.30% 56.37% +0.07%
===========================================
Files 597 600 +3
Lines 69014 69149 +135
===========================================
+ Hits 38855 38983 +128
- Misses 26812 26830 +18
+ Partials 3347 3336 -11
Continue to review full report at Codecov.
|
JekaMas
approved these changes
Jul 13, 2022
0xKrishna
approved these changes
Jul 15, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is the second step towards reducing reorgs and is a part of RFC35. Refer #386 for the first step.
It adds more functionality to the previously added checkpoint whitelist service. It performs some additional checks during the chain insertion process. The forkchoice module is responsible for checking against any incoming chain if we need to reorg or not using the
ReorgNeededfunction. It basically compared the total difficulty of the local chain and remote incoming chain. This PR adds some additional prevention by introducing aValidateReorgwhich calls the checkpoint whitelist service to validate the chain. Some important validations are given below.A minor modification over last iteration is that we now fetch N (latest) checkpoint entries instead of 1 in the first run to handle some sync cases for the client. Later on, the subsequent iterations only fetch 1 (latest) entry from heimdall.
This will ideally prevent the node to get reorged to some wrong/invalid fork and will maintain consistency. Sufficient unit tests are added and devnet testing has been carried on for the same.