Page MenuHomePhabricator

[avalanche] Order the peer set by score
AcceptedPublic

Authored by Fabien on Fri, Sep 3, 11:59.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Summary

This diff adds an ordered view to the peer set so that highest scores are placed first. The goal is to limit the number of peers in the pool, and this change makes it easy to trim the peers by score once we reached that limit.

Another diff will cache the score so it's not recomputed every time when it's not needed.

Test Plan
ninja check-avalanche

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_peers_ordered_by_score
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16542
Build 32946: Build Diffbuild-diff · build-clang-tidy · build-without-wallet · lint-circular-dependencies · build-clang · build-debug
Build 32945: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Fri, Sep 3, 11:59
This revision is now accepted and ready to land.Fri, Sep 3, 14:46

Improve the test variable name and make it easier to read what is the expected ordering. No change in behavior.

Fabien added a child revision: Restricted Differential Revision.Fri, Sep 3, 20:29