Cleanup MoneroOcean patchset

This commit is contained in:
Tony Butler 2020-06-08 15:02:38 -06:00 committed by MoneroOcean
parent 42235a56da
commit 30fdc92884
28 changed files with 6138 additions and 6122 deletions

View file

@ -111,13 +111,14 @@ static AlgoName const algorithm_names[] = {
{ "RandomWOW", nullptr, Algorithm::RX_WOW },
{ "randomx/loki", "rx/loki", Algorithm::RX_LOKI },
{ "RandomXL", nullptr, Algorithm::RX_LOKI },
{ "DefyX", "defyx", Algorithm::DEFYX },
{ "randomx/arq", "rx/arq", Algorithm::RX_ARQ },
{ "RandomARQ", nullptr, Algorithm::RX_ARQ },
{ "randomx/sfx", "rx/sfx", Algorithm::RX_SFX },
{ "RandomSFX", nullptr, Algorithm::RX_SFX },
{ "randomx/keva", "rx/keva", Algorithm::RX_KEVA },
{ "RandomKEVA", nullptr, Algorithm::RX_KEVA },
{ "defyx", "defyx", Algorithm::RX_DEFYX },
{ "DefyX", nullptr, Algorithm::RX_DEFYX },
# endif
# ifdef XMRIG_ALGO_ARGON2
{ "argon2/chukwa", nullptr, Algorithm::AR2_CHUKWA },
@ -159,9 +160,7 @@ size_t xmrig::Algorithm::l2() const
case RX_WOW:
case RX_KEVA:
return 0x20000;
case DEFYX:
case RX_DEFYX:
return 0x20000;
case RX_ARQ:
@ -212,10 +211,8 @@ size_t xmrig::Algorithm::l3() const
case RX_KEVA:
return oneMiB;
case DEFYX:
return oneMiB / 4;
case RX_ARQ:
case RX_DEFYX:
return oneMiB / 4;
default:
@ -340,10 +337,10 @@ xmrig::Algorithm::Family xmrig::Algorithm::family(Id id)
case RX_0:
case RX_WOW:
case RX_LOKI:
case DEFYX:
case RX_ARQ:
case RX_SFX:
case RX_KEVA:
case RX_DEFYX:
return RANDOM_X;
# endif

View file

@ -68,10 +68,10 @@ public:
RX_0, // "rx/0" RandomX (reference configuration).
RX_WOW, // "rx/wow" RandomWOW (Wownero).
RX_LOKI, // "rx/loki" RandomXL (Loki).
DEFYX, // "defyx" DefyX (Scala).
RX_ARQ, // "rx/arq" RandomARQ (Arqma).
RX_SFX, // "rx/sfx" RandomSFX (Safex Cash).
RX_KEVA, // "rx/keva" RandomKEVA (Keva).
RX_DEFYX, // "defyx" DefyX (Scala).
AR2_CHUKWA, // "argon2/chukwa" Argon2id (Chukwa).
AR2_WRKZ, // "argon2/wrkz" Argon2id (WRKZ)
ASTROBWT_DERO, // "astrobwt" AstroBWT (Dero)

View file

@ -52,20 +52,32 @@
namespace xmrig {
#ifdef XMRIG_FEATURE_BENCHMARK
const char *BaseConfig::kAlgoPerf = "algo-perf";
#endif
const char *BaseConfig::kApi = "api";
const char *BaseConfig::kApiId = "id";
const char *BaseConfig::kApiWorkerId = "worker-id";
const char *BaseConfig::kAutosave = "autosave";
const char *BaseConfig::kBackground = "background";
#ifdef XMRIG_FEATURE_BENCHMARK
const char *BaseConfig::kBenchAlgoTime = "bench-algo-time";
#endif
const char *BaseConfig::kColors = "colors";
const char *BaseConfig::kDryRun = "dry-run";
const char *BaseConfig::kHttp = "http";
const char *BaseConfig::kLogFile = "log-file";
const char *BaseConfig::kPrintTime = "print-time";
#ifdef XMRIG_FEATURE_BENCHMARK
const char *BaseConfig::kRebenchAlgo = "rebench-algo";
#endif
const char *BaseConfig::kSyslog = "syslog";
const char *BaseConfig::kTitle = "title";
const char *BaseConfig::kUserAgent = "user-agent";
const char *BaseConfig::kVerbose = "verbose";
#ifdef XMRIG_FEATURE_BENCHMARK
const char *BaseConfig::kVersion = "version";
#endif
const char *BaseConfig::kWatch = "watch";
@ -88,6 +100,9 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
m_autoSave = reader.getBool(kAutosave, m_autoSave);
m_background = reader.getBool(kBackground, m_background);
m_dryRun = reader.getBool(kDryRun, m_dryRun);
# ifdef XMRIG_FEATURE_BENCHMARK
m_rebenchAlgo = reader.getBool(kRebenchAlgo, m_rebenchAlgo);
# endif
m_syslog = reader.getBool(kSyslog, m_syslog);
m_watch = reader.getBool(kWatch, m_watch);
m_logFile = reader.getString(kLogFile);
@ -95,14 +110,15 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U);
m_title = reader.getValue(kTitle);
m_rebenchAlgo = reader.getBool("rebench-algo", m_rebenchAlgo);
m_benchAlgoTime = reader.getInt("bench-algo-time", m_benchAlgoTime);
# ifdef XMRIG_FEATURE_TLS
m_tls = reader.getValue(kTls);
# endif
Log::setColors(reader.getBool(kColors, Log::isColors()));
# ifdef XMRIG_FEATURE_BENCHMARK
m_version = reader.getUint(kVersion);
m_benchAlgoTime = reader.getInt(kBenchAlgoTime, m_benchAlgoTime);
# endif
setVerbose(reader.getValue(kVerbose));
const auto &api = reader.getObject(kApi);

View file

@ -46,20 +46,32 @@ class IJsonReader;
class BaseConfig : public IConfig
{
public:
# ifdef XMRIG_FEATURE_BENCHMARK
static const char *kAlgoPerf;
# endif
static const char *kApi;
static const char *kApiId;
static const char *kApiWorkerId;
static const char *kAutosave;
static const char *kBackground;
# ifdef XMRIG_FEATURE_BENCHMARK
static const char *kBenchAlgoTime;
# endif
static const char *kColors;
static const char *kDryRun;
static const char *kHttp;
static const char *kLogFile;
static const char *kPrintTime;
# ifdef XMRIG_FEATURE_BENCHMARK
static const char *kRebenchAlgo;
# endif
static const char *kSyslog;
static const char *kTitle;
static const char *kUserAgent;
static const char *kVerbose;
# ifdef XMRIG_FEATURE_BENCHMARK
static const char *kVersion;
# endif
static const char *kWatch;
# ifdef XMRIG_FEATURE_TLS
@ -81,8 +93,10 @@ public:
inline const Title &title() const { return m_title; }
inline uint32_t printTime() const { return m_printTime; }
# ifdef XMRIG_FEATURE_BENCHMARK
inline bool isRebenchAlgo() const { return m_rebenchAlgo; }
inline int benchAlgoTime() const { return m_benchAlgoTime; }
# endif
# ifdef XMRIG_FEATURE_TLS
inline const TlsConfig &tls() const { return m_tls; }
@ -114,8 +128,11 @@ protected:
Title m_title;
uint32_t m_printTime = 60;
# ifdef XMRIG_FEATURE_BENCHMARK
uint32_t m_version = 0;
bool m_rebenchAlgo = false;
int m_benchAlgoTime = 10;
# endif
# ifdef XMRIG_FEATURE_TLS
TlsConfig m_tls;

View file

@ -235,20 +235,30 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
case IConfig::PrintTimeKey: /* --print-time */
case IConfig::HttpPort: /* --http-port */
case IConfig::DonateLevelKey: /* --donate-level */
# ifdef XMRIG_FEATURE_HTTP
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
case IConfig::BenchAlgoTimeKey: /* --bench-algo-time */
# endif
return transformUint64(doc, key, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::BackgroundKey: /* --background */
case IConfig::SyslogKey: /* --syslog */
case IConfig::KeepAliveKey: /* --keepalive */
case IConfig::NicehashKey: /* --nicehash */
# ifdef XMRIG_FEATURE_TLS
case IConfig::TlsKey: /* --tls */
# endif
case IConfig::DryRunKey: /* --dry-run */
# ifdef XMRIG_FEATURE_HTTP
case IConfig::HttpEnabledKey: /* --http-enabled */
case IConfig::DaemonKey: /* --daemon */
case IConfig::RebenchAlgoKey: /* --rebench-algo */
# endif
case IConfig::VerboseKey: /* --verbose */
# ifdef XMRIG_FEATURE_BENCHMARK
case IConfig::RebenchAlgoKey: /* --rebench-algo */
# endif
return transformBoolean(doc, key, true);
case IConfig::ColorKey: /* --no-color */
@ -343,8 +353,10 @@ void xmrig::BaseTransform::transformUint64(rapidjson::Document &doc, int key, ui
return add(doc, Pools::kPools, Pool::kDaemonPollInterval, arg);
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
case IConfig::BenchAlgoTimeKey: /* --bench-algo-time */
return set(doc, "bench-algo-time", arg);
# endif
default:
break;

View file

@ -82,8 +82,10 @@ public:
NicehashKey = 1006,
PrintTimeKey = 1007,
# ifdef XMRIG_FEATURE_BENCHMARK
RebenchAlgoKey = 10001,
BenchAlgoTimeKey = 10002,
# endif
// xmrig cpu
CPUKey = 1024,