HomePhabricator

[avalanche] Fix incomplete testing of contenders when staking rewards are active

Description

[avalanche] Fix incomplete testing of contenders when staking rewards are active

Summary:
Version of D18003 rebased on D18033.
Depends on D18033.

D17997 erroneously asserts ACCEPTED for all contenders which is obviously wrong. I mistakenly assumed the contenders test was being run on the diff but it turns out contenders just barely exceeds the cutoff timing.

This diff does a few things:

  1. After the node is restarted, but before a new block is mined, check staking rewards status and use that to verify avalanche status of contenders.
  2. Activate staking rewards predictably and invalidate contenders for each block. This ensures the vote statuses are predictable and we get the same results on CI and local dev.

Test Plan:
Verify the test is not flaky:

for I in {0..20} do ; ./test/functional/test_runner.py abc_p2p_avalanche_contender_voting || break ; done

And have the bot run extended tests on this diff.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: roqqit

Differential Revision: https://reviews.bitcoinabc.org/D18036

Details

Provenance
FabienAuthored on Thu, May 1, 17:04
roqqitCommitted on Thu, May 1, 18:22
roqqitPushed on Thu, May 1, 18:22
Reviewer
Restricted Project
Differential Revision
D18036: [avalanche] Fix incomplete testing of contenders when staking rewards are active
Parents
rABC19fd8b8c6ea2: [test] Assert the exact list of contenders to be polled in…
Branches
Unknown
Tags
Unknown