Page MenuHomePhabricator

[avalanche] Streamline API for setting manual stake winners to contender cache
ClosedPublic

Authored by roqqit on Oct 18 2024, 16:01.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC42af549c25df: [avalanche] Streamline API for setting manual stake winners to contender cache
Summary

This more closely matches Processor::setStakingRewardWinners which will help eliminate unnecessary logic that loops over new winners to add them to the cache. When the cache is ready to be populated, this line can be dropped into setStakingRewardWinners() with minimal other changes:

stakeContenderCache.setWinners(pprev, payouts);
Test Plan
ninja check-avalanche-stakecontendercache_tests

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 18 2024, 16:01
roqqit requested review of this revision.Oct 18 2024, 16:01
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/stakecontendercache.h
67

This could probably be passed by value instead of a const ref, and moved (could be on processor as well). But let's do this in another diff if the API makes it possible.

This revision is now accepted and ready to land.Oct 19 2024, 07:52