Page MenuHomePhabricator

[avalanche] Re-sort pollable contenders by reward rank
Needs RevisionPublic

Authored by roqqit on Wed, Jan 8, 22:39.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

In the initial sorting step, it is important to retain as many accepted contenders as possible. However, the accepted contenders sorting first gives no useful information to the caller. Re-sorting by reward rank ensures the best contender is first. In the Processor, we will use this to then accept the highest ranking contender (even if it was not the local stake winner).

An alternative approach would be to return the best contender ID in addition to pollable contenders list, but this API is less intuitive and the implementation gives no benefits in simplicity.

Test Plan
ninja check-avalanche

Diff Detail

Event Timeline

roqqit requested review of this revision.Wed, Jan 8, 22:39
Fabien requested changes to this revision.Thu, Jan 9, 09:30
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/stakecontendercache.cpp
200

This is defined below as numPollable

This revision now requires changes to proceed.Thu, Jan 9, 09:30