Page MenuHomePhabricator

[avalanche] Introduce a datastructure to keep track of peers
ClosedPublic

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

Details

Summary

This implement an utility that can select a peer with a probability depending on its score. The higher the score, the more likely that peer is to be chosen.

Obviously, this is not usable as this because it exposes index from internal datastructures, but this much allows to check the algorithm are correct and constitue a useful unit of work.

Test Plan
ninja all check-avalanche

Diff Detail

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

Event Timeline

deadalnix created this revision.Mon, Jun 29, 20:12
Herald added a reviewer: Restricted Project. · View Herald TranscriptMon, Jun 29, 20:12
deadalnix requested review of this revision.Mon, Jun 29, 20:12
jasonbcox accepted this revision.Mon, Jun 29, 21:51
jasonbcox added a subscriber: jasonbcox.

This change seems fine, but there isn't enough info in the summary to get a good picture for why this particular implementation was selected over other possible implementations. Regardless, it appears to do some job and is tested.

Also, there are many typos or grammar issues in the comments, but I won't block on these.

This revision is now accepted and ready to land.Mon, Jun 29, 21:51