Page MenuHomePhabricator

[avalanche] Don't ban a peer sending a proof with an unknown utxo
ClosedPublic

Authored by Fabien on Jul 29 2022, 14:19.

Details

Summary

It is possible for a peer to send a proof with a utxo from a block we don't have yet, especially after IBD completed since the latch is set after we got a block with time in the last 24h.

Test Plan
ninja all check-all

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Jul 29 2022, 14:19

Failed tests logs:

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

------- Stdout: -------
2022-07-29T14:25:18.100000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220729_142403/abc_p2p_avalanche_quorum_10
2022-07-29T14:25:41.041000Z 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_p2p_avalanche_quorum.py", line 227, in run_test
    poll_and_assert_response(node, AvalancheVoteError.UNKNOWN)
  File "/work/test/functional/abc_p2p_avalanche_quorum.py", line 104, in poll_and_assert_response
    assert_equal(actual, expected)
  File "/work/test/functional/test_framework/util.py", line 60, in assert_equal
    for arg in (thing1, thing2) + args)))
AssertionError: not(AvalancheVote(error=0, hash=0a14ee7ad3570a6c3e44a49058edc32aea37d6ff4ad8108c0fe31d5ce63d221b) == AvalancheVote(error=-1, hash=0a14ee7ad3570a6c3e44a49058edc32aea37d6ff4ad8108c0fe31d5ce63d221b))
2022-07-29T14:25:41.092000Z TestFramework (INFO): Stopping nodes
2022-07-29T14:25:41.898000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220729_142403/abc_p2p_avalanche_quorum_10
2022-07-29T14:25:41.898000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220729_142403/abc_p2p_avalanche_quorum_10/test_framework.log
2022-07-29T14:25:41.898000Z TestFramework (ERROR): 
2022-07-29T14:25:41.898000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220729_142403/abc_p2p_avalanche_quorum_10' to consolidate all logs
2022-07-29T14:25:41.898000Z TestFramework (ERROR): 
2022-07-29T14:25:41.898000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-07-29T14:25:41.899000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-07-29T14:25:41.899000Z TestFramework (ERROR):

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

sdulfari requested changes to this revision.Jul 29 2022, 18:26
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/avalanche/test/peermanager_tests.cpp
2048 ↗(On Diff #34553)

Use PROOF_DUST_THRESHOLD to make the test more robust against changes.

This revision now requires changes to proceed.Jul 29 2022, 18:26

Failed tests logs:

====== Bitcoin ABC functional tests: abc_p2p_avalanche_proof_voting.py --nolegacyavaproof ======

------- Stdout: -------
2022-07-29T18:25:33.900000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220729_182425/abc_p2p_avalanche_proof_voting_13
2022-07-29T18:25:35.922000Z TestFramework (INFO): Trigger polling from the node...
2022-07-29T18:25:36.109000Z TestFramework (INFO): Check we poll for valid proof
2022-07-29T18:25:36.235000Z TestFramework (INFO): Check we don't poll for subsequent proofs if the cooldown is not elapsed, proof not the favorite
2022-07-29T18:25:36.286000Z TestFramework (INFO): Check we don't poll for subsequent proofs if the cooldown is not elapsed, proof is the favorite
2022-07-29T18:25:36.336000Z TestFramework (INFO): Check we poll for conflicting proof if the proof is not the favorite
2022-07-29T18:25:36.577000Z TestFramework (INFO): Check we poll for conflicting proof if the proof is the favorite
2022-07-29T18:26:36.618000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: self.can_find_proof_in_poll(proofid, response))
'''
2022-07-29T18:26:36.618000Z 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_p2p_avalanche_proof_voting.py", line 117, in run_test
    self.poll_tests(node)
  File "/work/test/functional/abc_p2p_avalanche_proof_voting.py", line 173, in poll_tests
    self.send_and_check_for_polling(peer, proof_seq40)
  File "/work/test/functional/abc_p2p_avalanche_proof_voting.py", line 93, in send_and_check_for_polling
    self.wait_until(lambda: self.can_find_proof_in_poll(proofid, response))
  File "/work/test/functional/test_framework/test_framework.py", line 677, in wait_until
    timeout_factor=self.options.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 284, in wait_until_helper
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        self.wait_until(lambda: self.can_find_proof_in_poll(proofid, response))
''' not true after 60.0 seconds
2022-07-29T18:26:36.669000Z TestFramework (INFO): Stopping nodes
2022-07-29T18:26:36.820000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220729_182425/abc_p2p_avalanche_proof_voting_13
2022-07-29T18:26:36.820000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220729_182425/abc_p2p_avalanche_proof_voting_13/test_framework.log
2022-07-29T18:26:36.821000Z TestFramework (ERROR): 
2022-07-29T18:26:36.821000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220729_182425/abc_p2p_avalanche_proof_voting_13' to consolidate all logs
2022-07-29T18:26:36.821000Z TestFramework (ERROR): 
2022-07-29T18:26:36.821000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-07-29T18:26:36.821000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-07-29T18:26:36.821000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: abc_p2p_avalanche_proof_voting.py --nolegacyavaproof

Use PROOF_DUST_THRESHOLD

This revision is now accepted and ready to land.Jul 31 2022, 05:53