It adds a test for the change to loadtxoutset
made in #29345. Before that change the test doesn’t fail right away but times out after 10 minutes.
Also removes a sync_blocks
call that didn’t seem to do anything valuable.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | pablomartin4btc, BrandonOdiwuor, theStack, achow101 |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
61 self.extra_args = [
62 [],
63 ["-fastprune", "-prune=1", "-blockfilterindex=1", "-coinstatsindex=1"],
64 ["-persistmempool=0","-txindex=1", "-blockfilterindex=1", "-coinstatsindex=1"],
65+ ["-txindex=1", "-blockfilterindex=1", "-coinstatsindex=1"],
66+ [],
The nodes are not connected at this point and no blocks have been mined, so it does not seem do anything
165@@ -166,8 +166,6 @@ def run_test(self):
166 for n in self.nodes:
167 n.setmocktime(n.getblockheader(n.getbestblockhash())['time'])
168
169- self.sync_blocks()
170-
60 self.rpc_timeout = 120
61 self.extra_args = [
62 [],
63 ["-fastprune", "-prune=1", "-blockfilterindex=1", "-coinstatsindex=1"],
64 ["-persistmempool=0","-txindex=1", "-blockfilterindex=1", "-coinstatsindex=1"],
65+ [],
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
tACK 1ec6684b08614f593b37e627a0a08e54b19318b6
0git log --oneline src/rpc/blockchain.cpp
1faa30a4c56 (2401-rpc-loadtxoutset-) rpc: Do not wait for headers inside loadtxoutset
2fa9108941f rpc: Fix race in loadtxoutset
3
4git checkout fa9108941fa1a0e83484114e2d8a99d264c2ad09 -- src/rpc/blockchain.cpp
self.rpc_timeout
on test/functional/feature_assumeutxo.py
0./test/functional/feature_assumeutxo.py
12024-02-27T16:30:31.156000Z TestFramework (INFO): PRNG seed is: 1857178557572365167
22024-02-27T16:30:31.157000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_7fznd8ax
32024-02-27T16:30:32.583000Z TestFramework (INFO): -- Testing assumeutxo + some indexes + pruning
42024-02-27T16:30:32.584000Z TestFramework (INFO): Creating a UTXO snapshot at height 299
52024-02-27T16:30:32.619000Z TestFramework (INFO): Test loading snapshot when headers are not synced
62024-02-27T16:31:32.679000Z TestFramework (ERROR): Assertion failed
7Traceback (most recent call last):
8 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/authproxy.py", line 151, in _get_response
9 http_response = self.__conn.getresponse()
10 File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
11 response.begin()
12 File "/usr/lib/python3.10/http/client.py", line 318, in begin
13 version, status, reason = self._read_status()
14 File "/usr/lib/python3.10/http/client.py", line 279, in _read_status
15 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
16 File "/usr/lib/python3.10/socket.py", line 705, in readinto
17 return self._sock.recv_into(b)
18TimeoutError: timed out
19
20During handling of the above exception, another exception occurred:
21
22Traceback (most recent call last):
23 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/util.py", line 140, in try_rpc
24 fun(*args, **kwds)
25 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
26 return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
27 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
28 response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
29 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/authproxy.py", line 106, in _request
30 return self._get_response()
31 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/authproxy.py", line 153, in _get_response
32 raise JSONRPCException({
33test_framework.authproxy.JSONRPCException: 'loadtxoutset' RPC took longer than 60.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344)
34
35During handling of the above exception, another exception occurred:
36
37Traceback (most recent call last):
38 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
39 self.run_test()
40 File "/home/pablo/workspace/bitcoin/./test/functional/feature_assumeutxo.py", line 191, in run_test
41 self.test_headers_not_synced(dump_output['path'])
42 File "/home/pablo/workspace/bitcoin/./test/functional/feature_assumeutxo.py", line 118, in test_headers_not_synced
43 assert_raises_rpc_error(-32603, "The base block header (3bb7ce5eba0be48939b7a521ac1ba9316afee2c7bada3a0cca24188e6d7d96c0) must appear in the headers chain. Make sure all headers are syncing, and call this RPC again.",
44 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/util.py", line 131, in assert_raises_rpc_error
45 assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
46 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/util.py", line 144, in try_rpc
47 raise AssertionError("Unexpected JSONRPC error code %i" % e.error["code"])
48AssertionError: Unexpected JSONRPC error code -344
492024-02-27T16:31:32.741000Z TestFramework (INFO): Stopping nodes
502024-02-27T16:31:32.742000Z TestFramework.node1 (ERROR): Unable to stop node.
51Traceback (most recent call last):
52 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_node.py", line 377, in stop_node
53 self.stop(wait=wait)
54 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
55 return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
56 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/authproxy.py", line 127, in __call__
57 response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
58 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/authproxy.py", line 105, in _request
59 self.__conn.request(method, path, postdata, headers)
60 File "/usr/lib/python3.10/http/client.py", line 1283, in request
61 self._send_request(method, url, body, headers, encode_chunked)
62 File "/usr/lib/python3.10/http/client.py", line 1294, in _send_request
63 self.putrequest(method, url, **skips)
64 File "/usr/lib/python3.10/http/client.py", line 1120, in putrequest
65 raise CannotSendRequest(self.__state)
66http.client.CannotSendRequest: Request-sent
672024-02-27T16:32:32.889000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
68 self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
69'''
70Traceback (most recent call last):
71 File "/home/pablo/workspace/bitcoin/./test/functional/feature_assumeutxo.py", line 370, in <module>
72 AssumeutxoTest().main()
73 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_framework.py", line 154, in main
74 exit_code = self.shutdown()
75 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_framework.py", line 313, in shutdown
76 self.stop_nodes()
77 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_framework.py", line 578, in stop_nodes
78 node.wait_until_stopped()
79 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_node.py", line 425, in wait_until_stopped
80 self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
81 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/test_node.py", line 802, in wait_until
82 return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.timeout_factor)
83 File "/home/pablo/workspace/bitcoin/test/functional/test_framework/util.py", line 276, in wait_until_helper_internal
84 raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
85AssertionError: Predicate ''''
86 self.wait_until(lambda: self.is_node_stopped(expected_ret_code=expected_ret_code, **kwargs), timeout=timeout)
87''' not true after 60 seconds
88[node 2] Cleaning up leftover process
89[node 1] Cleaning up leftover process
ACK 1ec6684b08614f593b37e627a0a08e54b19318b6
Looks good to me
196+ for i in range(1, 300):
197+ block = n0.getblock(n0.getblockhash(i), 0)
198+ # make n1 and n2 aware of the new header, but don't give them the
199+ # block.
200+ n1.submitheader(block)
201+ n2.submitheader(block)
nit: only fetching the headers rather than the full blocks seems to be sufficient here:
0 block_header = n0.getblockheader(n0.getblockhash(i), verbose=False)
1 # make n1 and n2 aware of the new header, but don't give them the
2 # block.
3 n1.submitheader(block_header)
4 n2.submitheader(block_header)