Don't reset nonce during donation rounds (possible fix for #3669)
What changed, and why it matters
This is a small bug-fix change in the XMRig cryptocurrency mining software. It changes how the mining 'nonce' (a kind of counter) is reset when the miner briefly switches to a 'donation round' (a short period where mined rewards go to the project developers). Previously, switching to or from a donation round could force an unnecessary nonce reset, which may have caused performance issues or rejected shares. The change is framed as a fix for GitHub issue #3669. There is no direct evidence in the commit that this is a security vulnerability, and no security impact is claimed by the author.
Treat as a routine functional/mining-efficiency fix. Review GitHub issue #3669 for user-reported symptoms. No security-specific action is indicated by the commit itself; standard patch acceptance and regression testing for mining share validity and donation-round stability are sufficient.
Security signals we found
No security keywords in commit title or message
No CVE, advisory, or security-fix language present
Change relates to mining job/nonce handling, not input validation, authentication, or cryptography
Commit references a possible fix for a public issue (#3669) but does not characterize it as security-relevant
Evidence from the diff
In src/core/Miner.cpp::setJob(), the patch introduces a same_job_index boolean comparing the current job index with the incoming job index. It then modifies the RandomX dataset-change nonce-reset logic so that a reset is skipped when switching to or from a donation round (index 0 <-> index 1) even if the RandomX dataset is not ready. The intent is to avoid resetting the nonce during donation round transitions, which the commit message suggests may fix issue #3669. The diff itself is a behavior fix, not a memory-safety, authentication, or cryptographic flaw.
Changed components
src/core/Miner.cppxmrig::Miner::setJob()RandomX nonce reset behaviorDonation-round job switchingInspect captured patch +3 / −1
### src/core/Miner.cpp
@@ -574,6 +574,7 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
mutex.lock();
const uint8_t index = donate ? 1 : 0;
+ const bool same_job_index = d_ptr->job.index() == index;
d_ptr->reset = !(d_ptr->job.index() == 1 && index == 0 && d_ptr->userJobId == job.id());
@@ -593,7 +594,8 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
const bool ready = d_ptr->initRX();
// Always reset nonce on RandomX dataset change
- if (!ready) {
+ // Except for switching to/from donation
+ if (!ready && same_job_index) {
d_ptr->reset = true;
}
# elseWhy 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.