Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(net): add strategy to acquire effective peer if needed #5088

Merged
merged 28 commits into from
Mar 30, 2023

Conversation

317787106
Copy link
Contributor

@317787106 317787106 commented Mar 23, 2023

What does this PR do?

Add a new strategy that check if the node is isolated; if so, then try to acquire an effective peer.

Why are these changes required?

Sometimes, all peers of one node need to sync from it, then the node is called isolated island. This node's head block number doesn't grow, we need to find an effective peer to sync and broadcast messages.

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@317787106 317787106 changed the title Feature/isolate feat(net): add one strategy to get an effective peer if needs Mar 23, 2023
@317787106 317787106 changed the base branch from feature/libp2p_v2.0 to release_v4.7.2 March 29, 2023 07:30
@317787106 317787106 marked this pull request as ready for review March 29, 2023 08:24
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 46.90265% with 60 lines in your changes missing coverage. Please review.

Project coverage is 54.97%. Comparing base (d4c2761) to head (29ac079).
Report is 253 commits behind head on release_v4.7.2.

Files with missing lines Patch % Lines
...e/net/service/effective/EffectiveCheckService.java 45.34% 40 Missing and 7 partials ⚠️
...n/core/net/service/handshake/HandshakeService.java 0.00% 7 Missing ⚠️
.../src/main/java/org/tron/core/config/args/Args.java 50.00% 3 Missing and 1 partial ⚠️
...ava/org/tron/common/parameter/CommonParameter.java 50.00% 1 Missing ⚠️
...in/java/org/tron/core/net/P2pEventHandlerImpl.java 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             release_v4.7.2    #5088      +/-   ##
====================================================
+ Coverage             54.80%   54.97%   +0.17%     
- Complexity             8278     8331      +53     
====================================================
  Files                   843      844       +1     
  Lines                 49929    50027      +98     
  Branches               5513     5520       +7     
====================================================
+ Hits                  27362    27502     +140     
+ Misses                20394    20340      -54     
- Partials               2173     2185      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@317787106 317787106 changed the title feat(net): add one strategy to get an effective peer if needs feat(net): add strategy to acquire effective peer if needed Mar 30, 2023
@317787106 317787106 merged commit e88bf90 into tronprotocol:release_v4.7.2 Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants