cryptonote_core: set prep-blocks-threads to max threads
What changed, and why it matters
This commit changes a default setting for how many threads Monero uses when preparing block hashes. Previously it was hardcoded to 4 threads; now it uses the number of CPU cores the computer reports (falling back to 4 if that number can't be determined). This is a performance tuning change, not a security fix. There is no direct evidence in the commit that it addresses a vulnerability.
No security action required. Treat as a routine performance/configuration improvement. If reviewing for operational impact, verify that nodes with many CPU cores behave acceptably under the new default thread count.
Security signals we found
No security-relevant keywords in commit title or message
Change is a default-value tuning for thread concurrency
No bounds, validation, or memory-safety changes present
No incident or advisory references supplied
Evidence from the diff
The patch modifies the default value of the prep-blocks-threads command-line option in src/cryptonote_core/cryptonote_core.cpp. The default is changed from a constant 4 to std::thread::hardware_concurrency() with a fallback to 4 if the reported concurrency is zero. This affects only the default thread count for an internal block-preparation optimization. The commit message and diff do not describe any security issue, bug, or exploit scenario.
Changed components
src/cryptonote_core/cryptonote_core.cppprep-blocks-threads default valueInspect captured patch +2 / −1
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index e636014..4512579 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -36,6 +36,7 @@
using namespace epee;
#include <unordered_set>
+#include <thread>
#include "cryptonote_core.h"
#include "common/util.h"
#include "common/updates.h"
@@ -156,7 +157,7 @@ namespace cryptonote
static const command_line::arg_descriptor<uint64_t> arg_prep_blocks_threads = {
"prep-blocks-threads"
, "Max number of threads to use when preparing block hashes in groups."
- , 4
+ , std::thread::hardware_concurrency() > 0 ? std::thread::hardware_concurrency() : 4
};
static const command_line::arg_descriptor<uint64_t> arg_show_time_stats = {
"show-time-stats"
Why this scored 19/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.