Page MenuHomePhabricator

[avalanche] Poll for our local proof
ClosedPublic

Authored by Fabien on Aug 17 2022, 14:03.

Details

Reviewers
sdulfari
Group Reviewers
Restricted Project
Commits
rABC63e205e1837c: [avalanche] Poll for our local proof
Summary

So far the node was not polling for its own proof, considering it is always valid. This means that a node can start with a proof that would be rejected by the network. This diff causes the node to poll for its own proof instead so it can stop using it if it is rejected, and also it makes it appear in the finalized proofs which is more intuitive for the user.

Test Plan
ninja all check-extended

Diff Detail

Event Timeline

Fabien requested review of this revision.Aug 17 2022, 14:03

Failed tests logs:

====== Bitcoin ABC functional tests with the next upgrade activated: abc_rpc_getavalancheinfo.py --nolegacyavaproof ======

------- Stdout: -------
2022-08-17T14:16:57.731000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220817_141427/abc_rpc_getavalancheinfo_38
2022-08-17T14:16:58.034000Z TestFramework (INFO): The test node has no proof
2022-08-17T14:16:58.034000Z TestFramework (INFO): The test node has a proof
2022-08-17T14:16:58.477000Z TestFramework (INFO): Connect a bunch of peers and nodes
2022-08-17T14:17:00.492000Z TestFramework (INFO): Disconnect some nodes
2022-08-17T14:17:00.646000Z TestFramework (INFO): Add some pending nodes
2022-08-17T14:17:01.218000Z TestFramework (INFO): Finalize the proofs for some peers
2022-08-17T14:17:08.928000Z TestFramework (INFO): Disconnect all the nodes, so we are the only node left on the network
2022-08-17T14:17:08.984000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 136, in main
    self.run_test()
  File "/work/test/functional/abc_rpc_getavalancheinfo.py", line 373, in run_test
    "pending_node_count": 0,
  File "/work/test/functional/abc_rpc_getavalancheinfo.py", line 65, in assert_avalancheinfo
    handle_legacy_format(expected)
  File "/work/test/functional/test_framework/util.py", line 60, in assert_equal
    for arg in (thing1, thing2) + args)))
AssertionError: not({'ready_to_poll': False, 'local': {'verified': True, 'proofid': 'f9954b25c38c71c172c28ab89b997d3ba506b6bae7b14af601be7c3aa1883e36', 'limited_proofid': '1f008ccfc24eb9739f81535423b2bfb03759ca61ae839633857577f50f05d1fc', 'master': '03ef4515ef480622ce760ca19272133af0e25bfa1bd69c3212bfb7ac8993e7823b', 'payout_address': 'ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt', 'stake_amount': Decimal('25000000.00')}, 'network': {'proof_count': 15, 'connected_proof_count': 1, 'dangling_proof_count': 14, 'finalized_proof_count': 14, 'conflicting_proof_count': 0, 'immature_proof_count': 0, 'total_stake_amount': Decimal('375000000.00'), 'connected_stake_amount': Decimal('25000000.00'), 'dangling_stake_amount': Decimal('350000000.00'), 'node_count': 1, 'connected_node_count': 1, 'pending_node_count': 0}} == {'ready_to_poll': False, 'local': {'verified': True, 'proofid': 'f9954b25c38c71c172c28ab89b997d3ba506b6bae7b14af601be7c3aa1883e36', 'limited_proofid': '1f008ccfc24eb9739f81535423b2bfb03759ca61ae839633857577f50f05d1fc', 'master': '03ef4515ef480622ce760ca19272133af0e25bfa1bd69c3212bfb7ac8993e7823b', 'stake_amount': Decimal('25000000.00'), 'payout_address': 'ecregtest:qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqcrl5mqkt'}, 'network': {'proof_count': 15, 'connected_proof_count': 1, 'dangling_proof_count': 14, 'finalized_proof_count': 15, 'conflicting_proof_count': 0, 'immature_proof_count': 0, 'total_stake_amount': Decimal('375000000.00'), 'connected_stake_amount': Decimal('25000000.00'), 'dangling_stake_amount': Decimal('350000000.00'), 'node_count': 1, 'connected_node_count': 1, 'pending_node_count': 0}})
2022-08-17T14:17:09.035000Z TestFramework (INFO): Stopping nodes
2022-08-17T14:17:09.238000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220817_141427/abc_rpc_getavalancheinfo_38
2022-08-17T14:17:09.238000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220817_141427/abc_rpc_getavalancheinfo_38/test_framework.log
2022-08-17T14:17:09.238000Z TestFramework (ERROR): 
2022-08-17T14:17:09.238000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20220817_141427/abc_rpc_getavalancheinfo_38' to consolidate all logs
2022-08-17T14:17:09.238000Z TestFramework (ERROR): 
2022-08-17T14:17:09.238000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-08-17T14:17:09.238000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-08-17T14:17:09.238000Z TestFramework (ERROR):

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

Fabien planned changes to this revision.Aug 17 2022, 14:23

The test needs a fix

Actually wait for the local proof to be finalized

This revision is now accepted and ready to land.Aug 17 2022, 16:04
This revision was automatically updated to reflect the committed changes.