Page MenuHomePhabricator

[avalanche] Add the ability to remove and rescore peers
ClosedPublic

Authored by deadalnix on Jun 29 2020, 20:38.

Details

Reviewers
jasonbcox
Group Reviewers
Restricted Project
Commits
rABC130a15b2b73b: [avalanche] Add the ability to remove and rescore peers
Summary

These are useful operations.

The PeerManager curently doesn't care about internal fragmentation. In practice, this isn't a big deal because algorithm used are at worst log, and at best constant time. This still needs to be fixed eventually, and fragmentation is being tracked in order to do so.

Depends on D6772

Test Plan
ninja all check-avalanche

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jasonbcox requested changes to this revision.Jun 29 2020, 21:48
jasonbcox added a subscriber: jasonbcox.

What does this fragmentation score give you in the future? It's not clear what this is building towards and the rest of the stack does not clarify in regards to the fragmentation. Since the fragmentation is essentially a loosely-tracked sum of gaps between entries, is it intended as a cleanup trigger once the sum exceeds some threshold? If not, then how will it be used?

This revision now requires changes to proceed.Jun 29 2020, 21:48

It gives you how much "space" is taken in term of slots but not allocated to any slot. See https://en.wikipedia.org/wiki/Fragmentation_(computing)

If there is too much empty space, then the slot you pick has a higher chance of being unallocated, causing you to have to redraw numbers again and again until you find some space that is allocated. We might want to compact things once in a while going forward when fragmentation gets high, but that's not really a priority to move this forward.

Ok. Seems I was on the right track.

This revision is now accepted and ready to land.Jun 30 2020, 01:02