The banscore was always 0 or 100 (which causes disconnection), so we can simplify the logic by using a boolean without changing behavior.
Details
Details
- Reviewers
Fabien - Group Reviewers
Restricted Project - Commits
- rABC3283f3540428: [avalanche] replace banscore int with disconnect bool in registerVotes
ninja all check-all
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 33149 Build 65781: Build Diff lint-circular-dependencies · build-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang Build 65780: arc lint + arc unit
Event Timeline
| src/avalanche/processor.cpp | ||
|---|---|---|
| 586 ↗ | (On Diff #53744) | oops |
Comment Actions
Build Bitcoin ABC Diffs / Diff Testing (build-debug) failed.
Failed tests logs:
====== Bitcoin ABC functional tests: p2p_timeouts.py ======
------- Stdout: -------
2025-04-29T10:29:32.981000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250429_102508_26041/p2p_timeouts_259
2025-04-29T10:31:33.610000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
def test_function():
if check_connected:
assert self.is_connected
return test_function_in()
'''
2025-04-29T10:31:33.611000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
File "/work/test/functional/test_framework/test_framework.py", line 152, in main
self._run_test_internal()
File "/work/test/functional/test_framework/test_framework.py", line 142, in _run_test_internal
self.run_test()
File "/work/test/functional/p2p_timeouts.py", line 94, in run_test
no_version_node.wait_for_disconnect()
File "/work/test/functional/test_framework/p2p.py", line 599, in wait_for_disconnect
self.wait_until(test_function, timeout=timeout, check_connected=False)
File "/work/test/functional/test_framework/p2p.py", line 582, in wait_until
wait_until_helper(
File "/work/test/functional/test_framework/util.py", line 309, in wait_until_helper
raise AssertionError(
AssertionError: Predicate ''''
def test_function():
if check_connected:
assert self.is_connected
return test_function_in()
''' not true after 120.0 seconds
2025-04-29T10:31:33.662000Z TestFramework (INFO): Stopping nodes
2025-04-29T10:31:33.764000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250429_102508_26041/p2p_timeouts_259
2025-04-29T10:31:33.764000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250429_102508_26041/p2p_timeouts_259/test_framework.log
2025-04-29T10:31:33.764000Z TestFramework (ERROR):
2025-04-29T10:31:33.764000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250429_102508_26041/p2p_timeouts_259' to consolidate all logs
2025-04-29T10:31:33.765000Z TestFramework (ERROR):
2025-04-29T10:31:33.765000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-04-29T10:31:33.765000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-04-29T10:31:33.765000Z TestFramework (ERROR):Each failure log is accessible here:
Bitcoin ABC functional tests: p2p_timeouts.py
| src/net_processing.cpp | ||
|---|---|---|
| 6732 ↗ | (On Diff #53747) | I actually disagree with you on this one, and I think setting it to false by default bool disconnect{false} makes it more readable, it documents that the registerVotes() function is expected to turn it true upon misbehavior. |
Comment Actions
You still want to set it to false in the function, so it is never left untouched. It's just defensive programming to initialize to false at the callsite.