test: set number of RPC server threads to 2
What changed, and why it matters
This change only affects Bitcoin Core's internal functional test suite. It reduces the number of RPC server threads spawned by test nodes from 16 to 2 to avoid running out of file descriptors and other resources during automated testing. It does not change production node behavior and is not a security fix.
No security action needed. This is a benign test-framework configuration tweak.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds rpcthreads=2 to the generated bitcoin.conf for functional test nodes in test/functional/test_framework/util.py. The default rpcthreads=16 caused test runs to exhaust file descriptors or hit resource limits because each test node spawns 16 HTTP threads. Since the test framework uses a single synchronous RPC connection per node, most threads were idle. This is a test infrastructure resource optimization, not a code change to consensus, networking, wallet, or RPC security semantics.
Changed components
test/functional/test_framework/util.pyInspect captured patch +1 / −0
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index da90e374..d7ffed87 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -444,6 +444,7 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
# Disable server-side timeouts to avoid intermittent issues
f.write("rpcservertimeout=99000\n")
f.write("rpcdoccheck=1\n")
+ f.write("rpcthreads=2\n")
f.write("fallbackfee=0.0002\n")
f.write("server=1\n")
f.write("keypool=1\n")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.