forked from 0xPolygon/polygon-edge
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sycner] Remove different network peer (#239)
# Description The remote peer was not removed even if it was another (private) network, and it might bring annoying messages to current node. The PR fixes the issue, disconnect those different network peers, and gives a more reasonable way of finding `BestPeer`: compare distance when peers' block numbers are same. # Changes include - [x] Bugfix (non-breaking change that solves an issue) - [x] New feature (non-breaking change that adds functionality) ## Testing - [x] I have tested this code with the official test suite - [x] I have tested this code manually ### Manual tests 1. Deploy a 4-nodes pos network, but only bring up 3 nodes. 2. Modify the last node with different `portland` hard fork height in `Genesis`. 3. Bring the last node up. The PR branch node would reject the block and disconnect peers. In contrast, the base branch node do not disconnect peers, but instead try to query blocks over and over.
- Loading branch information
1 parent
eeae5b4
commit 7e051a9
Showing
4 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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