Page MenuHomePhabricator

[avalanche] Add a BlockFinalized callback to the validation interface
ClosedPublic

Authored by Fabien on Sep 21 2022, 15:52.

Details

Summary

This will be later used by chronik to check the status of a block.

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.Sep 21 2022, 15:52
sdulfari requested changes to this revision.Sep 21 2022, 20:09
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
src/test/validationinterface_tests.cpp
131 ↗(On Diff #35081)

What's the purpose of this?

141 ↗(On Diff #35081)

The end of the test needs to check callCount, otherwise there's no guarantee that the test is actually calling the test function to begin with.

This revision now requires changes to proceed.Sep 21 2022, 20:09

Improve the test from the feedback, and extend the test to check the calls from AvalancheFinalizeBlock()

src/test/validationinterface_tests.cpp
131 ↗(On Diff #35081)

Just checking there is no error or exception raised when passing a null pointer to the interfaces, but the call still happens as expected (the counter is incremented).

141 ↗(On Diff #35081)

Good catch

Failed tests logs:

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

------- Stdout: -------
2022-09-22T08:06:31.076000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220922_080424/abc_p2p_proof_inventory_21
2022-09-22T08:06:32.435000Z TestFramework (INFO): Test sending a proof to our peers
2022-09-22T08:07:33.531000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        self.wait_until(lambda: all(proof_inv_found(i) for i in node.p2ps))
'''
2022-09-22T08:07:33.531000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 340, in run_test
    self.test_send_proof_inv()
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 87, in test_send_proof_inv
    self.wait_until(lambda: all(proof_inv_found(i) for i in node.p2ps))
  File "/work/test/functional/test_framework/test_framework.py", line 671, in wait_until
    timeout_factor=self.options.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 286, in wait_until_helper
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        self.wait_until(lambda: all(proof_inv_found(i) for i in node.p2ps))
''' not true after 60.0 seconds
2022-09-22T08:07:33.582000Z TestFramework (INFO): Stopping nodes
2022-09-22T08:07:33.837000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220922_080424/abc_p2p_proof_inventory_21
2022-09-22T08:07:33.837000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220922_080424/abc_p2p_proof_inventory_21/test_framework.log
2022-09-22T08:07:33.837000Z TestFramework (ERROR): 
2022-09-22T08:07:33.837000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20220922_080424/abc_p2p_proof_inventory_21' to consolidate all logs
2022-09-22T08:07:33.837000Z TestFramework (ERROR): 
2022-09-22T08:07:33.837000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-09-22T08:07:33.837000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-09-22T08:07:33.837000Z TestFramework (ERROR):

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

Unrelated failure, restarting the builds

This revision is now accepted and ready to land.Sep 22 2022, 16:54