test: set par=2 in default config for functional test framework
What changed, and why it matters
This change only affects Bitcoin Core's internal functional test framework. It limits the number of script verification threads used during automated tests to avoid running out of file descriptors or hitting other resource limits on the test machine. It does not change production Bitcoin node behavior and is not a security fix for live software.
No action needed. This is a test-only resource-tuning change. Reviewers may verify that functional tests still pass and that the chosen cap of 2 is appropriate across CI environments.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds par=min(2, os.cpu_count()) to the default configuration generated for functional test nodes. The par option controls how many script verification threads bitcoind spawns. Previously, tests could spawn up to 15 threads per node depending on CPU count, which could exhaust file descriptors or other per-process limits during test runs. The patch caps this at 2 for tests that do not override the default. This is a test infrastructure/resource-limitation change, not a runtime consensus or networking change.
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 e5a5938f..da90e374 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -474,6 +474,7 @@ def write_config(config_path, *, n, chain, extra_config="", disable_autoconnect=
# min_required_fds = MIN_CORE_FDS + MAX_ADDNODE_CONNECTIONS + nBind = 151 + 8 + 3 = 162;
# nMaxConnections = available_fds - min_required_fds = 256 - 161 = 94;
f.write("maxconnections=94\n")
+ f.write("par=" + str(min(2, os.cpu_count())) + "\n")
f.write(extra_config)
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.