Page MenuHomePhabricator

[avalanche] Add the ability to remove and rescore peers

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


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

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

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Mon, Jun 29, 20:38
Herald added a reviewer: Restricted Project. · View Herald TranscriptMon, Jun 29, 20:38
deadalnix requested review of this revision.Mon, Jun 29, 20:38
jasonbcox requested changes to this revision.Mon, Jun 29, 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.Mon, Jun 29, 21:48
deadalnix requested review of this revision.Tue, Jun 30, 00:16

It gives you how much "space" is taken in term of slots but not allocated to any slot. See

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.

jasonbcox accepted this revision.Tue, Jun 30, 01:02

Ok. Seems I was on the right track.

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