What changed, and why it matters
This commit fixes a version-number check in the code that prepares Monero block templates. The software was incorrectly treating Monero protocol version 17 as if it were the older format, and only enabling the new FCMP++ output format at version 18. The patch lowers the threshold to version 17 so the correct output type is used. If left unfixed, miners using this code on Monero version 17 could produce blocks with the wrong output format, which would likely be rejected by the network and cause lost mining rewards rather than directly steal funds or corrupt the chain.
Treat as a correctness fix that should be included in any release supporting Monero hard-fork v17. Users running mining software built from this repository should update to the patched commit before the v17 fork activates to avoid producing invalid blocks. No independent security incident response is indicated by the diff alone.
Security signals we found
consensus-rule version threshold error
block template parsing logic change
hard-fork activation boundary correction
potential stale/rejected block production
Evidence from the diff
In src/base/tools/cryptonote/BlockTemplate.cpp the boolean is_fcmp_pp was gated on m_version.first >= 18. The patch changes the gate to >= 17 and updates the associated comment. FCMP++ (Carrot) outputs use output type 0 (txout_to_carrot_v1), while pre-FCMP++ versions expect type 2/3. The mismatch means that at Monero hard-fork version 17 the parser would enforce the legacy output-type rules and reject valid FCMP++ block templates, or conversely construct templates incompatible with consensus. This is a consensus-compatibility bug rather than a memory-safety or authentication flaw.
Changed components
src/base/tools/cryptonote/BlockTemplate.cppMonero (Coin::MONERO) block template parsingFCMP++ / Carrot output type handlingInspect captured patch +2 / −2
diff --git a/src/base/tools/cryptonote/BlockTemplate.cpp b/src/base/tools/cryptonote/BlockTemplate.cpp
index 27557e0..1b64f2e 100644
--- a/src/base/tools/cryptonote/BlockTemplate.cpp
+++ b/src/base/tools/cryptonote/BlockTemplate.cpp
@@ -241,9 +241,9 @@ bool xmrig::BlockTemplate::parse(bool hashes)
ar(m_amount);
ar(m_outputType);
- const bool is_fcmp_pp = (m_coin == Coin::MONERO) && (m_version.first >= 18);
+ const bool is_fcmp_pp = (m_coin == Coin::MONERO) && (m_version.first >= 17);
- // output type must be txout_to_key (2) or txout_to_tagged_key (3) for versions < 18, and txout_to_carrot_v1 (0) for version FCMP++
+ // output type must be txout_to_key (2) or txout_to_tagged_key (3) for versions < 17, and txout_to_carrot_v1 (0) for version FCMP++
if (is_fcmp_pp && (m_outputType == 0)) {
// all good
}
Why this scored 32/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.