From 2da551e1e98bd2ef13641e347da939aedc8c2ee4 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 14 Apr 2020 03:24:10 +0700 Subject: [PATCH 1/7] v5.11.1-dev --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index e51d3f6e0..41703feae 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig miner" -#define APP_VERSION "5.11.0-dev" +#define APP_VERSION "5.11.1-dev" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 5 #define APP_VER_MINOR 11 -#define APP_VER_PATCH 0 +#define APP_VER_PATCH 1 #ifdef _MSC_VER # if (_MSC_VER >= 1920) From 37f44b4da53c497e3d41aa7e27ad35883398ca5f Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 19 Apr 2020 04:34:43 +0700 Subject: [PATCH 2/7] Fixed keepalive extension for initial login response. --- src/base/net/stratum/Client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index 5e442bd6e..a01b6f589 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -744,6 +744,7 @@ void xmrig::Client::parseExtensions(const rapidjson::Value &result) } else if (strcmp(name, "keepalive") == 0) { setExtension(EXT_KEEPALIVE, true); + startTimeout(); } # ifdef XMRIG_FEATURE_TLS else if (strcmp(name, "tls") == 0) { From bfd017d064991009d55ebaaa35ece8f6e52473ff Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 21 Apr 2020 15:44:04 +0200 Subject: [PATCH 3/7] Refactored CFROUND --- src/crypto/randomx/jit_compiler_x86.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/crypto/randomx/jit_compiler_x86.cpp b/src/crypto/randomx/jit_compiler_x86.cpp index 1a85bcdf9..095f4d3c9 100644 --- a/src/crypto/randomx/jit_compiler_x86.cpp +++ b/src/crypto/randomx/jit_compiler_x86.cpp @@ -1048,9 +1048,9 @@ namespace randomx { if (vm_flags & RANDOMX_FLAG_AMD) { *(uint64_t*)(p + pos + 7) = 0x742024443B0CE083ULL; - *(uint8_t*)(p + pos + 15) = 8; - *(uint64_t*)(p + pos + 16) = 0x202444890414AE0FULL; - pos += 24; + *(uint64_t*)(p + pos + 15) = 0x8900EB0414AE0F0AULL; + *(uint32_t*)(p + pos + 23) = 0x202444; + pos += 26; } else { *(uint64_t*)(p + pos + 7) = 0x0414AE0F0CE083ULL; @@ -1071,9 +1071,9 @@ namespace randomx { if (vm_flags & RANDOMX_FLAG_AMD) { *(uint64_t*)(p + pos + 6) = 0x742024443B0CE083ULL; - *(uint8_t*)(p + pos + 14) = 8; - *(uint64_t*)(p + pos + 15) = 0x202444890414AE0FULL; - pos += 23; + *(uint64_t*)(p + pos + 14) = 0x8900EB0414AE0F0AULL; + *(uint32_t*)(p + pos + 22) = 0x202444; + pos += 25; } else { *(uint64_t*)(p + pos + 6) = 0x0414AE0F0CE083ULL; From 0e7036cf24152af4fed9e9194a9db00176a0f3b1 Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 22 Apr 2020 09:04:48 +0700 Subject: [PATCH 4/7] Fixed bug in log. --- src/base/net/stratum/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index a01b6f589..a38ffdb1e 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -992,7 +992,7 @@ void xmrig::Client::onConnect(uv_connect_t *req, int status) } if (client->state() == ConnectedState) { - LOG_ERR("[%s] already connected"); + LOG_ERR("[%s] already connected", client->url()); return; } From ca7ff4e90b1806c48e7327a71e3adcb8e5884a2e Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 22 Apr 2020 10:16:54 +0700 Subject: [PATCH 5/7] Fixed memory leak in some conditions. --- src/base/net/stratum/Client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index a38ffdb1e..95de98c7d 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -293,7 +293,7 @@ void xmrig::Client::tick(uint64_t now) } if (m_state == ConnectingState && m_expire && now > m_expire) { - return reconnect(); + close(); } } @@ -975,7 +975,7 @@ void xmrig::Client::onConnect(uv_connect_t *req, int status) LOG_ERR("[%s] connect error: \"%s\"", client->url(), uv_strerror(status)); } - if (client->state() == ReconnectingState) { + if (client->state() == ReconnectingState || client->state() == ClosingState) { return; } From 11ac59331fca28d2e74cc64d2bc7b58b063e238d Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 22 Apr 2020 14:49:15 +0700 Subject: [PATCH 6/7] #1654 Fixed build with LibreSSL. --- src/base/kernel/Entry.cpp | 6 +++++- src/base/kernel/config/BaseConfig.cpp | 7 ++++++- src/base/net/tls/TlsContext.cpp | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/base/kernel/Entry.cpp b/src/base/kernel/Entry.cpp index 58f9438b0..ae2ac3ce2 100644 --- a/src/base/kernel/Entry.cpp +++ b/src/base/kernel/Entry.cpp @@ -79,10 +79,14 @@ static int showVersion() printf("\nlibuv/%s\n", uv_version_string()); -# if defined(XMRIG_FEATURE_TLS) && defined(OPENSSL_VERSION_TEXT) +# if defined(XMRIG_FEATURE_TLS) { +# if defined(LIBRESSL_VERSION_TEXT) + printf("LibreSSL/%s\n", LIBRESSL_VERSION_TEXT + 9); +# elif defined(OPENSSL_VERSION_TEXT) constexpr const char *v = OPENSSL_VERSION_TEXT + 8; printf("OpenSSL/%.*s\n", static_cast(strchr(v, ' ') - v), v); +# endif } # endif diff --git a/src/base/kernel/config/BaseConfig.cpp b/src/base/kernel/config/BaseConfig.cpp index 2b5a7120e..12f5db742 100644 --- a/src/base/kernel/config/BaseConfig.cpp +++ b/src/base/kernel/config/BaseConfig.cpp @@ -145,11 +145,16 @@ void xmrig::BaseConfig::printVersions() std::string libs; -# if defined(XMRIG_FEATURE_TLS) && defined(OPENSSL_VERSION_TEXT) +# if defined(XMRIG_FEATURE_TLS) { +# if defined(LIBRESSL_VERSION_TEXT) + snprintf(buf, sizeof buf, "LibreSSL/%s ", LIBRESSL_VERSION_TEXT + 9); + libs += buf; +# elif defined(OPENSSL_VERSION_TEXT) constexpr const char *v = OPENSSL_VERSION_TEXT + 8; snprintf(buf, sizeof buf, "OpenSSL/%.*s ", static_cast(strchr(v, ' ') - v), v); libs += buf; +# endif } # endif diff --git a/src/base/net/tls/TlsContext.cpp b/src/base/net/tls/TlsContext.cpp index d29c744b4..d2ab71c5a 100644 --- a/src/base/net/tls/TlsContext.cpp +++ b/src/base/net/tls/TlsContext.cpp @@ -156,7 +156,7 @@ bool xmrig::TlsContext::load(const TlsConfig &config) SSL_CTX_set_options(m_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); SSL_CTX_set_options(m_ctx, SSL_OP_CIPHER_SERVER_PREFERENCE); -# if OPENSSL_VERSION_NUMBER >= 0x1010100fL +# if OPENSSL_VERSION_NUMBER >= 0x1010100fL && !defined(LIBRESSL_VERSION_NUMBER) SSL_CTX_set_max_early_data(m_ctx, 0); # endif @@ -184,7 +184,7 @@ bool xmrig::TlsContext::setCipherSuites(const char *ciphersuites) return true; } -# if OPENSSL_VERSION_NUMBER >= 0x1010100fL +# if OPENSSL_VERSION_NUMBER >= 0x1010100fL && !defined(LIBRESSL_VERSION_NUMBER) if (SSL_CTX_set_ciphersuites(m_ctx, ciphersuites) == 1) { return true; } From 0cc90b152deba74f87487f5b7a1d756dde1d34eb Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 23 Apr 2020 12:34:26 +0700 Subject: [PATCH 7/7] Move CnAlgo --- CHANGELOG.md | 5 +++++ CMakeLists.txt | 1 + src/backend/common/Threads.cpp | 2 +- src/backend/opencl/generators/ocl_generic_cn_generator.cpp | 2 +- src/backend/opencl/generators/ocl_vega_cn_generator.cpp | 2 +- src/backend/opencl/runners/OclCnRunner.cpp | 2 +- src/backend/opencl/runners/OclRyoRunner.cpp | 2 +- src/base/base.cmake | 1 - src/{base/crypto => crypto/cn}/CnAlgo.h | 0 src/crypto/cn/CnHash.h | 2 +- src/crypto/cn/CryptoNight_arm.h | 2 +- src/crypto/cn/CryptoNight_x86.h | 2 +- src/crypto/cn/gpu/cn_gpu_avx.cpp | 2 +- src/crypto/cn/gpu/cn_gpu_ssse3.cpp | 2 +- 14 files changed, 16 insertions(+), 11 deletions(-) rename src/{base/crypto => crypto/cn}/CnAlgo.h (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cd2e0a1c..dc4d96a72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v5.11.1 +- [#1652](https://github.com/xmrig/xmrig/pull/1652) Up to 1% RandomX perfomance improvement on recent AMD CPUs. +- [#1306](https://github.com/xmrig/xmrig/issues/1306) Fixed possible double connection to a pool. +- [#1654](https://github.com/xmrig/xmrig/issues/1654) Fixed build with LibreSSL. + # v5.11.0 - **[#1632](https://github.com/xmrig/xmrig/pull/1632) Added AstroBWT CUDA support ([CUDA plugin](https://github.com/xmrig/xmrig-cuda) v3.0.0 or newer required).** - [#1605](https://github.com/xmrig/xmrig/pull/1605) Fixed AstroBWT OpenCL for NVIDIA GPUs. diff --git a/CMakeLists.txt b/CMakeLists.txt index ba98c11ac..f9b7b2bf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,7 @@ set(HEADERS_CRYPTO src/crypto/cn/c_groestl.h src/crypto/cn/c_jh.h src/crypto/cn/c_skein.h + src/crypto/cn/CnAlgo.h src/crypto/cn/CnCtx.h src/crypto/cn/CnHash.h src/crypto/cn/CryptoNight_monero.h diff --git a/src/backend/common/Threads.cpp b/src/backend/common/Threads.cpp index a72f8026d..4b23e85d2 100644 --- a/src/backend/common/Threads.cpp +++ b/src/backend/common/Threads.cpp @@ -25,7 +25,7 @@ #include "backend/common/Threads.h" #include "backend/cpu/CpuThreads.h" -#include "base/crypto/CnAlgo.h" +#include "crypto/cn/CnAlgo.h" #include "rapidjson/document.h" diff --git a/src/backend/opencl/generators/ocl_generic_cn_generator.cpp b/src/backend/opencl/generators/ocl_generic_cn_generator.cpp index 90e80e6fd..c2d8ea7e2 100644 --- a/src/backend/opencl/generators/ocl_generic_cn_generator.cpp +++ b/src/backend/opencl/generators/ocl_generic_cn_generator.cpp @@ -27,7 +27,7 @@ #include "backend/opencl/OclThreads.h" #include "backend/opencl/wrappers/OclDevice.h" #include "base/crypto/Algorithm.h" -#include "base/crypto/CnAlgo.h" +#include "crypto/cn/CnAlgo.h" #include diff --git a/src/backend/opencl/generators/ocl_vega_cn_generator.cpp b/src/backend/opencl/generators/ocl_vega_cn_generator.cpp index 0e14dad90..5293fb228 100644 --- a/src/backend/opencl/generators/ocl_vega_cn_generator.cpp +++ b/src/backend/opencl/generators/ocl_vega_cn_generator.cpp @@ -27,7 +27,7 @@ #include "backend/opencl/OclThreads.h" #include "backend/opencl/wrappers/OclDevice.h" #include "base/crypto/Algorithm.h" -#include "base/crypto/CnAlgo.h" +#include "crypto/cn/CnAlgo.h" #include diff --git a/src/backend/opencl/runners/OclCnRunner.cpp b/src/backend/opencl/runners/OclCnRunner.cpp index 67cc4027b..c940b5fbe 100644 --- a/src/backend/opencl/runners/OclCnRunner.cpp +++ b/src/backend/opencl/runners/OclCnRunner.cpp @@ -31,9 +31,9 @@ #include "backend/opencl/OclLaunchData.h" #include "backend/opencl/runners/tools/OclCnR.h" #include "backend/opencl/wrappers/OclLib.h" -#include "base/crypto/CnAlgo.h" #include "base/io/log/Log.h" #include "base/net/stratum/Job.h" +#include "crypto/cn/CnAlgo.h" xmrig::OclCnRunner::OclCnRunner(size_t index, const OclLaunchData &data) : OclBaseRunner(index, data) diff --git a/src/backend/opencl/runners/OclRyoRunner.cpp b/src/backend/opencl/runners/OclRyoRunner.cpp index 8d494a261..1a9bb17d6 100644 --- a/src/backend/opencl/runners/OclRyoRunner.cpp +++ b/src/backend/opencl/runners/OclRyoRunner.cpp @@ -31,9 +31,9 @@ #include "backend/opencl/kernels/CnBranchKernel.h" #include "backend/opencl/OclLaunchData.h" #include "backend/opencl/wrappers/OclLib.h" -#include "base/crypto/CnAlgo.h" #include "base/io/log/Log.h" #include "base/net/stratum/Job.h" +#include "crypto/cn/CnAlgo.h" xmrig::OclRyoRunner::OclRyoRunner(size_t index, const OclLaunchData &data) : OclBaseRunner(index, data) diff --git a/src/base/base.cmake b/src/base/base.cmake index 5116da065..d32f723ea 100644 --- a/src/base/base.cmake +++ b/src/base/base.cmake @@ -1,7 +1,6 @@ set(HEADERS_BASE src/base/api/interfaces/IApiListener.h src/base/crypto/Algorithm.h - src/base/crypto/CnAlgo.h src/base/crypto/Coin.h src/base/crypto/keccak.h src/base/io/Console.h diff --git a/src/base/crypto/CnAlgo.h b/src/crypto/cn/CnAlgo.h similarity index 100% rename from src/base/crypto/CnAlgo.h rename to src/crypto/cn/CnAlgo.h diff --git a/src/crypto/cn/CnHash.h b/src/crypto/cn/CnHash.h index f0b5a7110..9c8986193 100644 --- a/src/crypto/cn/CnHash.h +++ b/src/crypto/cn/CnHash.h @@ -31,7 +31,7 @@ #include -#include "base/crypto/CnAlgo.h" +#include "crypto/cn/CnAlgo.h" #include "crypto/common/Assembly.h" diff --git a/src/crypto/cn/CryptoNight_arm.h b/src/crypto/cn/CryptoNight_arm.h index f8ddbd543..bb663ce94 100644 --- a/src/crypto/cn/CryptoNight_arm.h +++ b/src/crypto/cn/CryptoNight_arm.h @@ -28,8 +28,8 @@ #define XMRIG_CRYPTONIGHT_ARM_H -#include "base/crypto/CnAlgo.h" #include "base/crypto/keccak.h" +#include "crypto/cn/CnAlgo.h" #include "crypto/cn/CryptoNight_monero.h" #include "crypto/cn/CryptoNight.h" #include "crypto/cn/soft_aes.h" diff --git a/src/crypto/cn/CryptoNight_x86.h b/src/crypto/cn/CryptoNight_x86.h index d71af0134..4255be091 100644 --- a/src/crypto/cn/CryptoNight_x86.h +++ b/src/crypto/cn/CryptoNight_x86.h @@ -36,8 +36,8 @@ #include "backend/cpu/Cpu.h" -#include "base/crypto/CnAlgo.h" #include "base/crypto/keccak.h" +#include "crypto/cn/CnAlgo.h" #include "crypto/cn/CryptoNight_monero.h" #include "crypto/cn/CryptoNight.h" #include "crypto/cn/soft_aes.h" diff --git a/src/crypto/cn/gpu/cn_gpu_avx.cpp b/src/crypto/cn/gpu/cn_gpu_avx.cpp index d3dc7b819..b600921d6 100644 --- a/src/crypto/cn/gpu/cn_gpu_avx.cpp +++ b/src/crypto/cn/gpu/cn_gpu_avx.cpp @@ -23,7 +23,7 @@ */ -#include "base/crypto/CnAlgo.h" +#include "crypto/cn/CnAlgo.h" #ifdef __GNUC__ diff --git a/src/crypto/cn/gpu/cn_gpu_ssse3.cpp b/src/crypto/cn/gpu/cn_gpu_ssse3.cpp index 7e0ef5b79..5b592e5f9 100644 --- a/src/crypto/cn/gpu/cn_gpu_ssse3.cpp +++ b/src/crypto/cn/gpu/cn_gpu_ssse3.cpp @@ -23,7 +23,7 @@ */ -#include "base/crypto/CnAlgo.h" +#include "crypto/cn/CnAlgo.h" #ifdef __GNUC__