From cbac54179a837e8e8885b16f007778d00fbb5d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Gr=C3=A4f?= Date: Tue, 5 Nov 2019 23:22:43 +0100 Subject: [PATCH] Dev (#277) # 2.2.0 * Integrated RandomxARQ algo (rx/arq) * Dashboard: * Flipped push/pull button on Dashboard * Only update algo+pool when its not donating * Fixed segfault when stopping xmrigCCServer --- CHANGELOG.md | 6 +++ README.md | 3 +- src/backend/cpu/CpuConfig.cpp | 2 + src/backend/cpu/platform/BasicCpuInfo.cpp | 2 +- src/base/io/log/backends/RemoteLog.cpp | 2 +- src/crypto/cn/CnAlgo.h | 3 ++ src/crypto/common/Algorithm.cpp | 9 ++++ src/crypto/common/Algorithm.h | 1 + src/crypto/randomx/randomx.cpp | 11 +++++ src/crypto/randomx/randomx.h | 2 + src/crypto/rx/RxAlgo.cpp | 58 ++++++++++++++++++----- src/crypto/rx/RxAlgo.h | 24 ++++++---- src/version.h | 6 +-- 13 files changed, 102 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e40329c..89eb9011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.2.0 +* Integrated RandomxARQ algo (rx/arq) +* Dashboard: + * Flipped push/pull button on Dashboard + * Only update algo+pool when its not donating +* Fixed segfault when stopping xmrigCCServer # 2.1.0 * New XMRigCCServer without dependencies and now with full TLS support on Windows * Dashboard diff --git a/README.md b/README.md index 5a274a25..6c1ad015 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Full Windows/Linux compatible, and you can mix Linux and Windows miner on one XM ## Additional features of XMRigCC (on top of XMRig) Check the [Coin Configuration](https://github.com/Bendr0id/xmrigCC/wiki/Coin-configurations) guide +* **Support of RandomxARQ variant (algo: "rx/arq")** * **Support of UPX2 variant (algo: "cn-extremelite/upx2")** * **Support of CN-Conceal variant (algo: "cn/conceal")** * **Better performance for ARMv8 CPUs** @@ -132,7 +133,7 @@ xmrigDaemon -o pool.hashvault.pro:5555 -u YOUR_WALLET -p x -k --cc-url=IP_OF_CC_ cn-pico cn-extremelite argon2/chukwa, argon2/wrkz - rx/wow, rx/loki + rx/wow, rx/loki, rx/arq --coin=COIN specify coin instead of algorithm -o, --url=URL URL of mining server -O, --userpass=U:P username:password pair for mining server diff --git a/src/backend/cpu/CpuConfig.cpp b/src/backend/cpu/CpuConfig.cpp index 70446f12..bcf26f7c 100644 --- a/src/backend/cpu/CpuConfig.cpp +++ b/src/backend/cpu/CpuConfig.cpp @@ -64,6 +64,7 @@ static const char *kCnExtremelite = "cn-extremelite"; #ifdef XMRIG_ALGO_RANDOMX static const char *kRx = "rx"; static const char *kRxWOW = "rx/wow"; +static const char *kRxARQ = "rx/arq"; #endif #ifdef XMRIG_ALGO_ARGON2 @@ -198,6 +199,7 @@ void xmrig::CpuConfig::generate() # ifdef XMRIG_ALGO_RANDOMX m_threads.move(kRx, cpu->threads(Algorithm::RX_0)); m_threads.move(kRxWOW, cpu->threads(Algorithm::RX_WOW)); + m_threads.move(kRxARQ, cpu->threads(Algorithm::RX_ARQ)); # endif generateArgon2(); diff --git a/src/backend/cpu/platform/BasicCpuInfo.cpp b/src/backend/cpu/platform/BasicCpuInfo.cpp index 31e2faa6..73f5c7e6 100644 --- a/src/backend/cpu/platform/BasicCpuInfo.cpp +++ b/src/backend/cpu/platform/BasicCpuInfo.cpp @@ -219,7 +219,7 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm) const # ifdef XMRIG_ALGO_RANDOMX if (algorithm.family() == Algorithm::RANDOM_X) { - if (algorithm == Algorithm::RX_WOW) { + if (algorithm == Algorithm::RX_WOW || algorithm == Algorithm::RX_ARQ) { return count; } diff --git a/src/base/io/log/backends/RemoteLog.cpp b/src/base/io/log/backends/RemoteLog.cpp index 1770e832..5ad6c323 100644 --- a/src/base/io/log/backends/RemoteLog.cpp +++ b/src/base/io/log/backends/RemoteLog.cpp @@ -51,7 +51,7 @@ void xmrig::RemoteLog::print(int, const char *line, size_t, size_t size, bool co m_mutex.lock(); - if (m_rows.size() == m_maxRows) { + if (m_rows.size() >= m_maxRows) { m_rows.pop_front(); } diff --git a/src/crypto/cn/CnAlgo.h b/src/crypto/cn/CnAlgo.h index edda6390..d51d5a1d 100644 --- a/src/crypto/cn/CnAlgo.h +++ b/src/crypto/cn/CnAlgo.h @@ -182,6 +182,7 @@ private: 0, // RX_0 0, // RX_WOW 0, // RX_LOKI + 0, // RX_ARQ # endif # ifdef XMRIG_ALGO_ARGON2 0, // AR2_CHUKWA @@ -225,6 +226,7 @@ private: 0, // RX_0 0, // RX_WOW 0, // RX_LOKI + 0, // RX_ARQ # endif # ifdef XMRIG_ALGO_ARGON2 0, // AR2_CHUKWA @@ -268,6 +270,7 @@ private: Algorithm::INVALID, // RX_0 Algorithm::INVALID, // RX_WOW Algorithm::INVALID, // RX_LOKI + Algorithm::INVALID, // RX_ARQ # endif # ifdef XMRIG_ALGO_ARGON2 Algorithm::INVALID, // AR2_CHUKWA diff --git a/src/crypto/common/Algorithm.cpp b/src/crypto/common/Algorithm.cpp index 7da53746..15afcb90 100644 --- a/src/crypto/common/Algorithm.cpp +++ b/src/crypto/common/Algorithm.cpp @@ -123,6 +123,8 @@ static AlgoName const algorithm_names[] = { { "RandomWOW", nullptr, Algorithm::RX_WOW }, { "randomx/loki", "rx/loki", Algorithm::RX_LOKI }, { "RandomXL", nullptr, Algorithm::RX_LOKI }, + { "randomx/arq", "rx/arq", Algorithm::RX_ARQ }, + { "RandomARQ", nullptr, Algorithm::RX_ARQ }, # endif # ifdef XMRIG_ALGO_ARGON2 { "argon2/chukwa", nullptr, Algorithm::AR2_CHUKWA }, @@ -158,6 +160,9 @@ size_t xmrig::Algorithm::l2() const case RX_WOW: return 0x20000; + case RX_ARQ: + return 0x10000; + default: break; } @@ -188,6 +193,9 @@ size_t xmrig::Algorithm::l3() const case RX_WOW: return oneMiB; + case RX_ARQ: + return oneMiB / 4; + default: break; } @@ -285,6 +293,7 @@ xmrig::Algorithm::Family xmrig::Algorithm::family(Id id) case RX_0: case RX_WOW: case RX_LOKI: + case RX_ARQ: return RANDOM_X; # endif diff --git a/src/crypto/common/Algorithm.h b/src/crypto/common/Algorithm.h index 520fb15c..e7855e1a 100644 --- a/src/crypto/common/Algorithm.h +++ b/src/crypto/common/Algorithm.h @@ -76,6 +76,7 @@ public: RX_0, // "rx/0" RandomX (reference configuration). RX_WOW, // "rx/wow" RandomWOW (Wownero). RX_LOKI, // "rx/loki" RandomXL (Loki). + RX_ARQ, // "rx/arq" RandomARQ (Arqma). # endif # ifdef XMRIG_ALGO_ARGON2 AR2_CHUKWA, // "argon2/chukwa" diff --git a/src/crypto/randomx/randomx.cpp b/src/crypto/randomx/randomx.cpp index 51680704..d0e12b86 100644 --- a/src/crypto/randomx/randomx.cpp +++ b/src/crypto/randomx/randomx.cpp @@ -75,6 +75,16 @@ RandomX_ConfigurationLoki::RandomX_ConfigurationLoki() RANDOMX_FREQ_CBRANCH = 16; } +RandomX_ConfigurationArqma::RandomX_ConfigurationArqma() +{ + ArgonIterations = 1; + ArgonSalt = "RandomARQ\x01"; + ProgramIterations = 1024; + ProgramCount = 4; + ScratchpadL2_Size = 131072; + ScratchpadL3_Size = 262144; +} + RandomX_ConfigurationBase::RandomX_ConfigurationBase() : ArgonMemory(262144) , ArgonIterations(3) @@ -232,6 +242,7 @@ void RandomX_ConfigurationBase::Apply() RandomX_ConfigurationMonero RandomX_MoneroConfig; RandomX_ConfigurationWownero RandomX_WowneroConfig; RandomX_ConfigurationLoki RandomX_LokiConfig; +RandomX_ConfigurationArqma RandomX_ArqmaConfig; RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/randomx/randomx.h b/src/crypto/randomx/randomx.h index 1a54573a..48203ae7 100644 --- a/src/crypto/randomx/randomx.h +++ b/src/crypto/randomx/randomx.h @@ -165,10 +165,12 @@ struct RandomX_ConfigurationBase struct RandomX_ConfigurationMonero : public RandomX_ConfigurationBase {}; struct RandomX_ConfigurationWownero : public RandomX_ConfigurationBase { RandomX_ConfigurationWownero(); }; struct RandomX_ConfigurationLoki : public RandomX_ConfigurationBase { RandomX_ConfigurationLoki(); }; +struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); }; extern RandomX_ConfigurationMonero RandomX_MoneroConfig; extern RandomX_ConfigurationWownero RandomX_WowneroConfig; extern RandomX_ConfigurationLoki RandomX_LokiConfig; +extern RandomX_ConfigurationArqma RandomX_ArqmaConfig; extern RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/rx/RxAlgo.cpp b/src/crypto/rx/RxAlgo.cpp index daf3ec2d..3cf97c55 100644 --- a/src/crypto/rx/RxAlgo.cpp +++ b/src/crypto/rx/RxAlgo.cpp @@ -31,19 +31,51 @@ xmrig::Algorithm::Id xmrig::RxAlgo::apply(Algorithm::Id algorithm) { - switch (algorithm) { - case Algorithm::RX_WOW: - randomx_apply_config(RandomX_WowneroConfig); - break; - - case Algorithm::RX_LOKI: - randomx_apply_config(RandomX_LokiConfig); - break; - - default: - randomx_apply_config(RandomX_MoneroConfig); - break; - } + randomx_apply_config(*base(algorithm)); return algorithm; } + + +const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm) +{ + switch (algorithm) { + case Algorithm::RX_WOW: + return &RandomX_WowneroConfig; + + case Algorithm::RX_LOKI: + return &RandomX_LokiConfig; + + case Algorithm::RX_ARQ: + return &RandomX_ArqmaConfig; + + default: + break; + } + + return &RandomX_MoneroConfig; +} + + +uint32_t xmrig::RxAlgo::version(Algorithm::Id algorithm) +{ + return algorithm == Algorithm::RX_WOW ? 103 : 104; +} + + +uint32_t xmrig::RxAlgo::programCount(Algorithm::Id algorithm) +{ + return base(algorithm)->ProgramCount; +} + + +uint32_t xmrig::RxAlgo::programIterations(Algorithm::Id algorithm) +{ + return base(algorithm)->ProgramIterations; +} + + +uint32_t xmrig::RxAlgo::programSize(Algorithm::Id algorithm) +{ + return base(algorithm)->ProgramSize; +} \ No newline at end of file diff --git a/src/crypto/rx/RxAlgo.h b/src/crypto/rx/RxAlgo.h index 95033a9c..5b4c743f 100644 --- a/src/crypto/rx/RxAlgo.h +++ b/src/crypto/rx/RxAlgo.h @@ -28,25 +28,33 @@ #define XMRIG_RX_ALGO_H -#include -#include +#include +#include #include "crypto/common/Algorithm.h" +struct RandomX_ConfigurationBase; + + namespace xmrig { -class RxAlgo -{ -public: - static Algorithm::Id apply(Algorithm::Id algorithm); -}; + class RxAlgo + { + public: + static Algorithm::Id apply(Algorithm::Id algorithm); + static const RandomX_ConfigurationBase *base(Algorithm::Id algorithm); + static uint32_t programCount(Algorithm::Id algorithm); + static uint32_t programIterations(Algorithm::Id algorithm); + static uint32_t programSize(Algorithm::Id algorithm); + static uint32_t version(Algorithm::Id algorithm); + }; } /* namespace xmrig */ -#endif /* XMRIG_RX_ALGO_H */ +#endif /* XMRIG_RX_ALGO_H */ \ No newline at end of file diff --git a/src/version.h b/src/version.h index 1274a5ea..c9f5a966 100644 --- a/src/version.h +++ b/src/version.h @@ -28,15 +28,15 @@ #define APP_ID "XMRigCC" #define APP_NAME "XMRigCC" #define APP_DESC "XMRigCC CPU miner" -#define APP_VERSION "2.1.1" +#define APP_VERSION "2.2.0" #define APP_DOMAIN "" #define APP_SITE "https://github.com/BenDr0id/xmrigCC/" #define APP_COPYRIGHT "Copyright (C) 2017- XMRigCC" #define APP_KIND "cpu" #define APP_VER_MAJOR 2 -#define APP_VER_MINOR 1 -#define APP_VER_PATCH 1 +#define APP_VER_MINOR 2 +#define APP_VER_PATCH 0 #ifndef NDEBUG #define BUILD_TYPE "DEBUG"