[avalanche] Add a cache for avalanche voting results of stake contenders
Summary:
It is not possible to guarantee knowledge of the entire proof set with avalanche. As such, converging on exactly one stake winner is not possible in all scenarios. We need a way to track stake contenders in such a way that will converge on as few winners as possible. This is the first piece of a cache to achieve that.
The cache also tracks manually added stake winners (ie. via RPC) since there is currently no memory of past stake winners once a new block is found. This memory is important so that nodes can reply to stake contender avalanche requests of recent past blocks (we cannot guarantee the entire network has finalized the same block in lock step).
Missing pieces that will appear in future diffs include cleanup of past blocks and integration with avalanche voting.
Depends on D16694
Test Plan:
ninja check-avalanche
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16695