RFC35/Common Ancestor Approach#386
Merged
Merged
Conversation
…2.15-beta3-candidate
* Bump Go version to v1.18.1
This will create a static build using Go native networking stack. Checked and it works stable for all archs and distros.
Codecov Report
@@ Coverage Diff @@
## master #386 +/- ##
==========================================
- Coverage 56.75% 56.65% -0.10%
==========================================
Files 578 580 +2
Lines 68312 68428 +116
==========================================
- Hits 38771 38770 -1
- Misses 26182 26293 +111
- Partials 3359 3365 +6
Continue to review full report at Codecov.
|
JekaMas
reviewed
May 12, 2022
JekaMas
reviewed
Jun 2, 2022
JekaMas
reviewed
Jun 2, 2022
JekaMas
reviewed
Jun 2, 2022
| return 0, common.Hash{}, errEndBlock | ||
| } | ||
|
|
||
| hash := fmt.Sprintf("%v", block["hash"]) |
52562d3 to
b19d5e1
Compare
temaniarpit27
approved these changes
Jun 6, 2022
JekaMas
approved these changes
Jun 6, 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 first step towards reducing reorgs and is a part of RFC35.
It adds a new background service called checkpoint whitelist which keeps running and asks it's heimdall for the latest checkpoint entries. Similar to the
--whitelistflag, it stores the<block number> -> <block hash>mapping. The interesting part is that it leverages the heimdall checkpoints for making these entries. Basically it adds every end block number to end block hash entry to this in memory map (which is capped to 10).This is to prevent the node to connect to wrong/invalid peers which are not on the correct fork. We decide that before even asking the peer for new blocks i.e. in the
findAncestorfunction in downloader. Basically, we ask for the last checkpointed block of ours from the peer. If we're able to validate the details, then and then only we'll allow that peer to connect. In case of mismatch, we will eventually drop or stall the peer until it has relevant and correct blocks.Sufficient unit tests are added and devnet testing has been carried on for the same. The next step is to make modifications in the forkchoice rule. Refer #425 for the next step.