HomePhabricator

[avalanche] Re-sort pollable contenders by reward rank

Description

[avalanche] Re-sort pollable contenders by reward rank

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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17498

Details

Provenance
roqqitAuthored on Wed, Jan 8, 22:33
roqqitPushed on Thu, Jan 9, 21:30
Reviewer
Restricted Project
Differential Revision
D17498: [avalanche] Re-sort pollable contenders by reward rank
Parents
rABCdbf5c9e950da: [chronik] actually run the functional test for blockchain.transaction.get_height
Branches
Unknown
Tags
Unknown