Skip to content

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

Merged
317787106 merged 28 commits intotronprotocol:release_v4.7.2from
317787106:feature/isolate
Mar 30, 2023
Merged

feat(net): add strategy to acquire effective peer if needed#5088
317787106 merged 28 commits intotronprotocol:release_v4.7.2from
317787106:feature/isolate

Conversation

@317787106
Copy link

@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

jiangyuanshu added 28 commits March 16, 2023 18:09
@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.

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