[syncer] Forgetting non-Dogechain protocol peer #271
Merged
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.
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
Testing
Manual tests
dogechain peers list | grep "=" | awk '{print $3}' | while read p; do dogechain peers status --peer-id $p; done
curl -X POST http://localhost:8545 -d '{"id": 0, "jsonrpc":"2.0", "method": "eth_syncing", "params": []}'
PR branch result:
syncer
protocol.forget peer
in the log.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.