Page MenuHomePhabricator

[avalanche] Add a way to get stake contender vote status
ClosedPublic

Authored by roqqit on Oct 1 2024, 22:30.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC52b9f0503a48: [avalanche] Add a way to get stake contender vote status
Summary

This adds logic for determining the avalanche vote result based on the contents of the cache.

Note that the loop in the rejection case should not adversely impact performance since manual winners should be empty by default and user action would typically only introduce a handful of additional winners.

Test Plan
ninja check-avalanche-stakecontendercache_tests

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 1 2024, 22:30
roqqit requested review of this revision.Oct 1 2024, 22:30
Fabien requested changes to this revision.Oct 2 2024, 08:28
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/stakecontendercache.cpp
134 ↗(On Diff #49881)

This is rejecting contenders that are not accepted but in the winner set. Is that the expected behavior ?

This revision now requires changes to proceed.Oct 2 2024, 08:28
roqqit requested review of this revision.Oct 2 2024, 16:14
roqqit added inline comments.
src/avalanche/stakecontendercache.cpp
134 ↗(On Diff #49881)

Yes, and its needed for convergence. The only scenario where this happens is some nodes' local winner has been rejected by avalanche (local winner is the only contender that is initialized as in winner set). Those nodes will continue to accept blocks with their local winner until that winner has become invalidated, but they will still help the network converge on some final state.

This revision is now accepted and ready to land.Oct 3 2024, 17:17