Merge branch 'dev'
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
# v5.9.0
|
||||||
|
- [#1578](https://github.com/xmrig/xmrig/pull/1578) Added new RandomKEVA algorithm for upcoming Kevacoin fork, as `"algo": "rx/keva"` or `"coin": "keva"`.
|
||||||
|
- [#1584](https://github.com/xmrig/xmrig/pull/1584) Fixed invalid AstroBWT hashes after algorithm switching.
|
||||||
|
- [#1585](https://github.com/xmrig/xmrig/issues/1585) Fixed build without HTTP support.
|
||||||
|
- Added command line option `--astrobwt-max-size`.
|
||||||
|
|
||||||
# v5.8.2
|
# v5.8.2
|
||||||
- [#1580](https://github.com/xmrig/xmrig/pull/1580) AstroBWT algorithm 20-50% speedup.
|
- [#1580](https://github.com/xmrig/xmrig/pull/1580) AstroBWT algorithm 20-50% speedup.
|
||||||
- Added new option `astrobwt-max-size`.
|
- Added new option `astrobwt-max-size`.
|
||||||
|
@ -67,6 +67,7 @@ CPU backend:
|
|||||||
--randomx-1gb-pages use 1GB hugepages for dataset (Linux only)
|
--randomx-1gb-pages use 1GB hugepages for dataset (Linux only)
|
||||||
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
|
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
|
||||||
--randomx-no-rdmsr disable reverting initial MSR values on exit
|
--randomx-no-rdmsr disable reverting initial MSR values on exit
|
||||||
|
--astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200
|
||||||
|
|
||||||
API:
|
API:
|
||||||
--api-worker-id=ID custom worker-id for API
|
--api-worker-id=ID custom worker-id for API
|
||||||
|
@ -60,6 +60,7 @@ function rx()
|
|||||||
'randomx_constants_wow.h',
|
'randomx_constants_wow.h',
|
||||||
'randomx_constants_loki.h',
|
'randomx_constants_loki.h',
|
||||||
'randomx_constants_arqma.h',
|
'randomx_constants_arqma.h',
|
||||||
|
'randomx_constants_keva.h',
|
||||||
'aes.cl',
|
'aes.cl',
|
||||||
'blake2b.cl',
|
'blake2b.cl',
|
||||||
'randomx_vm.cl',
|
'randomx_vm.cl',
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -61,7 +61,7 @@ xmrig::App::~App()
|
|||||||
int xmrig::App::exec()
|
int xmrig::App::exec()
|
||||||
{
|
{
|
||||||
if (!m_controller->isReady()) {
|
if (!m_controller->isReady()) {
|
||||||
LOG_EMERG("no valid configuration found.");
|
LOG_EMERG("no valid configuration found, try https://xmrig.com/wizard");
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -91,8 +91,6 @@ rapidjson::Value xmrig::Cpu::toJSON(rapidjson::Document &doc)
|
|||||||
|
|
||||||
void xmrig::Cpu::release()
|
void xmrig::Cpu::release()
|
||||||
{
|
{
|
||||||
assert(cpuInfo != nullptr);
|
|
||||||
|
|
||||||
delete cpuInfo;
|
delete cpuInfo;
|
||||||
cpuInfo = nullptr;
|
cpuInfo = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -58,8 +58,8 @@ public:
|
|||||||
inline bool isYield() const { return m_yield; }
|
inline bool isYield() const { return m_yield; }
|
||||||
inline const Assembly &assembly() const { return m_assembly; }
|
inline const Assembly &assembly() const { return m_assembly; }
|
||||||
inline const String &argon2Impl() const { return m_argon2Impl; }
|
inline const String &argon2Impl() const { return m_argon2Impl; }
|
||||||
inline int astrobwtMaxSize() const { return m_astrobwtMaxSize; }
|
|
||||||
inline const Threads<CpuThreads> &threads() const { return m_threads; }
|
inline const Threads<CpuThreads> &threads() const { return m_threads; }
|
||||||
|
inline int astrobwtMaxSize() const { return m_astrobwtMaxSize; }
|
||||||
inline int priority() const { return m_priority; }
|
inline int priority() const { return m_priority; }
|
||||||
inline uint32_t limit() const { return m_limit; }
|
inline uint32_t limit() const { return m_limit; }
|
||||||
|
|
||||||
@ -70,18 +70,18 @@ private:
|
|||||||
|
|
||||||
inline void setPriority(int priority) { m_priority = (priority >= -1 && priority <= 5) ? priority : -1; }
|
inline void setPriority(int priority) { m_priority = (priority >= -1 && priority <= 5) ? priority : -1; }
|
||||||
|
|
||||||
AesMode m_aes = AES_AUTO;
|
AesMode m_aes = AES_AUTO;
|
||||||
Assembly m_assembly;
|
Assembly m_assembly;
|
||||||
bool m_enabled = true;
|
bool m_enabled = true;
|
||||||
bool m_hugePages = true;
|
bool m_hugePages = true;
|
||||||
bool m_shouldSave = false;
|
bool m_shouldSave = false;
|
||||||
bool m_yield = true;
|
bool m_yield = true;
|
||||||
int m_memoryPool = 0;
|
int m_astrobwtMaxSize = 550;
|
||||||
int m_priority = -1;
|
int m_memoryPool = 0;
|
||||||
|
int m_priority = -1;
|
||||||
String m_argon2Impl;
|
String m_argon2Impl;
|
||||||
int m_astrobwtMaxSize = 550;
|
|
||||||
Threads<CpuThreads> m_threads;
|
Threads<CpuThreads> m_threads;
|
||||||
uint32_t m_limit = 100;
|
uint32_t m_limit = 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -109,11 +109,11 @@ template<>
|
|||||||
size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32_t limit)
|
size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32_t limit)
|
||||||
{
|
{
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
|
auto cpuInfo = Cpu::info();
|
||||||
auto wow = Cpu::info()->threads(Algorithm::RX_WOW, limit);
|
auto wow = cpuInfo->threads(Algorithm::RX_WOW, limit);
|
||||||
|
|
||||||
if (!threads.isExist(Algorithm::RX_ARQ)) {
|
if (!threads.isExist(Algorithm::RX_ARQ)) {
|
||||||
auto arq = Cpu::info()->threads(Algorithm::RX_ARQ, limit);
|
auto arq = cpuInfo->threads(Algorithm::RX_ARQ, limit);
|
||||||
if (arq == wow) {
|
if (arq == wow) {
|
||||||
threads.setAlias(Algorithm::RX_ARQ, "rx/wow");
|
threads.setAlias(Algorithm::RX_ARQ, "rx/wow");
|
||||||
++count;
|
++count;
|
||||||
@ -123,6 +123,17 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!threads.isExist(Algorithm::RX_KEVA)) {
|
||||||
|
auto keva = cpuInfo->threads(Algorithm::RX_KEVA, limit);
|
||||||
|
if (keva == wow) {
|
||||||
|
threads.setAlias(Algorithm::RX_KEVA, "rx/wow");
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
count += threads.move("rx/keva", std::move(keva));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!threads.isExist(Algorithm::RX_WOW)) {
|
if (!threads.isExist(Algorithm::RX_WOW)) {
|
||||||
count += threads.move("rx/wow", std::move(wow));
|
count += threads.move("rx/wow", std::move(wow));
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -115,6 +115,7 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
|||||||
auto rx = CudaThreads(devices, Algorithm::RX_0);
|
auto rx = CudaThreads(devices, Algorithm::RX_0);
|
||||||
auto wow = CudaThreads(devices, Algorithm::RX_WOW);
|
auto wow = CudaThreads(devices, Algorithm::RX_WOW);
|
||||||
auto arq = CudaThreads(devices, Algorithm::RX_ARQ);
|
auto arq = CudaThreads(devices, Algorithm::RX_ARQ);
|
||||||
|
auto kva = CudaThreads(devices, Algorithm::RX_KEVA);
|
||||||
|
|
||||||
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
|
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
|
||||||
count += threads.move("rx/wow", std::move(wow));
|
count += threads.move("rx/wow", std::move(wow));
|
||||||
@ -124,6 +125,10 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
|||||||
count += threads.move("rx/arq", std::move(arq));
|
count += threads.move("rx/arq", std::move(arq));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!threads.isExist(Algorithm::RX_KEVA) && kva != rx) {
|
||||||
|
count += threads.move("rx/keva", std::move(kva));
|
||||||
|
}
|
||||||
|
|
||||||
count += threads.move("rx", std::move(rx));
|
count += threads.move("rx", std::move(rx));
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
@ -22,9 +22,10 @@
|
|||||||
#define ALGO_RX_LOKI 21
|
#define ALGO_RX_LOKI 21
|
||||||
#define ALGO_RX_ARQMA 22
|
#define ALGO_RX_ARQMA 22
|
||||||
#define ALGO_RX_SFX 23
|
#define ALGO_RX_SFX 23
|
||||||
#define ALGO_AR2_CHUKWA 24
|
#define ALGO_RX_KEVA 24
|
||||||
#define ALGO_AR2_WRKZ 25
|
#define ALGO_AR2_CHUKWA 25
|
||||||
#define ALGO_ASTROBWT_DERO 26
|
#define ALGO_AR2_WRKZ 26
|
||||||
|
#define ALGO_ASTROBWT_DERO 27
|
||||||
|
|
||||||
#define FAMILY_UNKNOWN 0
|
#define FAMILY_UNKNOWN 0
|
||||||
#define FAMILY_CN 1
|
#define FAMILY_CN 1
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -8,6 +8,8 @@
|
|||||||
#include "randomx_constants_loki.h"
|
#include "randomx_constants_loki.h"
|
||||||
#elif (ALGO == ALGO_RX_ARQMA)
|
#elif (ALGO == ALGO_RX_ARQMA)
|
||||||
#include "randomx_constants_arqma.h"
|
#include "randomx_constants_arqma.h"
|
||||||
|
#elif (ALGO == ALGO_RX_KEVA)
|
||||||
|
#include "randomx_constants_keva.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "aes.cl"
|
#include "aes.cl"
|
||||||
|
File diff suppressed because it is too large
Load Diff
96
src/backend/opencl/cl/rx/randomx_constants_keva.h
Normal file
96
src/backend/opencl/cl/rx/randomx_constants_keva.h
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2019 SChernykh
|
||||||
|
|
||||||
|
This file is part of RandomX OpenCL.
|
||||||
|
|
||||||
|
RandomX OpenCL is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
RandomX OpenCL is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//Dataset base size in bytes. Must be a power of 2.
|
||||||
|
#define RANDOMX_DATASET_BASE_SIZE 2147483648
|
||||||
|
|
||||||
|
//Dataset extra size. Must be divisible by 64.
|
||||||
|
#define RANDOMX_DATASET_EXTRA_SIZE 33554368
|
||||||
|
|
||||||
|
//Scratchpad L3 size in bytes. Must be a power of 2.
|
||||||
|
#define RANDOMX_SCRATCHPAD_L3 1048576
|
||||||
|
|
||||||
|
//Scratchpad L2 size in bytes. Must be a power of two and less than or equal to RANDOMX_SCRATCHPAD_L3.
|
||||||
|
#define RANDOMX_SCRATCHPAD_L2 131072
|
||||||
|
|
||||||
|
//Scratchpad L1 size in bytes. Must be a power of two (minimum 64) and less than or equal to RANDOMX_SCRATCHPAD_L2.
|
||||||
|
#define RANDOMX_SCRATCHPAD_L1 16384
|
||||||
|
|
||||||
|
//Jump condition mask size in bits.
|
||||||
|
#define RANDOMX_JUMP_BITS 8
|
||||||
|
|
||||||
|
//Jump condition mask offset in bits. The sum of RANDOMX_JUMP_BITS and RANDOMX_JUMP_OFFSET must not exceed 16.
|
||||||
|
#define RANDOMX_JUMP_OFFSET 8
|
||||||
|
|
||||||
|
//Integer instructions
|
||||||
|
#define RANDOMX_FREQ_IADD_RS 16
|
||||||
|
#define RANDOMX_FREQ_IADD_M 7
|
||||||
|
#define RANDOMX_FREQ_ISUB_R 16
|
||||||
|
#define RANDOMX_FREQ_ISUB_M 7
|
||||||
|
#define RANDOMX_FREQ_IMUL_R 16
|
||||||
|
#define RANDOMX_FREQ_IMUL_M 4
|
||||||
|
#define RANDOMX_FREQ_IMULH_R 4
|
||||||
|
#define RANDOMX_FREQ_IMULH_M 1
|
||||||
|
#define RANDOMX_FREQ_ISMULH_R 4
|
||||||
|
#define RANDOMX_FREQ_ISMULH_M 1
|
||||||
|
#define RANDOMX_FREQ_IMUL_RCP 8
|
||||||
|
#define RANDOMX_FREQ_INEG_R 2
|
||||||
|
#define RANDOMX_FREQ_IXOR_R 15
|
||||||
|
#define RANDOMX_FREQ_IXOR_M 5
|
||||||
|
#define RANDOMX_FREQ_IROR_R 8
|
||||||
|
#define RANDOMX_FREQ_IROL_R 2
|
||||||
|
#define RANDOMX_FREQ_ISWAP_R 4
|
||||||
|
|
||||||
|
//Floating point instructions
|
||||||
|
#define RANDOMX_FREQ_FSWAP_R 4
|
||||||
|
#define RANDOMX_FREQ_FADD_R 16
|
||||||
|
#define RANDOMX_FREQ_FADD_M 5
|
||||||
|
#define RANDOMX_FREQ_FSUB_R 16
|
||||||
|
#define RANDOMX_FREQ_FSUB_M 5
|
||||||
|
#define RANDOMX_FREQ_FSCAL_R 6
|
||||||
|
#define RANDOMX_FREQ_FMUL_R 32
|
||||||
|
#define RANDOMX_FREQ_FDIV_M 4
|
||||||
|
#define RANDOMX_FREQ_FSQRT_R 6
|
||||||
|
|
||||||
|
//Control instructions
|
||||||
|
#define RANDOMX_FREQ_CBRANCH 25
|
||||||
|
#define RANDOMX_FREQ_CFROUND 1
|
||||||
|
|
||||||
|
//Store instruction
|
||||||
|
#define RANDOMX_FREQ_ISTORE 16
|
||||||
|
|
||||||
|
//No-op instruction
|
||||||
|
#define RANDOMX_FREQ_NOP 0
|
||||||
|
|
||||||
|
#define RANDOMX_DATASET_ITEM_SIZE 64
|
||||||
|
|
||||||
|
#define RANDOMX_PROGRAM_SIZE 256
|
||||||
|
|
||||||
|
#define HASH_SIZE 64
|
||||||
|
#define ENTROPY_SIZE (128 + RANDOMX_PROGRAM_SIZE * 8)
|
||||||
|
#define REGISTERS_SIZE 256
|
||||||
|
#define IMM_BUF_SIZE (RANDOMX_PROGRAM_SIZE * 4 - REGISTERS_SIZE)
|
||||||
|
#define IMM_INDEX_COUNT ((IMM_BUF_SIZE / 4) - 2)
|
||||||
|
#define VM_STATE_SIZE (REGISTERS_SIZE + IMM_BUF_SIZE + RANDOMX_PROGRAM_SIZE * 4)
|
||||||
|
#define ROUNDING_MODE (RANDOMX_FREQ_CFROUND ? -1 : 0)
|
||||||
|
|
||||||
|
// Scratchpad L1/L2/L3 bits
|
||||||
|
#define LOC_L1 (32 - 14)
|
||||||
|
#define LOC_L2 (32 - 17)
|
||||||
|
#define LOC_L3 (32 - 20)
|
@ -34,7 +34,6 @@ set(HEADERS_BASE
|
|||||||
src/base/kernel/Signals.h
|
src/base/kernel/Signals.h
|
||||||
src/base/net/dns/Dns.h
|
src/base/net/dns/Dns.h
|
||||||
src/base/net/dns/DnsRecord.h
|
src/base/net/dns/DnsRecord.h
|
||||||
src/base/net/http/Fetch.h
|
|
||||||
src/base/net/http/Http.h
|
src/base/net/http/Http.h
|
||||||
src/base/net/http/HttpListener.h
|
src/base/net/http/HttpListener.h
|
||||||
src/base/net/stratum/BaseClient.h
|
src/base/net/stratum/BaseClient.h
|
||||||
@ -81,10 +80,7 @@ set(SOURCES_BASE
|
|||||||
src/base/kernel/Signals.cpp
|
src/base/kernel/Signals.cpp
|
||||||
src/base/net/dns/Dns.cpp
|
src/base/net/dns/Dns.cpp
|
||||||
src/base/net/dns/DnsRecord.cpp
|
src/base/net/dns/DnsRecord.cpp
|
||||||
src/base/net/http/Fetch.cpp
|
|
||||||
src/base/net/http/Http.cpp
|
src/base/net/http/Http.cpp
|
||||||
src/base/net/http/HttpData.cpp
|
|
||||||
src/base/net/http/HttpListener.cpp
|
|
||||||
src/base/net/stratum/BaseClient.cpp
|
src/base/net/stratum/BaseClient.cpp
|
||||||
src/base/net/stratum/Client.cpp
|
src/base/net/stratum/Client.cpp
|
||||||
src/base/net/stratum/Job.cpp
|
src/base/net/stratum/Job.cpp
|
||||||
@ -148,6 +144,7 @@ if (WITH_HTTP)
|
|||||||
src/base/kernel/interfaces/IHttpListener.h
|
src/base/kernel/interfaces/IHttpListener.h
|
||||||
src/base/kernel/interfaces/IJsonReader.h
|
src/base/kernel/interfaces/IJsonReader.h
|
||||||
src/base/kernel/interfaces/ITcpServerListener.h
|
src/base/kernel/interfaces/ITcpServerListener.h
|
||||||
|
src/base/net/http/Fetch.h
|
||||||
src/base/net/http/HttpApiResponse.h
|
src/base/net/http/HttpApiResponse.h
|
||||||
src/base/net/http/HttpClient.h
|
src/base/net/http/HttpClient.h
|
||||||
src/base/net/http/HttpContext.h
|
src/base/net/http/HttpContext.h
|
||||||
@ -165,9 +162,12 @@ if (WITH_HTTP)
|
|||||||
src/base/api/Httpd.cpp
|
src/base/api/Httpd.cpp
|
||||||
src/base/api/requests/ApiRequest.cpp
|
src/base/api/requests/ApiRequest.cpp
|
||||||
src/base/api/requests/HttpApiRequest.cpp
|
src/base/api/requests/HttpApiRequest.cpp
|
||||||
|
src/base/net/http/Fetch.cpp
|
||||||
src/base/net/http/HttpApiResponse.cpp
|
src/base/net/http/HttpApiResponse.cpp
|
||||||
src/base/net/http/HttpClient.cpp
|
src/base/net/http/HttpClient.cpp
|
||||||
src/base/net/http/HttpContext.cpp
|
src/base/net/http/HttpContext.cpp
|
||||||
|
src/base/net/http/HttpData.cpp
|
||||||
|
src/base/net/http/HttpListener.cpp
|
||||||
src/base/net/http/HttpResponse.cpp
|
src/base/net/http/HttpResponse.cpp
|
||||||
src/base/net/http/HttpServer.cpp
|
src/base/net/http/HttpServer.cpp
|
||||||
src/base/net/stratum/DaemonClient.cpp
|
src/base/net/stratum/DaemonClient.cpp
|
||||||
|
@ -25,6 +25,24 @@
|
|||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
static void fsWriteCallback(uv_fs_t *req)
|
||||||
|
{
|
||||||
|
delete [] static_cast<char *>(req->data);
|
||||||
|
|
||||||
|
uv_fs_req_cleanup(req);
|
||||||
|
delete req;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static const char *kNewLine = "\n";
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::FileLogWriter::open(const char *fileName)
|
bool xmrig::FileLogWriter::open(const char *fileName)
|
||||||
{
|
{
|
||||||
assert(fileName != nullptr);
|
assert(fileName != nullptr);
|
||||||
@ -52,12 +70,25 @@ bool xmrig::FileLogWriter::write(const char *data, size_t size)
|
|||||||
auto req = new uv_fs_t;
|
auto req = new uv_fs_t;
|
||||||
req->data = buf.base;
|
req->data = buf.base;
|
||||||
|
|
||||||
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, [](uv_fs_t *req) {
|
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, fsWriteCallback);
|
||||||
delete [] static_cast<char *>(req->data);
|
|
||||||
|
return true;
|
||||||
uv_fs_req_cleanup(req);
|
}
|
||||||
delete req;
|
|
||||||
});
|
|
||||||
|
bool xmrig::FileLogWriter::writeLine(const char *data, size_t size)
|
||||||
|
{
|
||||||
|
uv_buf_t buf[2] = {
|
||||||
|
uv_buf_init(new char[size], size),
|
||||||
|
uv_buf_init(const_cast<char *>(kNewLine), 1)
|
||||||
|
};
|
||||||
|
|
||||||
|
memcpy(buf[0].base, data, size);
|
||||||
|
|
||||||
|
auto req = new uv_fs_t;
|
||||||
|
req->data = buf[0].base;
|
||||||
|
|
||||||
|
uv_fs_write(uv_default_loop(), req, m_file, buf, 2, -1, fsWriteCallback);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ public:
|
|||||||
|
|
||||||
bool open(const char *fileName);
|
bool open(const char *fileName);
|
||||||
bool write(const char *data, size_t size);
|
bool write(const char *data, size_t size);
|
||||||
|
bool writeLine(const char *data, size_t size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_file = -1;
|
int m_file = -1;
|
||||||
|
@ -97,6 +97,7 @@ public:
|
|||||||
CPUMaxThreadsKey = 1026,
|
CPUMaxThreadsKey = 1026,
|
||||||
MemoryPoolKey = 1027,
|
MemoryPoolKey = 1027,
|
||||||
YieldKey = 1030,
|
YieldKey = 1030,
|
||||||
|
AstroBWTMaxSizeKey = 1034,
|
||||||
|
|
||||||
// xmrig amd
|
// xmrig amd
|
||||||
OclPlatformKey = 1400,
|
OclPlatformKey = 1400,
|
||||||
|
@ -156,6 +156,11 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||||||
return set(doc, kCpu, "asm", arg);
|
return set(doc, kCpu, "asm", arg);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_ASTROBWT
|
||||||
|
case IConfig::AstroBWTMaxSizeKey: /* --astrobwt-max-size */
|
||||||
|
return set(doc, kCpu, "astrobwt-max-size", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
case IConfig::RandomXInitKey: /* --randomx-init */
|
case IConfig::RandomXInitKey: /* --randomx-init */
|
||||||
return set(doc, kRandomX, "init", static_cast<int64_t>(strtol(arg, nullptr, 10)));
|
return set(doc, kRandomX, "init", static_cast<int64_t>(strtol(arg, nullptr, 10)));
|
||||||
|
@ -107,6 +107,9 @@ static const option options[] = {
|
|||||||
{ "randomx-no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
{ "randomx-no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
||||||
{ "no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
{ "no-rdmsr", 0, nullptr, IConfig::RandomXRdmsrKey },
|
||||||
# endif
|
# endif
|
||||||
|
#ifdef XMRIG_ALGO_ASTROBWT
|
||||||
|
{ "astrobwt-max-size", 1, nullptr, IConfig::AstroBWTMaxSizeKey },
|
||||||
|
#endif
|
||||||
# ifdef XMRIG_FEATURE_OPENCL
|
# ifdef XMRIG_FEATURE_OPENCL
|
||||||
{ "opencl", 0, nullptr, IConfig::OclKey },
|
{ "opencl", 0, nullptr, IConfig::OclKey },
|
||||||
{ "opencl-devices", 1, nullptr, IConfig::OclDevicesKey },
|
{ "opencl-devices", 1, nullptr, IConfig::OclDevicesKey },
|
||||||
|
@ -94,6 +94,10 @@ static inline const std::string &usage()
|
|||||||
u += " --randomx-no-rdmsr disable reverting initial MSR values on exit\n";
|
u += " --randomx-no-rdmsr disable reverting initial MSR values on exit\n";
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_ASTROBWT
|
||||||
|
u += " --astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200\n";
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_HTTP
|
# ifdef XMRIG_FEATURE_HTTP
|
||||||
u += "\nAPI:\n";
|
u += "\nAPI:\n";
|
||||||
u += " --api-worker-id=ID custom worker-id for API\n";
|
u += " --api-worker-id=ID custom worker-id for API\n";
|
||||||
|
@ -65,6 +65,7 @@ static void Salsa20_XORKeyStream(const void* key, void* output, size_t size)
|
|||||||
ECRYPT_keysetup(&ctx, static_cast<const uint8_t*>(key), 256, 64);
|
ECRYPT_keysetup(&ctx, static_cast<const uint8_t*>(key), 256, 64);
|
||||||
ECRYPT_ivsetup(&ctx, iv);
|
ECRYPT_ivsetup(&ctx, iv);
|
||||||
ECRYPT_keystream_bytes(&ctx, static_cast<uint8_t*>(output), size);
|
ECRYPT_keystream_bytes(&ctx, static_cast<uint8_t*>(output), size);
|
||||||
|
memset(static_cast<uint8_t*>(output) - 16, 0, 16);
|
||||||
memset(static_cast<uint8_t*>(output) + size, 0, 16);
|
memset(static_cast<uint8_t*>(output) + size, 0, 16);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -75,6 +76,7 @@ static void Salsa20_XORKeyStream(const void* key, void* output, size_t size)
|
|||||||
const uint64_t iv = 0;
|
const uint64_t iv = 0;
|
||||||
ZeroTier::Salsa20 s(key, &iv);
|
ZeroTier::Salsa20 s(key, &iv);
|
||||||
s.XORKeyStream(output, size);
|
s.XORKeyStream(output, size);
|
||||||
|
memset(static_cast<uint8_t*>(output) - 16, 0, 16);
|
||||||
memset(static_cast<uint8_t*>(output) + size, 0, 16);
|
memset(static_cast<uint8_t*>(output) + size, 0, 16);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -116,6 +116,8 @@ static AlgoName const algorithm_names[] = {
|
|||||||
{ "RandomARQ", nullptr, Algorithm::RX_ARQ },
|
{ "RandomARQ", nullptr, Algorithm::RX_ARQ },
|
||||||
{ "randomx/sfx", "rx/sfx", Algorithm::RX_SFX },
|
{ "randomx/sfx", "rx/sfx", Algorithm::RX_SFX },
|
||||||
{ "RandomSFX", nullptr, Algorithm::RX_SFX },
|
{ "RandomSFX", nullptr, Algorithm::RX_SFX },
|
||||||
|
{ "randomx/keva", "rx/keva", Algorithm::RX_KEVA },
|
||||||
|
{ "RandomKEVA", nullptr, Algorithm::RX_KEVA },
|
||||||
# endif
|
# endif
|
||||||
# ifdef XMRIG_ALGO_ARGON2
|
# ifdef XMRIG_ALGO_ARGON2
|
||||||
{ "argon2/chukwa", nullptr, Algorithm::AR2_CHUKWA },
|
{ "argon2/chukwa", nullptr, Algorithm::AR2_CHUKWA },
|
||||||
@ -150,6 +152,7 @@ size_t xmrig::Algorithm::l2() const
|
|||||||
return 0x40000;
|
return 0x40000;
|
||||||
|
|
||||||
case RX_WOW:
|
case RX_WOW:
|
||||||
|
case RX_KEVA:
|
||||||
return 0x20000;
|
return 0x20000;
|
||||||
|
|
||||||
case RX_ARQ:
|
case RX_ARQ:
|
||||||
@ -186,6 +189,7 @@ size_t xmrig::Algorithm::l3() const
|
|||||||
return oneMiB * 2;
|
return oneMiB * 2;
|
||||||
|
|
||||||
case RX_WOW:
|
case RX_WOW:
|
||||||
|
case RX_KEVA:
|
||||||
return oneMiB;
|
return oneMiB;
|
||||||
|
|
||||||
case RX_ARQ:
|
case RX_ARQ:
|
||||||
@ -302,6 +306,7 @@ xmrig::Algorithm::Family xmrig::Algorithm::family(Id id)
|
|||||||
case RX_LOKI:
|
case RX_LOKI:
|
||||||
case RX_ARQ:
|
case RX_ARQ:
|
||||||
case RX_SFX:
|
case RX_SFX:
|
||||||
|
case RX_KEVA:
|
||||||
return RANDOM_X;
|
return RANDOM_X;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
RX_LOKI, // "rx/loki" RandomXL (Loki).
|
RX_LOKI, // "rx/loki" RandomXL (Loki).
|
||||||
RX_ARQ, // "rx/arq" RandomARQ (Arqma).
|
RX_ARQ, // "rx/arq" RandomARQ (Arqma).
|
||||||
RX_SFX, // "rx/sfx" RandomSFX (Safex Cash).
|
RX_SFX, // "rx/sfx" RandomSFX (Safex Cash).
|
||||||
|
RX_KEVA, // "rx/keva" RandomKEVA (Keva).
|
||||||
AR2_CHUKWA, // "argon2/chukwa" Argon2id (Chukwa).
|
AR2_CHUKWA, // "argon2/chukwa" Argon2id (Chukwa).
|
||||||
AR2_WRKZ, // "argon2/wrkz" Argon2id (WRKZ)
|
AR2_WRKZ, // "argon2/wrkz" Argon2id (WRKZ)
|
||||||
ASTROBWT_DERO, // "astrobwt" AstroBWT (Dero)
|
ASTROBWT_DERO, // "astrobwt" AstroBWT (Dero)
|
||||||
|
@ -52,6 +52,7 @@ static CoinName const coin_names[] = {
|
|||||||
{ "arqma", Coin::ARQMA },
|
{ "arqma", Coin::ARQMA },
|
||||||
{ "arq", Coin::ARQMA },
|
{ "arq", Coin::ARQMA },
|
||||||
{ "dero", Coin::DERO },
|
{ "dero", Coin::DERO },
|
||||||
|
{ "keva", Coin::KEVA }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -71,6 +72,9 @@ xmrig::Algorithm::Id xmrig::Coin::algorithm(uint8_t blobVersion) const
|
|||||||
case DERO:
|
case DERO:
|
||||||
return (blobVersion >= 4) ? Algorithm::ASTROBWT_DERO : Algorithm::CN_0;
|
return (blobVersion >= 4) ? Algorithm::ASTROBWT_DERO : Algorithm::CN_0;
|
||||||
|
|
||||||
|
case KEVA:
|
||||||
|
return (blobVersion >= 11) ? Algorithm::RX_KEVA : Algorithm::CN_R;
|
||||||
|
|
||||||
case INVALID:
|
case INVALID:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ public:
|
|||||||
INVALID = -1,
|
INVALID = -1,
|
||||||
MONERO,
|
MONERO,
|
||||||
ARQMA,
|
ARQMA,
|
||||||
DERO
|
DERO,
|
||||||
|
KEVA
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,6 +99,13 @@ RandomX_ConfigurationSafex::RandomX_ConfigurationSafex()
|
|||||||
ArgonSalt = "RandomSFX\x01";
|
ArgonSalt = "RandomSFX\x01";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RandomX_ConfigurationKeva::RandomX_ConfigurationKeva()
|
||||||
|
{
|
||||||
|
ArgonSalt = "RandomKV\x01";
|
||||||
|
ScratchpadL2_Size = 131072;
|
||||||
|
ScratchpadL3_Size = 1048576;
|
||||||
|
}
|
||||||
|
|
||||||
RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
RandomX_ConfigurationBase::RandomX_ConfigurationBase()
|
||||||
: ArgonMemory(262144)
|
: ArgonMemory(262144)
|
||||||
, ArgonIterations(3)
|
, ArgonIterations(3)
|
||||||
@ -300,6 +307,7 @@ RandomX_ConfigurationWownero RandomX_WowneroConfig;
|
|||||||
RandomX_ConfigurationLoki RandomX_LokiConfig;
|
RandomX_ConfigurationLoki RandomX_LokiConfig;
|
||||||
RandomX_ConfigurationArqma RandomX_ArqmaConfig;
|
RandomX_ConfigurationArqma RandomX_ArqmaConfig;
|
||||||
RandomX_ConfigurationSafex RandomX_SafexConfig;
|
RandomX_ConfigurationSafex RandomX_SafexConfig;
|
||||||
|
RandomX_ConfigurationKeva RandomX_KevaConfig;
|
||||||
|
|
||||||
alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig;
|
alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig;
|
||||||
|
|
||||||
|
@ -183,12 +183,14 @@ struct RandomX_ConfigurationWownero : public RandomX_ConfigurationBase { RandomX
|
|||||||
struct RandomX_ConfigurationLoki : public RandomX_ConfigurationBase { RandomX_ConfigurationLoki(); };
|
struct RandomX_ConfigurationLoki : public RandomX_ConfigurationBase { RandomX_ConfigurationLoki(); };
|
||||||
struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); };
|
struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); };
|
||||||
struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); };
|
struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); };
|
||||||
|
struct RandomX_ConfigurationKeva : public RandomX_ConfigurationBase { RandomX_ConfigurationKeva(); };
|
||||||
|
|
||||||
extern RandomX_ConfigurationMonero RandomX_MoneroConfig;
|
extern RandomX_ConfigurationMonero RandomX_MoneroConfig;
|
||||||
extern RandomX_ConfigurationWownero RandomX_WowneroConfig;
|
extern RandomX_ConfigurationWownero RandomX_WowneroConfig;
|
||||||
extern RandomX_ConfigurationLoki RandomX_LokiConfig;
|
extern RandomX_ConfigurationLoki RandomX_LokiConfig;
|
||||||
extern RandomX_ConfigurationArqma RandomX_ArqmaConfig;
|
extern RandomX_ConfigurationArqma RandomX_ArqmaConfig;
|
||||||
extern RandomX_ConfigurationSafex RandomX_SafexConfig;
|
extern RandomX_ConfigurationSafex RandomX_SafexConfig;
|
||||||
|
extern RandomX_ConfigurationKeva RandomX_KevaConfig;
|
||||||
|
|
||||||
extern RandomX_ConfigurationBase RandomX_CurrentConfig;
|
extern RandomX_ConfigurationBase RandomX_CurrentConfig;
|
||||||
|
|
||||||
|
@ -52,6 +52,9 @@ const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm)
|
|||||||
case Algorithm::RX_SFX:
|
case Algorithm::RX_SFX:
|
||||||
return &RandomX_SafexConfig;
|
return &RandomX_SafexConfig;
|
||||||
|
|
||||||
|
case Algorithm::RX_KEVA:
|
||||||
|
return &RandomX_KevaConfig;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user