From ac1b554282ae1cc8b432f6e625334300781920fc Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sat, 15 Jun 2019 22:53:03 +0200 Subject: [PATCH 01/16] RandomWOW support --- CMakeLists.txt | 4 +- cmake/FindRandomWOW.cmake | 25 +++++++++++ src/base/net/stratum/Client.cpp | 8 ++++ src/base/net/stratum/DaemonClient.cpp | 2 + src/base/net/stratum/Job.cpp | 11 +++++ src/base/net/stratum/Job.h | 3 ++ src/base/net/stratum/Pool.cpp | 1 + src/common/crypto/Algorithm.cpp | 4 +- src/common/xmrig.h | 1 + src/workers/CpuThread.cpp | 8 ++++ src/workers/MultiWorker.cpp | 16 ++++++- src/workers/MultiWorker.h | 3 ++ src/workers/Workers.cpp | 64 +++++++++++++++++++++++++++ src/workers/Workers.h | 10 +++++ 14 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 cmake/FindRandomWOW.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c7098f373..8f6e9226b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,7 @@ add_definitions(/DUNICODE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") find_package(UV REQUIRED) +find_package(RANDOMWOW REQUIRED) include(cmake/flags.cmake) @@ -219,6 +220,7 @@ endif() include_directories(src) include_directories(src/3rdparty) include_directories(${UV_INCLUDE_DIR}) +include_directories(${RANDOMWOW_INCLUDE_DIR}) if (BUILD_STATIC) set(CMAKE_EXE_LINKER_FLAGS " -static") @@ -229,4 +231,4 @@ if (WITH_DEBUG_LOG) endif() add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTP_SOURCES} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES} ${CN_GPU_SOURCES}) -target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB}) +target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${RANDOMWOW_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB}) diff --git a/cmake/FindRandomWOW.cmake b/cmake/FindRandomWOW.cmake new file mode 100644 index 000000000..c1db649fa --- /dev/null +++ b/cmake/FindRandomWOW.cmake @@ -0,0 +1,25 @@ +find_path( + RANDOMWOW_INCLUDE_DIR + NAMES randomwow.h + PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" + PATH_SUFFIXES "include" + NO_DEFAULT_PATH +) + +find_path(RANDOMWOW_INCLUDE_DIR NAMES randomwow.h) + +find_library( + RANDOMWOW_LIBRARY + NAMES librandomwow.a randomwow librandomwow + PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" + PATH_SUFFIXES "lib" + NO_DEFAULT_PATH +) + +find_library(RANDOMWOW_LIBRARY NAMES librandomwow.a randomwow librandomwow) + +set(RANDOMWOW_LIBRARIES ${RANDOMWOW_LIBRARY}) +set(RANDOMWOW_INCLUDE_DIRS ${RANDOMWOW_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(RANDOMWOW DEFAULT_MSG RANDOMWOW_LIBRARY RANDOMWOW_INCLUDE_DIR) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index 1d448ddff..4941ca3a0 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -344,6 +344,14 @@ bool xmrig::Client::parseJob(const rapidjson::Value ¶ms, int *code) } } + if (params.HasMember("seed_hash")) { + const rapidjson::Value &variant = params["seed_hash"]; + + if (variant.IsString()) { + job.setSeedHash(variant.GetString()); + } + } + if (params.HasMember("height")) { const rapidjson::Value &variant = params["height"]; diff --git a/src/base/net/stratum/DaemonClient.cpp b/src/base/net/stratum/DaemonClient.cpp index 769e2116f..e63c3271d 100644 --- a/src/base/net/stratum/DaemonClient.cpp +++ b/src/base/net/stratum/DaemonClient.cpp @@ -220,6 +220,8 @@ bool xmrig::DaemonClient::parseJob(const rapidjson::Value ¶ms, int *code) return false; } + job.setSeedHash(Json::getString(params, "seed_hash")); + job.setHeight(Json::getUint64(params, kHeight)); job.setDiff(Json::getUint64(params, "difficulty")); job.setId(blocktemplate.data() + blocktemplate.size() - 32); diff --git a/src/base/net/stratum/Job.cpp b/src/base/net/stratum/Job.cpp index 1f1cd4139..36098bfe9 100644 --- a/src/base/net/stratum/Job.cpp +++ b/src/base/net/stratum/Job.cpp @@ -42,6 +42,7 @@ xmrig::Job::Job() : m_diff(0), m_height(0), m_target(0), + m_seedHash(), m_blob() { } @@ -58,6 +59,7 @@ xmrig::Job::Job(int poolId, bool nicehash, const Algorithm &algorithm, const Str m_diff(0), m_height(0), m_target(0), + m_seedHash(), m_blob() { } @@ -175,6 +177,15 @@ void xmrig::Job::setDiff(uint64_t diff) } +bool xmrig::Job::setSeedHash(const char *hash) +{ + if (!hash || (strlen(hash) != sizeof(m_seedHash) * 2)) + return false; + + return Buffer::fromHex(hash, sizeof(m_seedHash) * 2, m_seedHash); +} + + xmrig::Variant xmrig::Job::variant() const { switch (m_algorithm.algo()) { diff --git a/src/base/net/stratum/Job.h b/src/base/net/stratum/Job.h index 16e9a8611..1c1b078b8 100644 --- a/src/base/net/stratum/Job.h +++ b/src/base/net/stratum/Job.h @@ -55,6 +55,7 @@ public: bool setTarget(const char *target); void setAlgorithm(const char *algo); void setDiff(uint64_t diff); + bool setSeedHash(const char *hash); inline bool isNicehash() const { return m_nicehash; } inline bool isValid() const { return m_size > 0 && m_diff > 0; } @@ -64,6 +65,7 @@ public: inline const String &id() const { return m_id; } inline const uint32_t *nonce() const { return reinterpret_cast(m_blob + 39); } inline const uint8_t *blob() const { return m_blob; } + inline const uint8_t *seed_hash() const { return m_seedHash; } inline int poolId() const { return m_poolId; } inline int threadId() const { return m_threadId; } inline size_t size() const { return m_size; } @@ -106,6 +108,7 @@ private: uint64_t m_diff; uint64_t m_height; uint64_t m_target; + uint8_t m_seedHash[32]; uint8_t m_blob[kMaxBlobSize]; # ifdef XMRIG_PROXY_PROJECT diff --git a/src/base/net/stratum/Pool.cpp b/src/base/net/stratum/Pool.cpp index f441ba636..d3b4b4a31 100644 --- a/src/base/net/stratum/Pool.cpp +++ b/src/base/net/stratum/Pool.cpp @@ -517,6 +517,7 @@ void xmrig::Pool::rebuild() addVariant(VARIANT_RWZ); addVariant(VARIANT_ZLS); addVariant(VARIANT_DOUBLE); + addVariant(VARIANT_RX_WOW); addVariant(VARIANT_AUTO); # endif } diff --git a/src/common/crypto/Algorithm.cpp b/src/common/crypto/Algorithm.cpp index d9d3ead96..af139ae3c 100644 --- a/src/common/crypto/Algorithm.cpp +++ b/src/common/crypto/Algorithm.cpp @@ -69,6 +69,7 @@ static AlgoData const algorithms[] = { { "cryptonight/rwz", "cn/rwz", xmrig::CRYPTONIGHT, xmrig::VARIANT_RWZ }, { "cryptonight/zls", "cn/zls", xmrig::CRYPTONIGHT, xmrig::VARIANT_ZLS }, { "cryptonight/double", "cn/double", xmrig::CRYPTONIGHT, xmrig::VARIANT_DOUBLE }, + { "randomx/wow", "rx/wow", xmrig::CRYPTONIGHT, xmrig::VARIANT_RX_WOW }, # ifndef XMRIG_NO_AEON { "cryptonight-lite", "cn-lite", xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_AUTO }, @@ -138,7 +139,8 @@ static const char *variants[] = { "r", "rwz", "zls", - "double" + "double", + "rx/wow", }; diff --git a/src/common/xmrig.h b/src/common/xmrig.h index e8ca8857e..49a8d1f7e 100644 --- a/src/common/xmrig.h +++ b/src/common/xmrig.h @@ -79,6 +79,7 @@ enum Variant { VARIANT_RWZ = 14, // CryptoNight variant 2 with 3/4 iterations and reversed shuffle operation (Graft) VARIANT_ZLS = 15, // CryptoNight variant 2 with 3/4 iterations (Zelerius) VARIANT_DOUBLE = 16, // CryptoNight variant 2 with double iterations (X-CASH) + VARIANT_RX_WOW = 17, // RandomX (Wownero) VARIANT_MAX }; diff --git a/src/workers/CpuThread.cpp b/src/workers/CpuThread.cpp index 2481162ce..3bce832e0 100644 --- a/src/workers/CpuThread.cpp +++ b/src/workers/CpuThread.cpp @@ -390,6 +390,8 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a cryptonight_quad_hash, cryptonight_penta_hash, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW + # ifndef XMRIG_NO_AEON cryptonight_single_hash, cryptonight_double_hash, @@ -428,6 +430,7 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # else nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_0 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_1 @@ -446,6 +449,7 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # endif # ifndef XMRIG_NO_SUMO @@ -498,6 +502,7 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # else nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_0 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_1 @@ -516,6 +521,7 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # endif # ifndef XMRIG_NO_CN_PICO @@ -547,6 +553,7 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # else nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_0 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_1 @@ -565,6 +572,7 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # endif }; diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index 8b9e0881a..40caf3806 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -38,6 +38,12 @@ MultiWorker::MultiWorker(ThreadHandle *handle) : Worker(handle) { m_memory = Mem::create(m_ctx, m_thread->algorithm(), N); + + const int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; + m_rx_vm = randomx_create_vm(static_cast(flags), nullptr, Workers::getDataset()); + if (!m_rx_vm) { + m_rx_vm = randomx_create_vm(static_cast(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset()); + } } @@ -45,6 +51,7 @@ template MultiWorker::~MultiWorker() { Mem::release(m_ctx, N, m_memory); + randomx_destroy_vm(m_rx_vm); } @@ -126,7 +133,14 @@ void MultiWorker::start() storeStats(); } - m_thread->fn(m_state.job.algorithm().variant())(m_state.blob, m_state.job.size(), m_hash, m_ctx, m_state.job.height()); + const xmrig::Variant v = m_state.job.algorithm().variant(); + if (v == xmrig::VARIANT_RX_WOW) { + Workers::updateDataset(m_state.job.seed_hash(), m_totalWays); + randomx_calculate_hash(m_rx_vm, m_state.blob, m_state.job.size(), m_hash); + } + else { + m_thread->fn(v)(m_state.blob, m_state.job.size(), m_hash, m_ctx, m_state.job.height()); + } for (size_t i = 0; i < N; ++i) { if (*reinterpret_cast(m_hash + (i * 32) + 24) < m_state.job.target()) { diff --git a/src/workers/MultiWorker.h b/src/workers/MultiWorker.h index 99d37e442..98acded96 100644 --- a/src/workers/MultiWorker.h +++ b/src/workers/MultiWorker.h @@ -31,6 +31,7 @@ #include "Mem.h" #include "net/JobResult.h" #include "workers/Worker.h" +#include "randomwow.h" class Handle; @@ -70,6 +71,8 @@ private: State m_pausedState; State m_state; uint8_t m_hash[N * 32]; + + randomx_vm* m_rx_vm; }; diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 539901354..54373cc96 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -59,6 +59,11 @@ uv_mutex_t Workers::m_mutex; uv_rwlock_t Workers::m_rwlock; uv_timer_t *Workers::m_timer = nullptr; xmrig::Controller *Workers::m_controller = nullptr; +uv_rwlock_t Workers::m_rx_dataset_lock; +randomx_cache *Workers::m_rx_cache = nullptr; +randomx_dataset *Workers::m_rx_dataset = nullptr; +uint8_t Workers::m_rx_seed_hash[32] = {}; +std::atomic Workers::m_rx_dataset_init_thread_counter = 0; xmrig::Job Workers::job() @@ -187,6 +192,7 @@ void Workers::start(xmrig::Controller *controller) uv_mutex_init(&m_mutex); uv_rwlock_init(&m_rwlock); + uv_rwlock_init(&m_rx_dataset_lock); m_sequence = 1; m_paused = 1; @@ -356,3 +362,61 @@ void Workers::start(IWorker *worker) worker->start(); } + +void Workers::updateDataset(const uint8_t* seed_hash, const uint32_t num_threads) +{ + // Check if we need to update cache and dataset + if (memcmp(m_rx_seed_hash, seed_hash, sizeof(m_rx_seed_hash)) == 0) + return; + + const uint32_t thread_id = m_rx_dataset_init_thread_counter++; + LOG_NOTICE("Thread %u started updating RandomX dataset", thread_id); + + // Wait for all threads to get here + do { + std::this_thread::yield(); + } while (m_rx_dataset_init_thread_counter.load() != num_threads); + + // One of the threads updates cache + uv_rwlock_wrlock(&m_rx_dataset_lock); + if (memcmp(m_rx_seed_hash, seed_hash, sizeof(m_rx_seed_hash)) != 0) { + memcpy(m_rx_seed_hash, seed_hash, sizeof(m_rx_seed_hash)); + randomx_init_cache(m_rx_cache, m_rx_seed_hash, sizeof(m_rx_seed_hash)); + } + uv_rwlock_wrunlock(&m_rx_dataset_lock); + + // All threads update dataset + const uint32_t a = (randomx_dataset_item_count() * thread_id) / num_threads; + const uint32_t b = (randomx_dataset_item_count() * (thread_id + 1)) / num_threads; + randomx_init_dataset(m_rx_dataset, m_rx_cache, a, b - a); + + LOG_NOTICE("Thread %u finished updating RandomX dataset", thread_id); + + // Wait for all threads to complete + --m_rx_dataset_init_thread_counter; + do { + std::this_thread::yield(); + } while (m_rx_dataset_init_thread_counter.load() != 0); +} + +randomx_dataset* Workers::getDataset() +{ + if (m_rx_dataset) + return m_rx_dataset; + + uv_rwlock_wrlock(&m_rx_dataset_lock); + if (!m_rx_dataset) { + randomx_dataset* dataset = randomx_alloc_dataset(RANDOMX_FLAG_LARGE_PAGES); + if (!dataset) { + dataset = randomx_alloc_dataset(RANDOMX_FLAG_DEFAULT); + } + m_rx_cache = randomx_alloc_cache(static_cast(RANDOMX_FLAG_JIT | RANDOMX_FLAG_LARGE_PAGES)); + if (!m_rx_cache) { + m_rx_cache = randomx_alloc_cache(RANDOMX_FLAG_JIT); + } + m_rx_dataset = dataset; + } + uv_rwlock_wrunlock(&m_rx_dataset_lock); + + return m_rx_dataset; +} diff --git a/src/workers/Workers.h b/src/workers/Workers.h index 5b084fc2d..3f6e307d4 100644 --- a/src/workers/Workers.h +++ b/src/workers/Workers.h @@ -34,6 +34,7 @@ #include "base/net/stratum/Job.h" #include "net/JobResult.h" #include "rapidjson/fwd.h" +#include "randomwow.h" class Hashrate; @@ -72,6 +73,9 @@ public: static void threadsSummary(rapidjson::Document &doc); # endif + static void updateDataset(const uint8_t* seed_hash, uint32_t num_threads); + static randomx_dataset* getDataset(); + private: static void onReady(void *arg); static void onResult(uv_async_t *handle); @@ -114,6 +118,12 @@ private: static uv_rwlock_t m_rwlock; static uv_timer_t *m_timer; static xmrig::Controller *m_controller; + + static uv_rwlock_t m_rx_dataset_lock; + static randomx_cache *m_rx_cache; + static randomx_dataset *m_rx_dataset; + static uint8_t m_rx_seed_hash[32]; + static std::atomic m_rx_dataset_init_thread_counter; }; From 202d44c14704329c41edc194e1b11ec2e6644071 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sat, 15 Jun 2019 23:29:13 +0200 Subject: [PATCH 02/16] Fixed gcc compilation --- src/workers/Workers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 54373cc96..591f92d03 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -63,7 +63,7 @@ uv_rwlock_t Workers::m_rx_dataset_lock; randomx_cache *Workers::m_rx_cache = nullptr; randomx_dataset *Workers::m_rx_dataset = nullptr; uint8_t Workers::m_rx_seed_hash[32] = {}; -std::atomic Workers::m_rx_dataset_init_thread_counter = 0; +std::atomic Workers::m_rx_dataset_init_thread_counter = {}; xmrig::Job Workers::job() From d0ce60a73aa103dcc00da85d6b19b73c263b116a Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sat, 15 Jun 2019 23:50:31 +0200 Subject: [PATCH 03/16] Fixed auto-config --- src/core/config/Config.cpp | 3 ++- src/crypto/CryptoNight_constants.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index 88ddbb72f..fb3fefaca 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -160,7 +160,8 @@ bool xmrig::Config::finalize() const AlgoVariant av = getAlgoVariant(); m_threads.mode = m_threads.count ? Simple : Automatic; - const size_t size = CpuThread::multiway(av) * cn_select_memory(m_algorithm.algo()) / 1024; + const Variant v = m_algorithm.variant(); + const size_t size = CpuThread::multiway(av) * cn_select_memory(m_algorithm.algo(), v) / 1024; if (!m_threads.count) { m_threads.count = Cpu::info()->optimalThreadsCount(size, m_maxCpuUsage); diff --git a/src/crypto/CryptoNight_constants.h b/src/crypto/CryptoNight_constants.h index 1bc06a3bb..4a66c16b2 100644 --- a/src/crypto/CryptoNight_constants.h +++ b/src/crypto/CryptoNight_constants.h @@ -70,12 +70,12 @@ template<> inline constexpr size_t cn_select_memory() { retur template<> inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_PICO_MEMORY; } -inline size_t cn_select_memory(Algo algorithm) +inline size_t cn_select_memory(Algo algorithm, Variant v = VARIANT_AUTO) { switch(algorithm) { case CRYPTONIGHT: - return CRYPTONIGHT_MEMORY; + return (v == VARIANT_RX_WOW) ? CRYPTONIGHT_LITE_MEMORY : CRYPTONIGHT_MEMORY; case CRYPTONIGHT_LITE: return CRYPTONIGHT_LITE_MEMORY; From 50ace41766743b3462fe0d02ba982782c1aa2c3b Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sat, 15 Jun 2019 23:52:39 +0200 Subject: [PATCH 04/16] Fixed cmake for Linux --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f6e9226b..0724cfdb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,7 @@ add_definitions(/DUNICODE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") find_package(UV REQUIRED) -find_package(RANDOMWOW REQUIRED) +find_package(RandomWOW REQUIRED) include(cmake/flags.cmake) From 34e39e99466cafec83564ab836d8dcb00cdaacb2 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 18 Jun 2019 05:13:51 +0700 Subject: [PATCH 05/16] Use canonical name for RandomX, because official RandomWOW repo not rename lib or headers, still need some solution to separate it in future. --- CMakeLists.txt | 6 +++--- cmake/FindRandomWOW.cmake | 25 ------------------------- cmake/FindRandomX.cmake | 25 +++++++++++++++++++++++++ src/workers/MultiWorker.h | 4 +++- src/workers/Workers.h | 2 +- 5 files changed, 32 insertions(+), 30 deletions(-) delete mode 100644 cmake/FindRandomWOW.cmake create mode 100644 cmake/FindRandomX.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0724cfdb9..b04a99b86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,7 @@ add_definitions(/DUNICODE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") find_package(UV REQUIRED) -find_package(RandomWOW REQUIRED) +find_package(RandomX REQUIRED) include(cmake/flags.cmake) @@ -220,7 +220,7 @@ endif() include_directories(src) include_directories(src/3rdparty) include_directories(${UV_INCLUDE_DIR}) -include_directories(${RANDOMWOW_INCLUDE_DIR}) +include_directories(${RANDOMX_INCLUDE_DIR}) if (BUILD_STATIC) set(CMAKE_EXE_LINKER_FLAGS " -static") @@ -231,4 +231,4 @@ if (WITH_DEBUG_LOG) endif() add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${SOURCES_CPUID} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${HTTP_SOURCES} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES} ${CN_GPU_SOURCES}) -target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${RANDOMWOW_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB}) +target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${RANDOMX_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB}) diff --git a/cmake/FindRandomWOW.cmake b/cmake/FindRandomWOW.cmake deleted file mode 100644 index c1db649fa..000000000 --- a/cmake/FindRandomWOW.cmake +++ /dev/null @@ -1,25 +0,0 @@ -find_path( - RANDOMWOW_INCLUDE_DIR - NAMES randomwow.h - PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" - PATH_SUFFIXES "include" - NO_DEFAULT_PATH -) - -find_path(RANDOMWOW_INCLUDE_DIR NAMES randomwow.h) - -find_library( - RANDOMWOW_LIBRARY - NAMES librandomwow.a randomwow librandomwow - PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" - PATH_SUFFIXES "lib" - NO_DEFAULT_PATH -) - -find_library(RANDOMWOW_LIBRARY NAMES librandomwow.a randomwow librandomwow) - -set(RANDOMWOW_LIBRARIES ${RANDOMWOW_LIBRARY}) -set(RANDOMWOW_INCLUDE_DIRS ${RANDOMWOW_INCLUDE_DIR}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(RANDOMWOW DEFAULT_MSG RANDOMWOW_LIBRARY RANDOMWOW_INCLUDE_DIR) diff --git a/cmake/FindRandomX.cmake b/cmake/FindRandomX.cmake new file mode 100644 index 000000000..5696d5637 --- /dev/null +++ b/cmake/FindRandomX.cmake @@ -0,0 +1,25 @@ +find_path( + RANDOMX_INCLUDE_DIR + NAMES randomx.h + PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" + PATH_SUFFIXES "include" + NO_DEFAULT_PATH +) + +find_path(RANDOMX_INCLUDE_DIR NAMES randomx.h) + +find_library( + RANDOMX_LIBRARY + NAMES librandomx.a randomx librandomx + PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" + PATH_SUFFIXES "lib" + NO_DEFAULT_PATH +) + +find_library(RANDOMX_LIBRARY NAMES librandomx.a randomx librandomx) + +set(RANDOMX_LIBRARIES ${RANDOMX_LIBRARY}) +set(RANDOMX_INCLUDE_DIRS ${RANDOMX_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(RANDOMX DEFAULT_MSG RANDOMX_LIBRARY RANDOMX_INCLUDE_DIR) diff --git a/src/workers/MultiWorker.h b/src/workers/MultiWorker.h index 98acded96..874949937 100644 --- a/src/workers/MultiWorker.h +++ b/src/workers/MultiWorker.h @@ -27,11 +27,13 @@ #define XMRIG_MULTIWORKER_H +#include + + #include "base/net/stratum/Job.h" #include "Mem.h" #include "net/JobResult.h" #include "workers/Worker.h" -#include "randomwow.h" class Handle; diff --git a/src/workers/Workers.h b/src/workers/Workers.h index 3f6e307d4..3fa1d8181 100644 --- a/src/workers/Workers.h +++ b/src/workers/Workers.h @@ -30,11 +30,11 @@ #include #include #include +#include #include "base/net/stratum/Job.h" #include "net/JobResult.h" #include "rapidjson/fwd.h" -#include "randomwow.h" class Hashrate; From 2a07cf391d6b9dd845b6ad26d3239748de8d7843 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 18 Jun 2019 06:11:53 +0700 Subject: [PATCH 06/16] Allow disable RandomX support. --- CMakeLists.txt | 14 ++++++++++++-- src/crypto/common/Algorithm.cpp | 3 +++ src/workers/MultiWorker.cpp | 11 ++++++++++- src/workers/MultiWorker.h | 8 ++++++-- src/workers/Workers.cpp | 13 +++++++++++-- src/workers/Workers.h | 9 ++++++++- 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f515b1ae..697f3da5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ option(WITH_CN_LITE "CryptoNight-Lite support" ON) option(WITH_CN_HEAVY "CryptoNight-Heavy support" ON) option(WITH_CN_PICO "CryptoNight-Pico support" ON) option(WITH_CN_GPU "CryptoNight-GPU support" ON) +option(WITH_RANDOMX "RandomX support" ON) option(WITH_HTTP "HTTP protocol support (client/server)" ON) option(WITH_DEBUG_LOG "Enable debug log output" OFF) option(WITH_TLS "Enable OpenSSL support" ON) @@ -158,7 +159,17 @@ add_definitions(/DUNICODE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") find_package(UV REQUIRED) -find_package(RandomX REQUIRED) + +if (WITH_RANDOMX) + find_package(RandomX REQUIRED) + include_directories(${RANDOMX_INCLUDE_DIR}) + + add_definitions(/DXMRIG_ALGO_RANDOMX) +else() + set(RANDOMX_LIBRARIES "") + + remove_definitions(/DXMRIG_ALGO_RANDOMX) +endif() include(cmake/flags.cmake) @@ -220,7 +231,6 @@ endif() include_directories(src) include_directories(src/3rdparty) include_directories(${UV_INCLUDE_DIR}) -include_directories(${RANDOMX_INCLUDE_DIR}) if (BUILD_STATIC) set(CMAKE_EXE_LINKER_FLAGS " -static") diff --git a/src/crypto/common/Algorithm.cpp b/src/crypto/common/Algorithm.cpp index 6d8d9a65a..6f53f6a84 100644 --- a/src/crypto/common/Algorithm.cpp +++ b/src/crypto/common/Algorithm.cpp @@ -69,7 +69,10 @@ static AlgoData const algorithms[] = { { "cryptonight/rwz", "cn/rwz", xmrig::CRYPTONIGHT, xmrig::VARIANT_RWZ }, { "cryptonight/zls", "cn/zls", xmrig::CRYPTONIGHT, xmrig::VARIANT_ZLS }, { "cryptonight/double", "cn/double", xmrig::CRYPTONIGHT, xmrig::VARIANT_DOUBLE }, + +# ifdef XMRIG_ALGO_RANDOMX { "randomx/wow", "rx/wow", xmrig::CRYPTONIGHT, xmrig::VARIANT_RX_WOW }, +# endif # ifdef XMRIG_ALGO_CN_LITE { "cryptonight-lite", "cn-lite", xmrig::CRYPTONIGHT_LITE, xmrig::VARIANT_AUTO }, diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index d5a5af27f..e8a406691 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -39,11 +39,13 @@ MultiWorker::MultiWorker(ThreadHandle *handle) { m_memory = Mem::create(m_ctx, m_thread->algorithm(), N); +# ifdef XMRIG_ALGO_RANDOMX const int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; m_rx_vm = randomx_create_vm(static_cast(flags), nullptr, Workers::getDataset()); if (!m_rx_vm) { m_rx_vm = randomx_create_vm(static_cast(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset()); } +# endif } @@ -51,7 +53,10 @@ template MultiWorker::~MultiWorker() { Mem::release(m_ctx, N, m_memory); + +# ifdef XMRIG_ALGO_RANDOMX randomx_destroy_vm(m_rx_vm); +# endif } @@ -134,11 +139,15 @@ void MultiWorker::start() } const xmrig::Variant v = m_state.job.algorithm().variant(); + +# ifdef XMRIG_ALGO_RANDOMX if (v == xmrig::VARIANT_RX_WOW) { Workers::updateDataset(m_state.job.seed_hash(), m_totalWays); randomx_calculate_hash(m_rx_vm, m_state.blob, m_state.job.size(), m_hash); } - else { + else +# endif + { m_thread->fn(v)(m_state.blob, m_state.job.size(), m_hash, m_ctx, m_state.job.height()); } diff --git a/src/workers/MultiWorker.h b/src/workers/MultiWorker.h index 874949937..63dd78964 100644 --- a/src/workers/MultiWorker.h +++ b/src/workers/MultiWorker.h @@ -27,7 +27,9 @@ #define XMRIG_MULTIWORKER_H -#include +#ifdef XMRIG_ALGO_RANDOMX +# include +#endif #include "base/net/stratum/Job.h" @@ -74,7 +76,9 @@ private: State m_state; uint8_t m_hash[N * 32]; - randomx_vm* m_rx_vm; +# ifdef XMRIG_ALGO_RANDOMX + randomx_vm *m_rx_vm = nullptr; +# endif }; diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 5a23f6be3..18210b677 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -59,11 +59,14 @@ uv_mutex_t Workers::m_mutex; uv_rwlock_t Workers::m_rwlock; uv_timer_t *Workers::m_timer = nullptr; xmrig::Controller *Workers::m_controller = nullptr; + +#ifdef XMRIG_ALGO_RANDOMX uv_rwlock_t Workers::m_rx_dataset_lock; randomx_cache *Workers::m_rx_cache = nullptr; randomx_dataset *Workers::m_rx_dataset = nullptr; uint8_t Workers::m_rx_seed_hash[32] = {}; std::atomic Workers::m_rx_dataset_init_thread_counter = {}; +#endif xmrig::Job Workers::job() @@ -192,7 +195,10 @@ void Workers::start(xmrig::Controller *controller) uv_mutex_init(&m_mutex); uv_rwlock_init(&m_rwlock); + +# ifdef XMRIG_ALGO_RANDOMX uv_rwlock_init(&m_rx_dataset_lock); +# endif m_sequence = 1; m_paused = 1; @@ -363,6 +369,8 @@ void Workers::start(IWorker *worker) worker->start(); } + +#ifdef XMRIG_ALGO_RANDOMX void Workers::updateDataset(const uint8_t* seed_hash, const uint32_t num_threads) { // Check if we need to update cache and dataset @@ -370,7 +378,7 @@ void Workers::updateDataset(const uint8_t* seed_hash, const uint32_t num_threads return; const uint32_t thread_id = m_rx_dataset_init_thread_counter++; - LOG_NOTICE("Thread %u started updating RandomX dataset", thread_id); + LOG_DEBUG("Thread %u started updating RandomX dataset", thread_id); // Wait for all threads to get here do { @@ -390,7 +398,7 @@ void Workers::updateDataset(const uint8_t* seed_hash, const uint32_t num_threads const uint32_t b = (randomx_dataset_item_count() * (thread_id + 1)) / num_threads; randomx_init_dataset(m_rx_dataset, m_rx_cache, a, b - a); - LOG_NOTICE("Thread %u finished updating RandomX dataset", thread_id); + LOG_DEBUG("Thread %u finished updating RandomX dataset", thread_id); // Wait for all threads to complete --m_rx_dataset_init_thread_counter; @@ -420,3 +428,4 @@ randomx_dataset* Workers::getDataset() return m_rx_dataset; } +#endif diff --git a/src/workers/Workers.h b/src/workers/Workers.h index 3fa1d8181..39f3d5f66 100644 --- a/src/workers/Workers.h +++ b/src/workers/Workers.h @@ -30,7 +30,10 @@ #include #include #include -#include + +#ifdef XMRIG_ALGO_RANDOMX +# include +#endif #include "base/net/stratum/Job.h" #include "net/JobResult.h" @@ -73,8 +76,10 @@ public: static void threadsSummary(rapidjson::Document &doc); # endif +# ifdef XMRIG_ALGO_RANDOMX static void updateDataset(const uint8_t* seed_hash, uint32_t num_threads); static randomx_dataset* getDataset(); +# endif private: static void onReady(void *arg); @@ -119,11 +124,13 @@ private: static uv_timer_t *m_timer; static xmrig::Controller *m_controller; +# ifdef XMRIG_ALGO_RANDOMX static uv_rwlock_t m_rx_dataset_lock; static randomx_cache *m_rx_cache; static randomx_dataset *m_rx_dataset; static uint8_t m_rx_seed_hash[32]; static std::atomic m_rx_dataset_init_thread_counter; +# endif }; From e8ac01d289280fdcc400e055b4e62826c89af792 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 18 Jun 2019 19:53:11 +0200 Subject: [PATCH 07/16] RandomX fixes - Fixed possible infinite loop when updating RandomX dataset - Fixed used memory display - Allocate dataset and VM for RandomX only when it's actually used --- src/workers/MultiWorker.cpp | 25 ++++++++++++++++++------- src/workers/MultiWorker.h | 2 ++ src/workers/Workers.cpp | 13 +++++++++++-- src/workers/Workers.h | 4 +++- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index 40caf3806..aed38d635 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -36,14 +36,9 @@ template MultiWorker::MultiWorker(ThreadHandle *handle) : Worker(handle) + , m_rx_vm(nullptr) { m_memory = Mem::create(m_ctx, m_thread->algorithm(), N); - - const int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; - m_rx_vm = randomx_create_vm(static_cast(flags), nullptr, Workers::getDataset()); - if (!m_rx_vm) { - m_rx_vm = randomx_create_vm(static_cast(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset()); - } } @@ -51,7 +46,22 @@ template MultiWorker::~MultiWorker() { Mem::release(m_ctx, N, m_memory); - randomx_destroy_vm(m_rx_vm); + if (m_rx_vm) { + randomx_destroy_vm(m_rx_vm); + } +} + + +template +void MultiWorker::allocateRandomX_VM() +{ + if (!m_rx_vm) { + const int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; + m_rx_vm = randomx_create_vm(static_cast(flags), nullptr, Workers::getDataset()); + if (!m_rx_vm) { + m_rx_vm = randomx_create_vm(static_cast(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset()); + } + } } @@ -135,6 +145,7 @@ void MultiWorker::start() const xmrig::Variant v = m_state.job.algorithm().variant(); if (v == xmrig::VARIANT_RX_WOW) { + allocateRandomX_VM(); Workers::updateDataset(m_state.job.seed_hash(), m_totalWays); randomx_calculate_hash(m_rx_vm, m_state.blob, m_state.job.size(), m_hash); } diff --git a/src/workers/MultiWorker.h b/src/workers/MultiWorker.h index 98acded96..54d8c457f 100644 --- a/src/workers/MultiWorker.h +++ b/src/workers/MultiWorker.h @@ -49,6 +49,8 @@ protected: void start() override; private: + void allocateRandomX_VM(); + bool resume(const xmrig::Job &job); bool verify(xmrig::Variant variant, const uint8_t *referenceValue); bool verify2(xmrig::Variant variant, const uint8_t *referenceValue); diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 591f92d03..3819eb491 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -182,6 +182,7 @@ void Workers::start(xmrig::Controller *controller) const std::vector &threads = controller->config()->threads(); m_status.algo = controller->config()->algorithm().algo(); + m_status.variant = controller->config()->algorithm().variant(); m_status.threads = threads.size(); for (const xmrig::IThread *thread : threads) { @@ -246,7 +247,7 @@ void Workers::threadsSummary(rapidjson::Document &doc) { uv_mutex_lock(&m_mutex); const uint64_t pages[2] = { m_status.hugePages, m_status.pages }; - const uint64_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo); + const uint64_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo, m_status.variant); uv_mutex_unlock(&m_mutex); auto &allocator = doc.GetAllocator(); @@ -350,7 +351,7 @@ void Workers::start(IWorker *worker) if (m_status.started == m_status.threads) { const double percent = (double) m_status.hugePages / m_status.pages * 100.0; - const size_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo) / 1024; + const size_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo, m_status.variant) / 1024; LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " huge pages %s%zu/%zu %1.0f%%\x1B[0m memory " CYAN_BOLD("%zu KB") "", m_status.threads, m_status.ways, @@ -374,6 +375,10 @@ void Workers::updateDataset(const uint8_t* seed_hash, const uint32_t num_threads // Wait for all threads to get here do { + if (m_sequence.load(std::memory_order_relaxed) == 0) { + // Exit immediately if workers were stopped + return; + } std::this_thread::yield(); } while (m_rx_dataset_init_thread_counter.load() != num_threads); @@ -395,6 +400,10 @@ void Workers::updateDataset(const uint8_t* seed_hash, const uint32_t num_threads // Wait for all threads to complete --m_rx_dataset_init_thread_counter; do { + if (m_sequence.load(std::memory_order_relaxed) == 0) { + // Exit immediately if workers were stopped + return; + } std::this_thread::yield(); } while (m_rx_dataset_init_thread_counter.load() != 0); } diff --git a/src/workers/Workers.h b/src/workers/Workers.h index 3f6e307d4..08ebed7f4 100644 --- a/src/workers/Workers.h +++ b/src/workers/Workers.h @@ -91,7 +91,8 @@ private: started(0), threads(0), ways(0), - algo(xmrig::CRYPTONIGHT) + algo(xmrig::CRYPTONIGHT), + variant(xmrig::VARIANT_AUTO) {} size_t hugePages; @@ -100,6 +101,7 @@ private: size_t threads; size_t ways; xmrig::Algo algo; + xmrig::Variant variant; }; static bool m_active; From 41e0be111d6dec800e5695340eb60986d0a5321e Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 19 Jun 2019 01:18:31 +0700 Subject: [PATCH 08/16] v2.16.0-evo, added RandomWOW, backward compatibility with previous versions not break. --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index 309f88737..3efea229e 100644 --- a/src/version.h +++ b/src/version.h @@ -28,14 +28,14 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig CPU miner" -#define APP_VERSION "2.99.0-evo" +#define APP_VERSION "2.16.0-evo" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" #define APP_KIND "cpu" #define APP_VER_MAJOR 2 -#define APP_VER_MINOR 99 +#define APP_VER_MINOR 16 #define APP_VER_PATCH 0 #ifdef _MSC_VER From 187e55e28e0a9a4bf508926962a60b9854405dd7 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Wed, 19 Jun 2019 12:45:05 +0200 Subject: [PATCH 09/16] Fixed RandomX for CPUs without AES --- src/workers/MultiWorker.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index aed38d635..392f71e77 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -31,6 +31,7 @@ #include "workers/CpuThread.h" #include "workers/MultiWorker.h" #include "workers/Workers.h" +#include "common/cpu/Cpu.h" template @@ -56,7 +57,10 @@ template void MultiWorker::allocateRandomX_VM() { if (!m_rx_vm) { - const int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; + int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; + if (xmrig::Cpu::info()->hasAES()) + flags |= RANDOMX_FLAG_HARD_AES; + m_rx_vm = randomx_create_vm(static_cast(flags), nullptr, Workers::getDataset()); if (!m_rx_vm) { m_rx_vm = randomx_create_vm(static_cast(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset()); From cf61f4974602cc9af8205975cf7ed7e67dbfe89e Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 23 Jun 2019 14:23:29 +0700 Subject: [PATCH 10/16] Use better source for AES settings in RandomX threads. --- src/core/config/Config.cpp | 11 ++++++++--- src/core/config/Config.h | 2 +- src/workers/MultiWorker.cpp | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index 52a1e5504..450f587e5 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -56,6 +56,12 @@ xmrig::Config::Config() : } +bool xmrig::Config::isHwAES() const +{ + return (m_aesMode == AES_AUTO ? (Cpu::info()->hasAES() ? AES_HW : AES_SOFT) : m_aesMode) == AES_HW; +} + + bool xmrig::Config::read(const IJsonReader &reader, const char *fileName) { if (!BaseConfig::read(reader, fileName)) { @@ -147,11 +153,10 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const bool xmrig::Config::finalize() { if (!m_threads.cpu.empty()) { - m_threads.mode = Advanced; - const bool softAES = (m_aesMode == AES_AUTO ? (Cpu::info()->hasAES() ? AES_HW : AES_SOFT) : m_aesMode) == AES_SOFT; + m_threads.mode = Advanced; for (size_t i = 0; i < m_threads.cpu.size(); ++i) { - m_threads.list.push_back(CpuThread::createFromData(i, m_algorithm.algo(), m_threads.cpu[i], m_priority, softAES)); + m_threads.list.push_back(CpuThread::createFromData(i, m_algorithm.algo(), m_threads.cpu[i], m_priority, !isHwAES())); } return true; diff --git a/src/core/config/Config.h b/src/core/config/Config.h index 4bcb8bba3..1d8a42d91 100644 --- a/src/core/config/Config.h +++ b/src/core/config/Config.h @@ -67,10 +67,10 @@ public: Config(); + bool isHwAES() const; bool read(const IJsonReader &reader, const char *fileName) override; void getJSON(rapidjson::Document &doc) const override; - inline AesMode aesMode() const { return m_aesMode; } inline AlgoVariant algoVariant() const { return m_algoVariant; } inline Assembly assembly() const { return m_assembly; } inline bool isHugePages() const { return m_hugePages; } diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index e15b51b7a..b5f465e4c 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -31,7 +31,6 @@ #include "workers/CpuThread.h" #include "workers/MultiWorker.h" #include "workers/Workers.h" -#include "common/cpu/Cpu.h" template @@ -61,8 +60,9 @@ void MultiWorker::allocateRandomX_VM() { if (!m_rx_vm) { int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT; - if (xmrig::Cpu::info()->hasAES()) + if (!m_thread->isSoftAES()) { flags |= RANDOMX_FLAG_HARD_AES; + } m_rx_vm = randomx_create_vm(static_cast(flags), nullptr, Workers::getDataset()); if (!m_rx_vm) { From f7f2c09e89bb615378f74394d4c9883189ba5dd0 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 25 Jun 2019 08:21:40 +0700 Subject: [PATCH 11/16] Move RandowWOW to new global algorithm. --- src/Mem.cpp | 4 ++++ src/Mem.h | 8 ++++---- src/common/xmrig.h | 1 + src/crypto/cn/CryptoNight_constants.h | 5 ++++- src/crypto/common/Algorithm.cpp | 3 ++- src/workers/CpuThread.cpp | 18 ++++++++++++++++++ src/workers/MultiWorker.cpp | 10 +++++++++- src/workers/Workers.cpp | 16 ++++++++++++---- 8 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/Mem.cpp b/src/Mem.cpp index b9e0fbf96..4ae1971ff 100644 --- a/src/Mem.cpp +++ b/src/Mem.cpp @@ -68,6 +68,10 @@ MemInfo Mem::create(cryptonight_ctx **ctx, xmrig::Algo algorithm, size_t count) void Mem::release(cryptonight_ctx **ctx, size_t count, MemInfo &info) { + if (info.memory == nullptr) { + return; + } + release(info); for (size_t i = 0; i < count; ++i) { diff --git a/src/Mem.h b/src/Mem.h index bfb36b002..629f5baab 100644 --- a/src/Mem.h +++ b/src/Mem.h @@ -39,11 +39,11 @@ struct cryptonight_ctx; struct MemInfo { - alignas(16) uint8_t *memory; + alignas(16) uint8_t *memory = nullptr; - size_t hugePages; - size_t pages; - size_t size; + size_t hugePages = 0; + size_t pages = 0; + size_t size = 0; }; diff --git a/src/common/xmrig.h b/src/common/xmrig.h index 49a8d1f7e..e8aa505a3 100644 --- a/src/common/xmrig.h +++ b/src/common/xmrig.h @@ -36,6 +36,7 @@ enum Algo { CRYPTONIGHT_LITE, /* CryptoNight (1 MB) */ CRYPTONIGHT_HEAVY, /* CryptoNight (4 MB) */ CRYPTONIGHT_PICO, /* CryptoNight (256 KB) */ + RANDOM_X, /* RandomX */ ALGO_MAX }; diff --git a/src/crypto/cn/CryptoNight_constants.h b/src/crypto/cn/CryptoNight_constants.h index 4a66c16b2..d06369b4b 100644 --- a/src/crypto/cn/CryptoNight_constants.h +++ b/src/crypto/cn/CryptoNight_constants.h @@ -75,7 +75,7 @@ inline size_t cn_select_memory(Algo algorithm, Variant v = VARIANT_AUTO) switch(algorithm) { case CRYPTONIGHT: - return (v == VARIANT_RX_WOW) ? CRYPTONIGHT_LITE_MEMORY : CRYPTONIGHT_MEMORY; + return CRYPTONIGHT_MEMORY; case CRYPTONIGHT_LITE: return CRYPTONIGHT_LITE_MEMORY; @@ -86,6 +86,9 @@ inline size_t cn_select_memory(Algo algorithm, Variant v = VARIANT_AUTO) case CRYPTONIGHT_PICO: return CRYPTONIGHT_PICO_MEMORY; + case RANDOM_X: + return (v == VARIANT_RX_WOW) ? CRYPTONIGHT_LITE_MEMORY : CRYPTONIGHT_MEMORY; + default: break; } diff --git a/src/crypto/common/Algorithm.cpp b/src/crypto/common/Algorithm.cpp index 6f53f6a84..c706ae0cb 100644 --- a/src/crypto/common/Algorithm.cpp +++ b/src/crypto/common/Algorithm.cpp @@ -71,7 +71,8 @@ static AlgoData const algorithms[] = { { "cryptonight/double", "cn/double", xmrig::CRYPTONIGHT, xmrig::VARIANT_DOUBLE }, # ifdef XMRIG_ALGO_RANDOMX - { "randomx/wow", "rx/wow", xmrig::CRYPTONIGHT, xmrig::VARIANT_RX_WOW }, + { "randomx/wow", "rx/wow", xmrig::RANDOM_X, xmrig::VARIANT_RX_WOW }, + { "randomx", "rx", xmrig::RANDOM_X, xmrig::VARIANT_RX_WOW }, # endif # ifdef XMRIG_ALGO_CN_LITE diff --git a/src/workers/CpuThread.cpp b/src/workers/CpuThread.cpp index 3aece084f..de99a0cdb 100644 --- a/src/workers/CpuThread.cpp +++ b/src/workers/CpuThread.cpp @@ -574,6 +574,24 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW # endif + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_0 + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_1 + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_TUBE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_XTL + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_MSR + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_XHV + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_XAO + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RTO + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_2 + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_HALF + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_TRTL + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_GPU + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_WOW + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_4 + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RWZ + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_ZLS + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_DOUBLE + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, // VARIANT_RX_WOW }; static_assert(count == sizeof(func_table) / sizeof(func_table[0]), "func_table size mismatch"); diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index b5f465e4c..e1ef12b25 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -37,7 +37,9 @@ template MultiWorker::MultiWorker(ThreadHandle *handle) : Worker(handle) { - m_memory = Mem::create(m_ctx, m_thread->algorithm(), N); + if (m_thread->algorithm() != xmrig::RANDOM_X) { + m_memory = Mem::create(m_ctx, m_thread->algorithm(), N); + } } @@ -125,6 +127,12 @@ bool MultiWorker::selfTest() } # endif +# ifdef XMRIG_ALGO_RANDOMX + if (m_thread->algorithm() == RANDOM_X) { + return true; + } +# endif + return false; } diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 5995dcb97..458db4a51 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -359,10 +359,18 @@ void Workers::start(IWorker *worker) const double percent = (double) m_status.hugePages / m_status.pages * 100.0; const size_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo, m_status.variant) / 1024; - LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " huge pages %s%zu/%zu %1.0f%%\x1B[0m memory " CYAN_BOLD("%zu KB") "", - m_status.threads, m_status.ways, - (m_status.hugePages == m_status.pages ? GREEN_BOLD_S : (m_status.hugePages == 0 ? RED_BOLD_S : YELLOW_BOLD_S)), - m_status.hugePages, m_status.pages, percent, memory); +# ifdef XMRIG_ALGO_RANDOMX + if (m_status.algo == xmrig::RANDOM_X) { + LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " memory " CYAN_BOLD("%zu KB") "", + m_status.threads, m_status.ways, memory); + } else +# endif + { + LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " huge pages %s%zu/%zu %1.0f%%\x1B[0m memory " CYAN_BOLD("%zu KB") "", + m_status.threads, m_status.ways, + (m_status.hugePages == m_status.pages ? GREEN_BOLD_S : (m_status.hugePages == 0 ? RED_BOLD_S : YELLOW_BOLD_S)), + m_status.hugePages, m_status.pages, percent, memory); + } } uv_mutex_unlock(&m_mutex); From b0a1481909aa0f902cac05932e46d6f0015ea452 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 25 Jun 2019 10:35:10 +0700 Subject: [PATCH 12/16] Sync changes with proxy. --- src/base/net/stratum/Client.cpp | 18 +++------------- src/base/net/stratum/DaemonClient.cpp | 1 - src/base/net/stratum/Job.cpp | 31 ++++++++++++++++----------- src/base/net/stratum/Job.h | 14 ++++++------ src/workers/MultiWorker.cpp | 2 +- 5 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index 4941ca3a0..7ee0228b4 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -37,6 +37,7 @@ #endif +#include "base/io/json/Json.h" #include "base/io/json/JsonRequest.h" #include "base/io/log/Log.h" #include "base/kernel/interfaces/IClientListener.h" @@ -344,21 +345,8 @@ bool xmrig::Client::parseJob(const rapidjson::Value ¶ms, int *code) } } - if (params.HasMember("seed_hash")) { - const rapidjson::Value &variant = params["seed_hash"]; - - if (variant.IsString()) { - job.setSeedHash(variant.GetString()); - } - } - - if (params.HasMember("height")) { - const rapidjson::Value &variant = params["height"]; - - if (variant.IsUint64()) { - job.setHeight(variant.GetUint64()); - } - } + job.setSeedHash(Json::getString(params, "seed_hash")); + job.setHeight(Json::getUint64(params, "height")); if (!verifyAlgorithm(job.algorithm())) { *code = 6; diff --git a/src/base/net/stratum/DaemonClient.cpp b/src/base/net/stratum/DaemonClient.cpp index e63c3271d..70cc9151d 100644 --- a/src/base/net/stratum/DaemonClient.cpp +++ b/src/base/net/stratum/DaemonClient.cpp @@ -221,7 +221,6 @@ bool xmrig::DaemonClient::parseJob(const rapidjson::Value ¶ms, int *code) } job.setSeedHash(Json::getString(params, "seed_hash")); - job.setHeight(Json::getUint64(params, kHeight)); job.setDiff(Json::getUint64(params, "difficulty")); job.setId(blocktemplate.data() + blocktemplate.size() - 32); diff --git a/src/base/net/stratum/Job.cpp b/src/base/net/stratum/Job.cpp index 36098bfe9..b4ebb2c03 100644 --- a/src/base/net/stratum/Job.cpp +++ b/src/base/net/stratum/Job.cpp @@ -42,8 +42,8 @@ xmrig::Job::Job() : m_diff(0), m_height(0), m_target(0), - m_seedHash(), - m_blob() + m_blob(), + m_seedHash() { } @@ -59,8 +59,8 @@ xmrig::Job::Job(int poolId, bool nicehash, const Algorithm &algorithm, const Str m_diff(0), m_height(0), m_target(0), - m_seedHash(), - m_blob() + m_blob(), + m_seedHash() { } @@ -113,6 +113,20 @@ bool xmrig::Job::setBlob(const char *blob) } +bool xmrig::Job::setSeedHash(const char *hash) +{ + if (!hash || (strlen(hash) != sizeof(m_seedHash) * 2)) { + return false; + } + +# ifdef XMRIG_PROXY_PROJECT + m_rawSeedHash = hash; +# endif + + return Buffer::fromHex(hash, sizeof(m_seedHash) * 2, m_seedHash); +} + + bool xmrig::Job::setTarget(const char *target) { if (!target) { @@ -177,15 +191,6 @@ void xmrig::Job::setDiff(uint64_t diff) } -bool xmrig::Job::setSeedHash(const char *hash) -{ - if (!hash || (strlen(hash) != sizeof(m_seedHash) * 2)) - return false; - - return Buffer::fromHex(hash, sizeof(m_seedHash) * 2, m_seedHash); -} - - xmrig::Variant xmrig::Job::variant() const { switch (m_algorithm.algo()) { diff --git a/src/base/net/stratum/Job.h b/src/base/net/stratum/Job.h index 6b63fd14c..bc0ec2ebd 100644 --- a/src/base/net/stratum/Job.h +++ b/src/base/net/stratum/Job.h @@ -52,10 +52,10 @@ public: bool isEqual(const Job &other) const; bool setBlob(const char *blob); + bool setSeedHash(const char *hash); bool setTarget(const char *target); void setAlgorithm(const char *algo); void setDiff(uint64_t diff); - bool setSeedHash(const char *hash); inline bool isNicehash() const { return m_nicehash; } inline bool isValid() const { return m_size > 0 && m_diff > 0; } @@ -65,7 +65,7 @@ public: inline const String &id() const { return m_id; } inline const uint32_t *nonce() const { return reinterpret_cast(m_blob + 39); } inline const uint8_t *blob() const { return m_blob; } - inline const uint8_t *seed_hash() const { return m_seedHash; } + inline const uint8_t *seedHash() const { return m_seedHash; } inline int poolId() const { return m_poolId; } inline int threadId() const { return m_threadId; } inline size_t size() const { return m_size; } @@ -83,9 +83,10 @@ public: inline void setVariant(int variant) { m_algorithm.parseVariant(variant); } # ifdef XMRIG_PROXY_PROJECT - inline char *rawBlob() { return m_rawBlob; } - inline const char *rawBlob() const { return m_rawBlob; } - inline const char *rawTarget() const { return m_rawTarget; } + inline char *rawBlob() { return m_rawBlob; } + inline const char *rawBlob() const { return m_rawBlob; } + inline const char *rawTarget() const { return m_rawTarget; } + inline const String &rawSeedHash() const { return m_rawSeedHash; } # endif static inline uint32_t *nonce(uint8_t *blob) { return reinterpret_cast(blob + 39); } @@ -108,12 +109,13 @@ private: uint64_t m_diff; uint64_t m_height; uint64_t m_target; - uint8_t m_seedHash[32]; uint8_t m_blob[kMaxBlobSize]; + uint8_t m_seedHash[32]; # ifdef XMRIG_PROXY_PROJECT char m_rawBlob[kMaxBlobSize * 2 + 8]; char m_rawTarget[24]; + String m_rawSeedHash; # endif }; diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index e1ef12b25..d17a2c2e9 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -164,7 +164,7 @@ void MultiWorker::start() # ifdef XMRIG_ALGO_RANDOMX if (v == xmrig::VARIANT_RX_WOW) { allocateRandomX_VM(); - Workers::updateDataset(m_state.job.seed_hash(), m_totalWays); + Workers::updateDataset(m_state.job.seedHash(), m_totalWays); randomx_calculate_hash(m_rx_vm, m_state.blob, m_state.job.size(), m_hash); } else From 681365789179d3ca6882f4049489429f5eab7929 Mon Sep 17 00:00:00 2001 From: XMRig Date: Tue, 25 Jun 2019 14:17:43 +0700 Subject: [PATCH 13/16] v2.16.0-beta --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 3efea229e..b08fcdf94 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 CPU miner" -#define APP_VERSION "2.16.0-evo" +#define APP_VERSION "2.16.0-beta" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" From c2d662ff4c7aa9c2d107e79c025e250a7a7c7c13 Mon Sep 17 00:00:00 2001 From: xmrig Date: Tue, 25 Jun 2019 14:48:43 +0700 Subject: [PATCH 14/16] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b82cbf7..a7fbd8cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v2.16.0-beta +- Added RandomWOW (RandomX with different preferences) algorithm support for [Wownero](http://wownero.org/). + - Algorithm name used by miner is `randomx/wow` or `rx/wow`. + - Currently runtime algorithm switching NOT supported with other algorithms. + # v2.15.4-beta - Added global uptime and extended connection information in API. - API now return current algorithm instead of global algorithm specified in config. From f7fe0a9ac32acf3313feae667aa4bc11524cec64 Mon Sep 17 00:00:00 2001 From: xmrig Date: Wed, 26 Jun 2019 11:01:57 +0700 Subject: [PATCH 15/16] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7fbd8cf0..25fc9ad20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v2.16.0-beta -- Added RandomWOW (RandomX with different preferences) algorithm support for [Wownero](http://wownero.org/). +- [#1036](https://github.com/xmrig/xmrig/pull/1036) Added RandomWOW (RandomX with different preferences) algorithm support for [Wownero](http://wownero.org/). - Algorithm name used by miner is `randomx/wow` or `rx/wow`. - Currently runtime algorithm switching NOT supported with other algorithms. From 0aaf2d38d451919163c111818d6178f01e269c22 Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 26 Jun 2019 11:07:50 +0700 Subject: [PATCH 16/16] v2.16.1-evo --- src/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h b/src/version.h index b08fcdf94..7e849c7ed 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 CPU miner" -#define APP_VERSION "2.16.0-beta" +#define APP_VERSION "2.16.1-evo" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2019 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 2 #define APP_VER_MINOR 16 -#define APP_VER_PATCH 0 +#define APP_VER_PATCH 1 #ifdef _MSC_VER # if (_MSC_VER >= 1920)