Page MenuHomePhabricator

[avalanche] Set all local stake winners as accepted contenders
ClosedPublic

Authored by roqqit on Fri, Jan 10, 00:02.

Details

Summary

This is more robust than just accepting the first local winner, especially in the event the network becomes poorly connected.

Test Plan

Make sure the test is not flaky:

for I in {1..30}; do ninja check-avalanche-processor_tests || break ; done

Diff Detail

Event Timeline

roqqit requested review of this revision.Fri, Jan 10, 00:02

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-01-10T00:05:56.924000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250110_000444/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:06:04.571000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 174, in run_test
    assert_response([AvalancheVote(expectedVote, contender_id)])
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 92, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=b3a693df4158bcc587d08d408afc6dce6b23246752a4f11183af9ede851e665c) == AvalancheVote(error=1, hash=b3a693df4158bcc587d08d408afc6dce6b23246752a4f11183af9ede851e665c))
2025-01-10T00:06:04.623000Z TestFramework (INFO): Stopping nodes
2025-01-10T00:06:04.874000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250110_000444/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:06:04.874000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250110_000444/abc_p2p_avalanche_contender_voting_65/test_framework.log
2025-01-10T00:06:04.874000Z TestFramework (ERROR): 
2025-01-10T00:06:04.875000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_🏃_20250110_000444/abc_p2p_avalanche_contender_voting_65' to consolidate all logs
2025-01-10T00:06:04.875000Z TestFramework (ERROR): 
2025-01-10T00:06:04.875000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-01-10T00:06:04.875000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-01-10T00:06:04.875000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche_contender_voting.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-01-10T00:06:43.988000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000438/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:06:52.104000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 174, in run_test
    assert_response([AvalancheVote(expectedVote, contender_id)])
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 92, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=c56e2566724db3ab9920ad30f8cb240293b8bb14f34253bfb0d56a1b3e4c5395) == AvalancheVote(error=1, hash=c56e2566724db3ab9920ad30f8cb240293b8bb14f34253bfb0d56a1b3e4c5395))
2025-01-10T00:06:52.155000Z TestFramework (INFO): Stopping nodes
2025-01-10T00:06:52.557000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000438/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:06:52.557000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000438/abc_p2p_avalanche_contender_voting_65/test_framework.log
2025-01-10T00:06:52.557000Z TestFramework (ERROR): 
2025-01-10T00:06:52.557000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000438/abc_p2p_avalanche_contender_voting_65' to consolidate all logs
2025-01-10T00:06:52.557000Z TestFramework (ERROR): 
2025-01-10T00:06:52.557000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-01-10T00:06:52.557000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-01-10T00:06:52.557000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-01-10T00:10:34.643000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000902/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:10:43.000000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 174, in run_test
    assert_response([AvalancheVote(expectedVote, contender_id)])
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 92, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=d5145801f97a7f688803c9f2e38a7891ea5188647f1801a7270e1b080a409bfd) == AvalancheVote(error=1, hash=d5145801f97a7f688803c9f2e38a7891ea5188647f1801a7270e1b080a409bfd))
2025-01-10T00:10:43.051000Z TestFramework (INFO): Stopping nodes
2025-01-10T00:10:43.403000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000902/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:10:43.403000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000902/abc_p2p_avalanche_contender_voting_65/test_framework.log
2025-01-10T00:10:43.403000Z TestFramework (ERROR): 
2025-01-10T00:10:43.403000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_🏃_20250110_000902/abc_p2p_avalanche_contender_voting_65' to consolidate all logs
2025-01-10T00:10:43.403000Z TestFramework (ERROR): 
2025-01-10T00:10:43.403000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-01-10T00:10:43.403000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-01-10T00:10:43.403000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche_contender_voting.py
Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_contender_voting.py

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche_contender_voting.py ======

------- Stdout: -------
2025-01-10T00:11:40.923000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250110_000825/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:11:51.299000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 174, in run_test
    assert_response([AvalancheVote(expectedVote, contender_id)])
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 92, in assert_response
    assert_equal(repr(votes[i]), repr(expected[i]))
  File "/work/test/functional/test_framework/util.py", line 56, in assert_equal
    raise AssertionError(
AssertionError: not(AvalancheVote(error=0, hash=2547fd182a34155fc9468b9378463526e661e97f52957fa97f4da320f70a86c4) == AvalancheVote(error=1, hash=2547fd182a34155fc9468b9378463526e661e97f52957fa97f4da320f70a86c4))
2025-01-10T00:11:51.350000Z TestFramework (INFO): Stopping nodes
2025-01-10T00:11:51.503000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250110_000825/abc_p2p_avalanche_contender_voting_65
2025-01-10T00:11:51.503000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250110_000825/abc_p2p_avalanche_contender_voting_65/test_framework.log
2025-01-10T00:11:51.503000Z TestFramework (ERROR): 
2025-01-10T00:11:51.503000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250110_000825/abc_p2p_avalanche_contender_voting_65' to consolidate all logs
2025-01-10T00:11:51.503000Z TestFramework (ERROR): 
2025-01-10T00:11:51.503000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-01-10T00:11:51.503000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-01-10T00:11:51.503000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche_contender_voting.py

roqqit planned changes to this revision.Fri, Jan 10, 00:15

Bump mocktime beyond the max registration time so there is not a bunch of flaky winners in the functional test

Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/test/processor_tests.cpp
2598 ↗(On Diff #52095)

each proof has a 1/9 chance to be picked so running 5 times means it will fail once every 9⁵ = 59049 times which is a bit low to my taste

This revision is now accepted and ready to land.Fri, Jan 10, 10:16