Fixing miner issues

- Switch from full-block to header-only (140-byte) RandomX input
- Add 32-byte SoloNonce system for solo mining mode
- Compute proper difficulty target from compact bits field
- Add SHA256D dual-hash PoW check in CpuWorker for solo mining
- Raise RandomX dataset/scratchpad limits to 4GB/4MB
- Use standard RandomX share filtering in pool (stratum) mode
This commit is contained in:
2026-03-05 06:00:55 -06:00
parent a27a1e327b
commit 95d3ff2c4a
12 changed files with 529 additions and 185 deletions

View File

@@ -76,7 +76,10 @@ public:
inline const String &poolWallet() const { return m_poolWallet; }
inline const uint32_t *nonce() const { return reinterpret_cast<const uint32_t*>(m_blob + nonceOffset()); }
inline const uint8_t *blob() const { return m_blob; }
inline size_t nonceSize() const { return (algorithm().family() == Algorithm::KAWPOW) ? 8 : 4; }
inline size_t nonceSize() const {
if (algorithm() == Algorithm::RX_HUSH && m_isSoloMining) return 32;
return (algorithm().family() == Algorithm::KAWPOW) ? 8 : 4;
}
inline size_t size() const { return m_size; }
inline uint32_t *nonce() { return reinterpret_cast<uint32_t*>(m_blob + nonceOffset()); }
inline uint32_t backend() const { return m_backend; }
@@ -96,6 +99,13 @@ public:
inline void setHeight(uint64_t height) { m_height = height; }
inline void setIndex(uint8_t index) { m_index = index; }
inline void setPoolWallet(const String &poolWallet) { m_poolWallet = poolWallet; }
inline void setTarget64(uint64_t target) { m_target = target; m_diff = toDiff(target); }
// Solo mining support
inline bool isSoloMining() const { return m_isSoloMining; }
inline void setSoloMining(bool solo) { m_isSoloMining = solo; }
void setHushHeader(const uint8_t *header108);
# ifdef XMRIG_PROXY_PROJECT
inline char *rawBlob() { return m_rawBlob; }
@@ -161,6 +171,7 @@ private:
uint64_t m_target = 0;
uint8_t m_blob[kMaxBlobSize]{ 0 };
uint8_t m_index = 0;
bool m_isSoloMining = false;
# ifdef XMRIG_PROXY_PROJECT
char m_rawBlob[kMaxBlobSize * 2 + 8]{};