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. Since avalanche will be voting on stake winners in a non-exclusive manner, we need a way to track stake contenders in such a way that will converge on a few winners. 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