Page MenuHomePhabricator

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

Authored by Fabien on Wed, Apr 30, 20:01.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
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.
  3. Skip the very end of the test for now. This part is still flaky and needs more investigation, but master has been red for too long. It is best if we make it green again and fixup the last part in a separate diff.
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.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
arcpatch-D18003
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33186
Build 65855: Build Diffbuild-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang
Build 65854: arc lint + arc unit