Page MenuHomePhabricator

Remove mempool global from init
ClosedPublic

Authored by PiRK on Jul 15 2021, 09:10.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd5099f490d7a: Remove mempool global from init
Summary

PR description:

This refactor unlocks some nice potential features, such as, but not limited to:

  • Removing the fee estimates global (would avoid slightly fragile workarounds such as Disable fee estimation in blocksonly mode (by removing the fee estimates global) #18766)
  • Making the mempool optional for a "blocksonly" operation mode

Even absent those features, the new code without the global should be easier to maintain, read and write tests for.

This is a backport of core#19556 [1/3]
https://github.com/bitcoin/bitcoin/pull/19556/commits/eeee1104d78eb59a582ee1709ff4ac2c33ee1190

Depends on D9780, D9783 and D9784

Test Plan

ninja all check-all

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Jul 15 2021, 09:10
This revision is now accepted and ready to land.Jul 15 2021, 09:17

Failed tests logs:

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

------- Stdout: -------
2021-07-15T09:19:12.135000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210715_091910/abc_p2p_proof_inventory_2
2021-07-15T09:19:14.142000Z TestFramework (INFO): Test sending a proof to our peers
2021-07-15T09:19:18.046000Z TestFramework (INFO): Test that we don't send the same inv several times
2021-07-15T09:19:29.104000Z TestFramework (INFO): Test a peer is created on proof reception
2021-07-15T09:19:29.564000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/authproxy.py", line 117, in _request
    return self._get_response()
  File "/work/test/functional/test_framework/authproxy.py", line 183, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 310, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 271, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 293, in run_test
    self.test_receive_proof()
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 126, in test_receive_proof
    wait_until(lambda: proof.proofid in get_proof_ids(node))
  File "/work/test/functional/test_framework/util.py", line 264, in wait_until
    if predicate():
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 126, in <lambda>
    wait_until(lambda: proof.proofid in get_proof_ids(node))
  File "/work/test/functional/test_framework/avatools.py", line 140, in get_proof_ids
    ).proofid for peer in node.getavalanchepeerinfo()]
  File "/work/test/functional/test_framework/coverage.py", line 48, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 157, in __call__
    'POST', self.__url.path, postdata.encode('utf-8'))
  File "/work/test/functional/test_framework/authproxy.py", line 123, in _request
    return self._get_response()
  File "/work/test/functional/test_framework/authproxy.py", line 183, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 310, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 271, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer
2021-07-15T09:19:29.615000Z TestFramework (INFO): Stopping nodes
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 300, in <module>
    ProofInventoryTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 147, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 273, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 501, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 413, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/coverage.py", line 48, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 157, in __call__
    'POST', self.__url.path, postdata.encode('utf-8'))
  File "/work/test/functional/test_framework/authproxy.py", line 116, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.7/http/client.py", line 1260, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 970, in send
    self.connect()
  File "/usr/lib/python3.7/http/client.py", line 942, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

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

Failed tests logs:

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

------- Stdout: -------
2021-07-15T10:23:27.051000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210715_102324/abc_p2p_proof_inventory_2
2021-07-15T10:23:29.159000Z TestFramework (INFO): Test sending a proof to our peers
2021-07-15T10:23:59.338000Z TestFramework (INFO): Test that we don't send the same inv several times
2021-07-15T10:24:00.530000Z TestFramework (INFO): Test a peer is created on proof reception
2021-07-15T10:24:02.553000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/authproxy.py", line 117, in _request
    return self._get_response()
  File "/work/test/functional/test_framework/authproxy.py", line 183, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 310, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 271, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 293, in run_test
    self.test_receive_proof()
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 126, in test_receive_proof
    wait_until(lambda: proof.proofid in get_proof_ids(node))
  File "/work/test/functional/test_framework/util.py", line 264, in wait_until
    if predicate():
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 126, in <lambda>
    wait_until(lambda: proof.proofid in get_proof_ids(node))
  File "/work/test/functional/test_framework/avatools.py", line 140, in get_proof_ids
    ).proofid for peer in node.getavalanchepeerinfo()]
  File "/work/test/functional/test_framework/coverage.py", line 48, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 157, in __call__
    'POST', self.__url.path, postdata.encode('utf-8'))
  File "/work/test/functional/test_framework/authproxy.py", line 123, in _request
    return self._get_response()
  File "/work/test/functional/test_framework/authproxy.py", line 183, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 310, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 271, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer
2021-07-15T10:24:02.605000Z TestFramework (INFO): Stopping nodes
------- Stderr: -------
Traceback (most recent call last):
  File "/work/test/functional/abc_p2p_proof_inventory.py", line 300, in <module>
    ProofInventoryTest().main()
  File "/work/test/functional/test_framework/test_framework.py", line 147, in main
    exit_code = self.shutdown()
  File "/work/test/functional/test_framework/test_framework.py", line 273, in shutdown
    self.stop_nodes()
  File "/work/test/functional/test_framework/test_framework.py", line 501, in stop_nodes
    node.stop_node(wait=wait, wait_until_stopped=False)
  File "/work/test/functional/test_framework/test_node.py", line 413, in stop_node
    self.stop(wait=wait)
  File "/work/test/functional/test_framework/coverage.py", line 48, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 157, in __call__
    'POST', self.__url.path, postdata.encode('utf-8'))
  File "/work/test/functional/test_framework/authproxy.py", line 116, in _request
    self.__conn.request(method, path, postdata, headers)
  File "/usr/lib/python3.7/http/client.py", line 1260, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 970, in send
    self.connect()
  File "/usr/lib/python3.7/http/client.py", line 942, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.7/socket.py", line 727, in create_connection
    raise err
  File "/usr/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

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

This revision was automatically updated to reflect the committed changes.