nethermind icon indicating copy to clipboard operation
nethermind copied to clipboard

Fix peer dropped randomly

Open asdacap opened this issue 3 years ago • 1 comments

In DropUselessPeers, peer with lowest head number is dropped. With FCU peer refreshing, all peer that is not dropped, have the same head number. This causes the peer that get dropped to be random as the backing store is a concurrent dictionary.

Changes:

  • Use latency as last comparison.

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • [X] Bugfix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation Update
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] Other (please describe):

Testing

Requires testing

  • [X] Yes
  • [ ] No

In case you checked yes, did you write tests??

  • [ ] Yes
  • [X] No

Running smoke

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

asdacap avatar Sep 27 '22 09:09 asdacap

All four smoke test synced to processing. Nothing unusual with peer number.

asdacap avatar Sep 28 '22 01:09 asdacap