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.
[syncer] Forgetting non-Dogechain protocol peer (#271)
# Description Currently, peers will discover and connect to non-Dogechain peers, which is frustrating and extremely draining of connection resources. The PR fixes it by forgetting (disconnect and remove it from store) the peer which is not supporting Dogechain `syncer` protocol. Also, we print out the node ID that is currently syncing in `eth_syncing` endpoint and update its progress when the node status is updated. # 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 * Start a new MainNet node from Genesis block. * Observe its peers protocol list. * `dogechain peers list | grep "=" | awk '{print $3}' | while read p; do dogechain peers status --peer-id $p; done` * Observe its log. * Observe its syncing status. * `curl -X POST http://localhost:8545 -d '{"id": 0, "jsonrpc":"2.0", "method": "eth_syncing", "params": []}'` PR branch result: * The connected nodes all support the Dogechain `syncer` protocol. * There are some `forget peer` in the log. * Return correct and upgraded progression. Base branch result: * Due to unfiltered protocol reply discovery, connected peers contain some non-Dogechain peers. * No and never "forget" any peer in the log. * Print out unobtrusive and sometimes erroneous sync status. * The connected peers contain some non-Dogechain peers due to unfiltered protocol reply discovery. * No and never 'forget' any peer in the log. * Progress sometimes go wrong. # Documentation update Should update official documentation once the version bumped.
- Loading branch information
1 parent
feb1600
commit b192cda
Showing
11 changed files
with
142 additions
and
19 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
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
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