Page MenuHomePhabricator

[avalanche] Simplify contenders by treating rejection and invalidation the same
ClosedPublic

Authored by roqqit on Feb 26 2025, 22:34.

Details

Summary

This provides a stronger guarantee that once a contender is finalized, it will never be reverted, even if the system managed to re-poll a finalized contender. We don't really care that invalidated contenders do not get removed from the winner set so long as blocks get mined with staking rewards going to a finalized contender.

Test Plan
ninja check check-functional

Diff Detail

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

Event Timeline

roqqit requested review of this revision.Feb 26 2025, 22:34
Fabien requested changes to this revision.Feb 27 2025, 08:19
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/test/stakecontendercache_tests.cpp
249 ↗(On Diff #52789)

This one should still be valid, just use reject instead of invalidate

262 ↗(On Diff #52789)

It's worth testing the actual behavior, aka rejecting does not undo finalization

This revision now requires changes to proceed.Feb 27 2025, 08:19
roqqit requested review of this revision.Feb 27 2025, 18:29
roqqit added inline comments.
src/avalanche/test/stakecontendercache_tests.cpp
249 ↗(On Diff #52789)

This is already handled by the reject case above since each proof has a different state.

262 ↗(On Diff #52789)

This is already handled by the reject case above since each proof has a different state.

Fabien requested changes to this revision.Feb 27 2025, 20:25
Fabien added inline comments.
src/avalanche/test/stakecontendercache_tests.cpp
262 ↗(On Diff #52789)

Not this one ? There is no check for rejection after a finalization

This revision now requires changes to proceed.Feb 27 2025, 20:25

re-add and fixup test case for invalidation after finalization

This revision is now accepted and ready to land.Feb 27 2025, 21:20
This revision was landed with ongoing or failed builds.Feb 27 2025, 21:25
This revision was automatically updated to reflect the committed changes.