Page MenuHomePhabricator

[avalanche] Don't poll or vote definitively until we have quorum.
ClosedPublic

Authored by tyler-smith on Feb 23 2022, 16:40.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABCafbc6938291d: [avalanche] Don't poll or vote definitively until we have quorum.
Summary

Add parameters to the Avalanche Processor that control how we decide if a quorum is available. Until a quorum is established, don't send polls and when polled always vote UNKNOWN.

Parameters added are the minimum amount of stake across the Avalanche network that must be present, and the ratio of that stake that we must have connections to.

The default parameters are set to 0 so that existing tests, written against an automatic quorum, continue to pass. These defaults and tests will be updated in a follow-on revision later.

Depends on D11181

Test Plan

ninja check-avalanche

Diff Detail

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

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Fabien requested changes to this revision.Mar 14 2022, 11:03

I don't this the approach makes sense, this causes duplicates and does inefficient computation.

Here is my suggestion:

  • You can compute the sums on the fly in the peer manager, so you only have a few additions/subtractions do to at a time
  • This computation can be its own diff, with unit tests, and checked in the PeerManager::verify() method to guarantee a good coverage
  • The Processor::isQuorumAvailable() should be free to call (not O(n)), just returning a bool. This bool can be latched (see my below comment), and can also be unit tested.
  • The Processor::isQuorumAvailable() can then be called each time you need to check if the quorum is ready, without the need for the periodic check at all. This is where you need to introduce the functional tests.
src/avalanche/avalanche.h
9 ↗(On Diff #32687)

nit: newline before the system libs

76 ↗(On Diff #32687)

It doesn't check an interval, the name is poorly chosen. If it's an accessor then use get***

src/avalanche/processor.cpp
696 ↗(On Diff #32687)

This implies that we can lose the ability to poll if a node disconnects for example. Is that the intended behavior ? It seems to me that latching the flag makes more sense

781 ↗(On Diff #32687)

This is a hint that this calculation needs to happen in the peer manager since it doesn't involve the processor at all

src/avalanche/proof.cpp
108 ↗(On Diff #32687)

You can split this out in its own diff

src/net_processing.cpp
5036 ↗(On Diff #32687)

This is duplicated from the processor for no reason

This revision now requires changes to proceed.Mar 14 2022, 11:03

Redesign to use pre-computed score amounts from D11181.

Failed tests logs:

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

------- Stdout: -------
2022-03-16T10:23:19.908000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220316_101722/abc_p2p_avalanche_quorum_201
2022-03-16T10:23:20.161000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 501, in start_nodes
    node.wait_for_rpc_connection()
  File "/work/test/functional/test_framework/test_node.py", line 307, in wait_for_rpc_connection
    'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 135, in main
    self.setup()
  File "/work/test/functional/test_framework/test_framework.py", line 271, in setup
    self.setup_network()
  File "/work/test/functional/test_framework/test_framework.py", line 372, in setup_network
    self.setup_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 397, in setup_nodes
    self.start_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 504, in start_nodes
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized
2022-03-16T10:23:20.214000Z TestFramework (INFO): Stopping nodes
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_quorum.py", line 113, in <module>
    AvalancheQuorumTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 156, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 286, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized

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

Failed tests logs:

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

------- Stdout: -------
2022-03-16T10:24:44.645000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220316_102230/abc_p2p_avalanche_quorum_201
2022-03-16T10:24:44.897000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 501, in start_nodes
    node.wait_for_rpc_connection()
  File "/work/test/functional/test_framework/test_node.py", line 307, in wait_for_rpc_connection
    'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 135, in main
    self.setup()
  File "/work/test/functional/test_framework/test_framework.py", line 271, in setup
    self.setup_network()
  File "/work/test/functional/test_framework/test_framework.py", line 372, in setup_network
    self.setup_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 397, in setup_nodes
    self.start_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 504, in start_nodes
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized
2022-03-16T10:24:44.949000Z TestFramework (INFO): Stopping nodes
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_quorum.py", line 113, in <module>
    AvalancheQuorumTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 156, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 286, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized

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

Failed tests logs:

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

------- Stdout: -------
2022-03-16T10:23:07.922000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220316_101850/abc_p2p_avalanche_quorum_201
2022-03-16T10:23:08.174000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 501, in start_nodes
    node.wait_for_rpc_connection()
  File "/work/test/functional/test_framework/test_node.py", line 307, in wait_for_rpc_connection
    'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 135, in main
    self.setup()
  File "/work/test/functional/test_framework/test_framework.py", line 271, in setup
    self.setup_network()
  File "/work/test/functional/test_framework/test_framework.py", line 372, in setup_network
    self.setup_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 397, in setup_nodes
    self.start_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 504, in start_nodes
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized
2022-03-16T10:23:08.226000Z TestFramework (INFO): Stopping nodes
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_quorum.py", line 113, in <module>
    AvalancheQuorumTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 156, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 286, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized
====== Bitcoin ABC functional tests with the next upgrade activated: abc_p2p_avalanche_quorum.py ======

------- Stdout: -------
2022-03-16T10:27:20.423000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220316_102311/abc_p2p_avalanche_quorum_201
2022-03-16T10:27:20.675000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 501, in start_nodes
    node.wait_for_rpc_connection()
  File "/work/test/functional/test_framework/test_node.py", line 307, in wait_for_rpc_connection
    'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 135, in main
    self.setup()
  File "/work/test/functional/test_framework/test_framework.py", line 271, in setup
    self.setup_network()
  File "/work/test/functional/test_framework/test_framework.py", line 372, in setup_network
    self.setup_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 397, in setup_nodes
    self.start_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 504, in start_nodes
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized
2022-03-16T10:27:20.726000Z TestFramework (INFO): Stopping nodes
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_quorum.py", line 113, in <module>
    AvalancheQuorumTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 156, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 286, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 520, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 438, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/test_node.py", line 232, in __getattr__
    "Error: RPC not initialized")
AssertionError: [node 0] Error: RPC not initialized

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

Fabien requested changes to this revision.Mar 16 2022, 14:11

Tests are failing, back to your queue

This revision now requires changes to proceed.Mar 16 2022, 14:11
src/avalanche/avalanche.h
9 ↗(On Diff #32743)

newline

test/functional/abc_p2p_avalanche_quorum.py
28 ↗(On Diff #32743)

Likely the culprit

Fix tests and rebase onto latest D11118.

Fabien requested changes to this revision.Mar 17 2022, 09:01

You need to fill the diff summary and remove the WIP from the title

src/avalanche/avalanche.h
55 ↗(On Diff #32779)

Add a FIXME to this comment line

57 ↗(On Diff #32779)

Amount::zero()

src/avalanche/processor.cpp
764 ↗(On Diff #32779)

It's worth adding a unit test for this as well, and check the edges cases (including latching)

781 ↗(On Diff #32779)

I'm not sure about the logs here. This can be called very frequently until the quorum is established so this might bloat the logs, but on the other hand it's not printed by default and only if the avalanche debug is enabled... I leave that up to you

src/avalanche/processor.h
159 ↗(On Diff #32779)

This can be read and set from different theads (Processor::runEventLoop() and PeerManager::ProcessMessage()). This needs to be protected, an atomic is likely the best solution here.

214 ↗(On Diff #32779)

const

src/net_processing.cpp
5021 ↗(On Diff #32779)

const bool

This revision now requires changes to proceed.Mar 17 2022, 09:01
src/avalanche/processor.h
214 ↗(On Diff #32779)

If this is const, we can mark quorumIsEstablished for the latch. We could put the checking logic in a const method and wrap it in a non-const method that does the latch handling but not sure if that's worth it. What do you think?

Fix all review items except marking isQuorumEstablished as const, pending discussion.

tyler-smith retitled this revision from [avalanche] WIP: Don't poll or vote definitively until we have quorum. to [avalanche] Don't poll or vote definitively until we have quorum..Mar 18 2022, 06:01
tyler-smith edited the summary of this revision. (Show Details)
tyler-smith edited the summary of this revision. (Show Details)
tyler-smith added inline comments.
src/avalanche/test/processor_tests.cpp
35 ↗(On Diff #32822)

@Fabien I need to be able to get the peerid in tests for isQuorumEstablished, and am not sure how to do that without copying this logic to be in scope. How would you solve this?

The best idea I have so far is to put the logic in the PeerManager, and re-implement the latching/check in the Processor and have it delegate to PeerManager for the core logic.

src/avalanche/processor.h
214 ↗(On Diff #32779)

You're correct I missed the quorumIsEstablished flag is a member, just leave it non const as is

src/avalanche/test/processor_tests.cpp
35 ↗(On Diff #32822)

I'm not sure you need the peer id here. My assumption is that you want it so you can call removePeer(peerid) is that correct ?
If so you can work around it easily by moving the coins (i.e. remove it from the coin cache, this is done in several places in the peermanager_tests, search for SpendCoin()) from the proof to invalidate and call peermanager->updatedBlockTip() so it gets invalidated and the associated peer removed. This can eventually be double checked by calling isBoundToPeer or isOrphan after that

1225 ↗(On Diff #32822)

You can use ToString() from util/string.h instead to fix the linter

Fix remaining feedback, fix locale issues, and use proof orphaning to remove peers instead of needing their ids.

Fabien requested changes to this revision.Mar 21 2022, 09:40

Mostly nits remaining.
Can you also update the summary to explain that the default parameters are temporary 0 and will be updated in a follow-up together with the tests ?

src/avalanche/processor.cpp
261 ↗(On Diff #32868)

check ratio is <= 1 as well ?

src/avalanche/test/peermanager_tests.cpp
36 ↗(On Diff #32868)

Just leave this as is. You're not touching the peermanager here, so no need to add unrelated refactors to this diff. You can do this as a follow up if you want to.

src/avalanche/test/processor_tests.cpp
1215 ↗(On Diff #32868)

You want to test the error cases as well, they're just as important as the happy path

1219 ↗(On Diff #32868)

Nit: BOOST_CHECK(processor != nullptr) first

test/functional/abc_p2p_avalanche_quorum.py
31 ↗(On Diff #32868)

Why is that needed ?

66 ↗(On Diff #32868)

You can simplify a bit:

coinbase_key = node.get_deterministic_priv_key().key
blocks = node.generate(num_quorum_peers)

then use coinbase_key directly instead of coinbase_key.key

This revision now requires changes to proceed.Mar 21 2022, 09:40

Address feedback. Add range checks to params, add failure cases, simplify tests, and remove unrelated cleanup changes.

Tail of the build log:

[398/467] bitcoin: testing merkleblock_tests
[399/467] Running utility command for check-bitcoin-merkleblock_tests
[400/467] bitcoin: testing sighashtype_tests
[401/467] bitcoin: testing scheduler_tests
[402/467] bitcoin: testing script_commitment_tests
[403/467] Running utility command for check-bitcoin-scheduler_tests
[404/467] Running utility command for check-bitcoin-sighashtype_tests
[405/467] bitcoin: testing sync_tests
[406/467] Running utility command for check-bitcoin-script_commitment_tests
[407/467] bitcoin: testing txvalidationcache_tests
[408/467] Running utility command for check-bitcoin-sync_tests
[409/467] Running utility command for check-bitcoin-txvalidationcache_tests
[410/467] bitcoin: testing undo_tests
[411/467] bitcoin: testing util_threadnames_tests
[412/467] Running utility command for check-bitcoin-util_threadnames_tests
[413/467] Running utility command for check-bitcoin-undo_tests
[414/467] bitcoin: testing checkpoints_tests
[415/467] Running utility command for check-bitcoin-checkpoints_tests
[416/467] bitcoin: testing validationinterface_tests
[417/467] bitcoin: testing script_standard_tests
[418/467] Running utility command for check-bitcoin-validationinterface_tests
[419/467] Running utility command for check-bitcoin-script_standard_tests
[420/467] bitcoin: testing cuckoocache_tests
[421/467] Running utility command for check-bitcoin-cuckoocache_tests
[422/467] bitcoin: testing schnorr_tests
[423/467] Running utility command for check-bitcoin-schnorr_tests
[424/467] bitcoin: testing ismine_tests
[425/467] Running utility command for check-bitcoin-ismine_tests
[426/467] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[427/467] bitcoin: testing util_tests
[428/467] bitcoin: testing blockstatus_tests
[429/467] bitcoin: testing versionbits_tests
[430/467] Running utility command for check-bitcoin-util_tests
[431/467] Running utility command for check-bitcoin-blockstatus_tests
[432/467] Running utility command for check-bitcoin-versionbits_tests
[433/467] bitcoin: testing script_tests
[434/467] Running utility command for check-bitcoin-script_tests
[435/467] bitcoin: testing validation_tests
[436/467] Running utility command for check-bitcoin-validation_tests
[437/467] bitcoin: testing validation_block_tests
[438/467] bitcoin: testing crypto_tests
[439/467] Running utility command for check-bitcoin-validation_block_tests
[440/467] Running utility command for check-bitcoin-crypto_tests
[441/467] bitcoin: testing blockcheck_tests
[442/467] Running utility command for check-bitcoin-blockcheck_tests
[443/467] bitcoin: testing monolith_opcodes_tests
[444/467] Running utility command for check-bitcoin-monolith_opcodes_tests
[445/467] bitcoin: testing transaction_tests
[446/467] Running utility command for check-bitcoin-transaction_tests
[447/467] bitcoin: testing intmath_tests
[448/467] Running utility command for check-bitcoin-intmath_tests
[449/467] bitcoin: testing coinselector_tests
[450/467] Running utility command for check-bitcoin-coinselector_tests
[451/467] bitcoin: testing coins_tests
[452/467] Running utility command for check-bitcoin-coins_tests
[453/467] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

[391/460] bitcoin: testing sighashtype_tests
[392/460] bitcoin: testing scheduler_tests
[393/460] Running utility command for check-bitcoin-script_commitment_tests
[394/460] Running utility command for check-bitcoin-sighashtype_tests
[395/460] Running utility command for check-bitcoin-txvalidationcache_tests
[396/460] Running utility command for check-bitcoin-scheduler_tests
[397/460] bitcoin: testing sync_tests
[398/460] Running utility command for check-bitcoin-sync_tests
[399/460] bitcoin: testing checkqueue_tests
[400/460] bitcoin: testing undo_tests
[401/460] Running utility command for check-bitcoin-checkqueue_tests
[402/460] bitcoin: testing util_threadnames_tests
[403/460] Running utility command for check-bitcoin-undo_tests
[404/460] bitcoin: testing compilerbug_tests
[405/460] bitcoin: testing cuckoocache_tests
[406/460] Running utility command for check-bitcoin-util_threadnames_tests
[407/460] bitcoin: testing checkpoints_tests
[408/460] Running utility command for check-bitcoin-compilerbug_tests
[409/460] Running utility command for check-bitcoin-cuckoocache_tests
[410/460] Running utility command for check-bitcoin-checkpoints_tests
[411/460] bitcoin: testing blockcheck_tests
[412/460] bitcoin: testing validationinterface_tests
[413/460] bitcoin: testing script_standard_tests
[414/460] Running utility command for check-bitcoin-blockcheck_tests
[415/460] Running utility command for check-bitcoin-validationinterface_tests
[416/460] Running utility command for check-bitcoin-script_standard_tests
[417/460] bitcoin: testing blockstatus_tests
[418/460] bitcoin: testing schnorr_tests
[419/460] Running utility command for check-bitcoin-blockstatus_tests
[420/460] bitcoin: testing ismine_tests
[421/460] Running utility command for check-bitcoin-schnorr_tests
[422/460] bitcoin: testing transaction_tests
[423/460] Running utility command for check-bitcoin-ismine_tests
[424/460] Running utility command for check-bitcoin-transaction_tests
[425/460] bitcoin: testing versionbits_tests
[426/460] Running utility command for check-bitcoin-versionbits_tests
[427/460] Linking CXX executable src/qt/test/test_bitcoin-qt
[428/460] bitcoin: testing validation_block_tests
[429/460] bitcoin: testing script_tests
[430/460] Running utility command for check-bitcoin-validation_block_tests
[431/460] bitcoin: testing validation_tests
[432/460] Running utility command for check-bitcoin-script_tests
[433/460] Running utility command for check-bitcoin-validation_tests
[434/460] bitcoin: testing monolith_opcodes_tests
[435/460] Running utility command for check-bitcoin-monolith_opcodes_tests
[436/460] bitcoin: testing intmath_tests
[437/460] Running utility command for check-bitcoin-intmath_tests
[438/460] bitcoin: testing crypto_tests
[439/460] Running utility command for check-bitcoin-crypto_tests
[440/460] bitcoin-qt: testing test_bitcoin-qt
[441/460] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[442/460] bitcoin: testing coinselector_tests
[443/460] Running utility command for check-bitcoin-coinselector_tests
[444/460] bitcoin: testing coins_tests
[445/460] Running utility command for check-bitcoin-coins_tests
[446/460] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

wallet_importprunedfunds.py --descriptors              | ○ Skipped | 0 s
wallet_keypool.py                                      | ○ Skipped | 0 s
wallet_keypool_topup.py                                | ○ Skipped | 0 s
wallet_keypool_topup.py --descriptors                  | ○ Skipped | 0 s
wallet_labels.py                                       | ○ Skipped | 0 s
wallet_labels.py --descriptors                         | ○ Skipped | 1 s
wallet_listreceivedby.py                               | ○ Skipped | 0 s
wallet_listsinceblock.py                               | ○ Skipped | 0 s
wallet_listsinceblock.py --descriptors                 | ○ Skipped | 0 s
wallet_listtransactions.py                             | ○ Skipped | 0 s
wallet_listtransactions.py --descriptors               | ○ Skipped | 0 s
wallet_multiwallet.py --usecli                         | ○ Skipped | 0 s
wallet_reorgsrestore.py                                | ○ Skipped | 0 s
wallet_resendwallettransactions.py                     | ○ Skipped | 0 s
wallet_send.py                                         | ○ Skipped | 0 s
wallet_startup.py                                      | ○ Skipped | 1 s
wallet_txn_clone.py                                    | ○ Skipped | 0 s
wallet_txn_clone.py --mineblock                        | ○ Skipped | 0 s
wallet_txn_doublespend.py                              | ○ Skipped | 1 s
wallet_txn_doublespend.py --mineblock                  | ○ Skipped | 0 s
wallet_watchonly.py                                    | ○ Skipped | 0 s
wallet_watchonly.py --usecli                           | ○ Skipped | 0 s

ALL                                                    | ✓ Passed  | 654 s (accumulated) 
Runtime: 132 s

----------------------------------------------------------------------
Ran 10 tests in 0.203s

OK

[155/428] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.004s

OK
[156/428] cd /work/contrib/devtools/chainparams && /usr/bin/python3.7 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[164/428] Running pow test suite
PASSED: pow test suite
[177/428] Running seeder test suite
PASSED: seeder test suite
[183/428] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[184/428] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
In file included from /usr/include/boost/test/unit_test.hpp:19,
                 from ../../src/test/script_tests.cpp:30:
../../src/test/script_tests.cpp: In member function ‘void script_tests::script_build::test_method()’:
../../src/test/script_tests.cpp:540:22: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 BOOST_AUTO_TEST_CASE(script_build) {
                      ^~~~~~~~~~~~
[413/428] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

wallet_import_rescan.py                                | ✓ Passed  | 11 s
wallet_import_with_label.py                            | ✓ Passed  | 1 s
wallet_importdescriptors.py                            | ✓ Passed  | 7 s
wallet_importmulti.py                                  | ✓ Passed  | 6 s
wallet_importprunedfunds.py                            | ✓ Passed  | 2 s
wallet_importprunedfunds.py --descriptors              | ✓ Passed  | 3 s
wallet_keypool.py                                      | ✓ Passed  | 3 s
wallet_keypool_topup.py                                | ✓ Passed  | 5 s
wallet_keypool_topup.py --descriptors                  | ✓ Passed  | 5 s
wallet_labels.py                                       | ✓ Passed  | 2 s
wallet_labels.py --descriptors                         | ✓ Passed  | 2 s
wallet_listreceivedby.py                               | ✓ Passed  | 16 s
wallet_listsinceblock.py                               | ✓ Passed  | 8 s
wallet_listsinceblock.py --descriptors                 | ✓ Passed  | 8 s
wallet_listtransactions.py                             | ✓ Passed  | 5 s
wallet_listtransactions.py --descriptors               | ✓ Passed  | 3 s
wallet_multiwallet.py --usecli                         | ✓ Passed  | 17 s
wallet_reorgsrestore.py                                | ✓ Passed  | 5 s
wallet_resendwallettransactions.py                     | ✓ Passed  | 3 s
wallet_send.py                                         | ✓ Passed  | 8 s
wallet_startup.py                                      | ✓ Passed  | 3 s
wallet_txn_clone.py                                    | ✓ Passed  | 3 s
wallet_txn_clone.py --mineblock                        | ✓ Passed  | 4 s
wallet_txn_doublespend.py                              | ✓ Passed  | 3 s
wallet_txn_doublespend.py --mineblock                  | ✓ Passed  | 4 s
wallet_watchonly.py                                    | ✓ Passed  | 1 s
wallet_watchonly.py --usecli                           | ✓ Passed  | 2 s

ALL                                                    | ✓ Passed  | 1674 s (accumulated) 
Runtime: 337 s

----------------------------------------------------------------------
Ran 10 tests in 0.197s

OK

[156/468] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.004s

OK
[158/468] cd /work/contrib/devtools/chainparams && /usr/bin/python3.7 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.003s

OK
[191/468] Running seeder test suite
PASSED: seeder test suite
[425/468] Running pow test suite
PASSED: pow test suite
[437/468] Running secp256k1 test suite
PASSED: secp256k1 test suite
[444/468] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[453/468] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

tool_wallet.py --descriptors                           | ✓ Passed  | 2 s
wallet_abandonconflict.py                              | ✓ Passed  | 7 s
wallet_address_types.py                                | ✓ Passed  | 12 s
wallet_address_types.py --descriptors                  | ✓ Passed  | 9 s
wallet_avoidreuse.py                                   | ✓ Passed  | 4 s
wallet_avoidreuse.py --descriptors                     | ✓ Passed  | 5 s
wallet_backup.py                                       | ✓ Passed  | 28 s
wallet_balance.py                                      | ✓ Passed  | 19 s
wallet_balance.py --descriptors                        | ✓ Passed  | 23 s
wallet_basic.py                                        | ✓ Passed  | 21 s
wallet_coinbase_category.py                            | ✓ Passed  | 1 s
wallet_create_tx.py                                    | ✓ Passed  | 5 s
wallet_createwallet.py                                 | ✓ Passed  | 2 s
wallet_createwallet.py --descriptors                   | ✓ Passed  | 2 s
wallet_createwallet.py --usecli                        | ✓ Passed  | 3 s
wallet_descriptor.py                                   | ✓ Passed  | 7 s
wallet_disable.py                                      | ✓ Passed  | 0 s
wallet_dump.py                                         | ✓ Passed  | 4 s
wallet_encryption.py                                   | ✓ Passed  | 5 s
wallet_encryption.py --descriptors                     | ✓ Passed  | 5 s
wallet_hd.py                                           | ✓ Passed  | 6 s
wallet_hd.py --descriptors                             | ✓ Passed  | 5 s
wallet_import_rescan.py                                | ✓ Passed  | 5 s
wallet_import_with_label.py                            | ✓ Passed  | 1 s
wallet_importdescriptors.py                            | ✓ Passed  | 6 s
wallet_importmulti.py                                  | ✓ Passed  | 3 s
wallet_importprunedfunds.py                            | ✓ Passed  | 2 s
wallet_importprunedfunds.py --descriptors              | ✓ Passed  | 2 s
wallet_keypool.py                                      | ✓ Passed  | 3 s
wallet_keypool_topup.py                                | ✓ Passed  | 3 s
wallet_keypool_topup.py --descriptors                  | ✓ Passed  | 3 s
wallet_labels.py                                       | ✓ Passed  | 1 s
wallet_labels.py --descriptors                         | ✓ Passed  | 2 s
wallet_listreceivedby.py                               | ✓ Passed  | 7 s
wallet_listsinceblock.py                               | ✓ Passed  | 4 s
wallet_listsinceblock.py --descriptors                 | ✓ Passed  | 6 s
wallet_listtransactions.py                             | ✓ Passed  | 4 s
wallet_listtransactions.py --descriptors               | ✓ Passed  | 3 s
wallet_multiwallet.py --usecli                         | ✓ Passed  | 10 s
wallet_reorgsrestore.py                                | ✓ Passed  | 3 s
wallet_resendwallettransactions.py                     | ✓ Passed  | 9 s
wallet_send.py                                         | ✓ Passed  | 7 s
wallet_startup.py                                      | ✓ Passed  | 2 s
wallet_txn_clone.py                                    | ✓ Passed  | 2 s
wallet_txn_clone.py --mineblock                        | ✓ Passed  | 3 s
wallet_txn_doublespend.py                              | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock                  | ✓ Passed  | 4 s
wallet_watchonly.py                                    | ✓ Passed  | 1 s
wallet_watchonly.py --usecli                           | ✓ Passed  | 1 s

ALL                                                    | ✓ Passed  | 1197 s (accumulated) 
Runtime: 240 s

----------------------------------------------------------------------
Ran 10 tests in 0.092s

OK

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

Debugging failure

src/avalanche/test/processor_tests.cpp
1331 ↗(On Diff #32877)

BOOST_CHECK can only work on objects it can print with operator<< which is likely your issue here, just use BOOST_CHECK(processor == nullptr);

Use BOOST_CHECK instead of BOOST_CHECK_EQUAL to avoid passing the processor.

Fabien requested changes to this revision.Mar 22 2022, 17:43

One last feedback missed

src/avalanche/test/peermanager_tests.cpp
1721 ↗(On Diff #32892)

Please save all the changes to this file for another diff, it's unrelated to the rationale of this diff

This revision now requires changes to proceed.Mar 22 2022, 17:43

Remove all changes to peermanager tests.

This revision is now accepted and ready to land.Mar 22 2022, 19:29