Page MenuHomePhabricator

[avalanche] Poll for the transactions that didn't make it into the last block
Needs ReviewPublic

Authored by Fabien on Wed, Mar 19, 20:50.

Details

Reviewers
roqqit
Group Reviewers
Restricted Project
Summary

After a block is finalized we need to poll for the remaining mempool transactions.
In order to select which transaction to poll we use the legacy block template constructor.

Depends on D17831.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_add_back_to_poll_after_block
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32779
Build 65046: Build Diffbuild-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang · lint-circular-dependencies
Build 65045: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Wed, Mar 19, 20:50

Failed tests logs:

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

------- Stdout: -------
2025-03-19T20:56:48.197000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250319_205644/abc_p2p_avalanche_contender_voting_5
2025-03-19T20:57:02.246000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20320 due to [Errno 104] Connection reset by peer
2025-03-19T20:57:02.247000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20320 due to [Errno 104] Connection reset by peer
2025-03-19T20:57:02.247000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20320 due to [Errno 104] Connection reset by peer
2025-03-19T20:57:02.248000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 86, in run_test
    self.wait_until(lambda: has_finalized_proof(peer.proof.proofid))
  File "/work/test/functional/test_framework/test_framework.py", line 874, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 283, in wait_until_helper
    if predicate():
       ^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 86, in <lambda>
    self.wait_until(lambda: has_finalized_proof(peer.proof.proofid))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 83, in has_finalized_proof
    return node.getrawavalancheproof(uint256_hex(proofid))["finalized"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 146, in __call__
    response, status = self._request(
                       ^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 115, in _request
    return self._get_response()
           ^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 187, in _get_response
    http_response = self.__conn.getresponse()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.11/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
2025-03-19T20:57:02.300000Z TestFramework (INFO): Stopping nodes
[node 0] Cleaning up leftover process
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 471, in <module>
    AvalancheContenderVotingTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 172, in main
    exit_code = self.shutdown()
                ^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 532, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 146, in __call__
    response, status = self._request(
                       ^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 114, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 851, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/socket.py", line 836, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
====== Bitcoin ABC functional tests: abc_p2p_avalanche_transaction_finalization.py ======

------- Stdout: -------
2025-03-19T20:56:48.179000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250319_205644/abc_p2p_avalanche_transaction_finalization_3
2025-03-19T20:57:07.203000Z TestFramework (INFO): Check the finalization of simple non-chained txs
2025-03-19T20:57:28.343000Z TestFramework (INFO): Check the finalization of chained txs
2025-03-19T20:57:46.675000Z TestFramework (INFO): Check the finalization of diamond shaped tx chains
2025-03-19T20:58:07.630000Z TestFramework (INFO): Check the finalization of tx when the next block is full
2025-03-19T20:58:52.742000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20192 due to [Errno 104] Connection reset by peer
2025-03-19T20:58:52.743000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20192 due to [Errno 104] Connection reset by peer
2025-03-19T20:58:52.743000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20192 due to [Errno 104] Connection reset by peer
2025-03-19T20:58:52.744000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_transaction_finalization.py", line 351, in run_test
    self.test_block_full()
  File "/work/test/functional/abc_p2p_avalanche_transaction_finalization.py", line 309, in test_block_full
    self.finalize_tip()
  File "/work/test/functional/abc_p2p_avalanche_transaction_finalization.py", line 59, in finalize_tip
    self.wait_until(vote_until_final)
  File "/work/test/functional/test_framework/test_framework.py", line 874, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 283, in wait_until_helper
    if predicate():
       ^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_transaction_finalization.py", line 57, in vote_until_final
    return self.nodes[0].isfinalblock(tip)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 146, in __call__
    response, status = self._request(
                       ^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 115, in _request
    return self._get_response()
           ^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 187, in _get_response
    http_response = self.__conn.getresponse()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.11/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
2025-03-19T20:58:52.797000Z TestFramework (INFO): Stopping nodes
[node 0] Cleaning up leftover process
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_transaction_finalization.py", line 355, in <module>
    AvalancheTransactionFinalizationTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 172, in main
    exit_code = self.shutdown()
                ^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 532, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 146, in __call__
    response, status = self._request(
                       ^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 114, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 851, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/socket.py", line 836, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

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

roqqit requested changes to this revision.Wed, Mar 19, 22:56
roqqit added a subscriber: roqqit.

back to you

This revision now requires changes to proceed.Wed, Mar 19, 22:56

Failed tests logs:

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

------- Stdout: -------
2025-03-19T23:25:09.005000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_🏃_20250319_232506/abc_p2p_avalanche_contender_voting_5
2025-03-19T23:25:21.112000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20320 due to [Errno 104] Connection reset by peer
2025-03-19T23:25:21.112000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:20320 due to [Errno 104] Connection reset by peer
2025-03-19T23:25:21.113000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 149, in main
    self._run_test_internal()
  File "/work/test/functional/test_framework/test_framework.py", line 139, in _run_test_internal
    self.run_test()
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 86, in run_test
    self.wait_until(lambda: has_finalized_proof(peer.proof.proofid))
  File "/work/test/functional/test_framework/test_framework.py", line 874, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/util.py", line 283, in wait_until_helper
    if predicate():
       ^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 86, in <lambda>
    self.wait_until(lambda: has_finalized_proof(peer.proof.proofid))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 83, in has_finalized_proof
    return node.getrawavalancheproof(uint256_hex(proofid))["finalized"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 146, in __call__
    response, status = self._request(
                       ^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 115, in _request
    return self._get_response()
           ^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 187, in _get_response
    http_response = self.__conn.getresponse()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.11/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 104] Connection reset by peer
2025-03-19T23:25:21.166000Z TestFramework (INFO): Stopping nodes
[node 0] Cleaning up leftover process
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_avalanche_contender_voting.py", line 471, in <module>
    AvalancheContenderVotingTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 172, in main
    exit_code = self.shutdown()
                ^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 532, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 146, in __call__
    response, status = self._request(
                       ^^^^^^^^^^^^^^
  File "/work/test/functional/test_framework/authproxy.py", line 114, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 851, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/socket.py", line 836, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

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

Fix another lock issue (cs_main => cs_peermanager)