What changed, and why it matters
This small change adjusts when Monero pauses mining during block verification. Previously, mining was paused for every incoming block announcement, even for blocks the node already knew about. Now it only pauses for genuinely new blocks. The original code comment explicitly warned that pausing for every block might be a denial-of-service (DoS) risk, so this patch removes that potential abuse path. The practical effect is mainly a reduction in wasted mining time and a likely mitigation of a minor DoS vector, not a critical vulnerability fix.
Treat as a minor hardening/DoS-mitigation improvement. No urgent action required, but nodes and miners should update in due course. Monitor for related follow-up PRs or release notes that describe the DoS concern more fully.
Security signals we found
Original code comment explicitly flagged possible DoS vector from pausing mining during block validation
Change narrows a resource-consumption/pause window to unknown blocks only
Likely mitigation of a network-level liveness/DoS concern rather than a correctness bug
Evidence from the diff
In cryptonote_protocol_handler.inl, the handler for NOTIFY_NEW_FLUFFY_BLOCK used to unconditionally call m_core.pause_mine() and set a scope guard to resume mining on exit. The patch adds a guard: pause_mining is set only if !m_core.have_block(new_block_hash). The pause/resume scope guard now checks pause_mining before resuming. This avoids pausing the local miner for already-known blocks. The original comment noted that pausing during validation could be a DoS vector and required more research; the patch directly addresses that concern by limiting the pause to unknown blocks.
Changed components
src/cryptonote_protocol/cryptonote_protocol_handler.inlMonero P2P fluffy block handlingMining pause/resume logicInspect captured patch +5 / −5
### src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -560,11 +560,11 @@ namespace cryptonote
MLOG_P2P_MESSAGE(context << "Received NOTIFY_NEW_FLUFFY_BLOCK " << new_block_hash << " (height "
<< new_block_height << ", " << arg.b.txs.size() << " txes, peer's height: " << peer_height << ")");
- // Pause mining and resume after block verification to prevent wasted mining cycles while
- // validating the next block. Needs more research into if this is a DoS vector or not. Invalid
- // block validation will cause disconnects and bans, so it might not be that bad.
- m_core.pause_mine();
- const epee::scope_guard resume_mine_on_leave([this](){ m_core.resume_mine(); });
+ // Pause mining while verifying an unknown block to avoid wasted mining cycles.
+ const bool pause_mining = !m_core.have_block(new_block_hash);
+ if (pause_mining)
+ m_core.pause_mine();
+ const epee::scope_guard resume_mine_on_leave([this, pause_mining](){ if (pause_mining) m_core.resume_mine(); });
// This set allows us to quickly sanity check that the block binds all txs contained in this
// fluffy payload, which means that no extra stowaway txs can be harbored. In the case of aWhy this scored 26/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.