Page MenuHomePhabricator

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

Authored by roqqit on Wed, Apr 30, 20:01.

Details

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.

Diff Detail

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

Event Timeline

The last test is no longer flaky

Fabien published this revision for review.Thu, May 1, 12:48
roqqit requested changes to this revision.Thu, May 1, 16:11
roqqit added a subscriber: roqqit.
roqqit added inline comments.
test/functional/abc_p2p_avalanche_contender_voting.py
672 ↗(On Diff #53813)

I had not updated this comment in my earlier draft

687–688 ↗(On Diff #53813)

we should include the last old_quorum proof for completeness. this is another error from my old draft

729 ↗(On Diff #53813)
735 ↗(On Diff #53813)
798 ↗(On Diff #53813)
This revision now requires changes to proceed.Thu, May 1, 16:11
Fabien planned changes to this revision.Thu, May 1, 16:39
roqqit edited reviewers, added: Fabien; removed: roqqit.

cleanup remaining issues from old draft

This revision is now accepted and ready to land.Thu, May 1, 18:04