After a certain number of pending requests, ChronikElectrumServer seems to give up and ignore any additional request. This is a test to reproduce the issue, which was noticed while testing synchronization of a very large mainnet wallet, with > 100'000 transactions. When synchronizing the wallet, we request the transaction itself and then the merkle root and branch for this tx in the block header. There is a limit for the number of queued/ unanswered merkle request, but not limit for the transaction requests.
This test does it synchronously, while in the mainnet test we don't really control how many unanswered requests are pending at any time.
{'id': 55182, 'jsonrpc': '2.0', 'result': None}
{'id': 55180, 'jsonrpc': '2.0', 'result': None}
{'id': 55183, 'jsonrpc': '2.0', 'result': None}
2025-05-27T13:29:23.038000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 152, in main
self._run_test_internal()
File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 142, in _run_test_internal
self.run_test()
File "/home/pierre/dev/bitcoin-abc/test/functional/chronik_electrum_basic.py", line 35, in run_test
self.test_spam()
File "/home/pierre/dev/bitcoin-abc/test/functional/chronik_electrum_basic.py", line 354, in test_spam
self.client.request_batch([("server.ping", []) for _ in range(100000)])
File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/jsonrpctools.py", line 183, in request_batch
response = self._recv()
^^^^^^^^^^^^
File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/jsonrpctools.py", line 120, in _recv
self.data += self.sock.recv(1024)
^^^^^^^^^^^^^^^^^^^^
TimeoutError: timed out