Merge pull request #2411 from pdxwebdev/feature/yadacoin

Added support for Yada (rx/yada algorithm)
This commit is contained in:
xmrig 2024-08-02 16:22:50 +07:00 committed by GitHub
commit 92ffcd34d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 44 additions and 9 deletions

View file

@ -126,6 +126,11 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
count += threads.move(Algorithm::kRX_WOW, std::move(wow));
}
if (!threads.isExist(Algorithm::RX_YADA)) {
auto yada = cpuInfo->threads(Algorithm::RX_YADA, limit);
count += threads.move(Algorithm::kRX_YADA, std::move(yada));
}
count += generate(Algorithm::kRX, threads, Algorithm::RX_0, limit);
return count;

View file

@ -81,6 +81,7 @@ const char *Algorithm::kRX_WOW = "rx/wow";
const char *Algorithm::kRX_ARQ = "rx/arq";
const char *Algorithm::kRX_GRAFT = "rx/graft";
const char *Algorithm::kRX_SFX = "rx/sfx";
const char *Algorithm::kRX_YADA = "rx/yada";
#endif
#ifdef XMRIG_ALGO_ARGON2
@ -146,6 +147,7 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
ALGO_NAME(RX_ARQ),
ALGO_NAME(RX_GRAFT),
ALGO_NAME(RX_SFX),
ALGO_NAME(RX_YADA),
# endif
# ifdef XMRIG_ALGO_ARGON2
@ -259,6 +261,8 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
ALGO_ALIAS(RX_GRAFT, "randomgraft"),
ALGO_ALIAS_AUTO(RX_SFX), ALGO_ALIAS(RX_SFX, "randomx/sfx"),
ALGO_ALIAS(RX_SFX, "randomsfx"),
ALGO_ALIAS_AUTO(RX_YADA), ALGO_ALIAS(RX_YADA, "randomx/yada"),
ALGO_ALIAS(RX_YADA, "randomyada"),
# endif
# ifdef XMRIG_ALGO_ARGON2
@ -346,7 +350,7 @@ std::vector<xmrig::Algorithm> xmrig::Algorithm::all(const std::function<bool(con
CN_HEAVY_0, CN_HEAVY_TUBE, CN_HEAVY_XHV,
CN_PICO_0, CN_PICO_TLO,
CN_UPX2,
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX,
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_YADA,
AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ,
KAWPOW_RVN,
GHOSTRIDER_RTM

View file

@ -77,6 +77,7 @@ public:
RX_ARQ = 0x72121061, // "rx/arq" RandomARQ (Arqma).
RX_GRAFT = 0x72151267, // "rx/graft" RandomGRAFT (Graft).
RX_SFX = 0x72151273, // "rx/sfx" RandomSFX (Safex Cash).
RX_YADA = 0x72151279, // "rx/yada" RandomYada (YadaCoin).
AR2_CHUKWA = 0x61130000, // "argon2/chukwa" Argon2id (Chukwa).
AR2_CHUKWA_V2 = 0x61140000, // "argon2/chukwav2" Argon2id (Chukwa v2).
AR2_WRKZ = 0x61120000, // "argon2/wrkz" Argon2id (WRKZ)
@ -142,6 +143,7 @@ public:
static const char *kRX_ARQ;
static const char *kRX_GRAFT;
static const char *kRX_SFX;
static const char *kRX_YADA;
# endif
# ifdef XMRIG_ALGO_ARGON2

View file

@ -54,6 +54,7 @@ static const CoinInfo coinInfo[] = {
{ Algorithm::RX_WOW, "WOW", "Wownero", 300, 100000000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " wownero ") },
{ Algorithm::RX_0, "ZEPH", "Zephyr", 120, 1000000000000, BLUE_BG_BOLD( WHITE_BOLD_S " zephyr ") },
{ Algorithm::RX_0, "Townforge","Townforge", 30, 100000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " townforge ") },
{ Algorithm::RX_YADA, "YDA", "YadaCoin", 120, 100000000, BLUE_BG_BOLD( WHITE_BOLD_S " yada ") },
};

View file

@ -40,6 +40,7 @@ public:
WOWNERO,
ZEPHYR,
TOWNFORGE,
YADA,
MAX
};

View file

@ -118,7 +118,10 @@ bool xmrig::Job::setTarget(const char *target)
const auto raw = Cvt::fromHex(target, strlen(target));
const size_t size = raw.size();
if (algorithm() == Algorithm::RX_YADA) {
m_target = strtoull(target, nullptr, 16);
}
else {
if (size == 4) {
m_target = 0xFFFFFFFFFFFFFFFFULL / (0xFFFFFFFFULL / uint64_t(*reinterpret_cast<const uint32_t *>(raw.data())));
}
@ -128,6 +131,7 @@ bool xmrig::Job::setTarget(const char *target)
else {
return false;
}
}
# ifdef XMRIG_PROXY_PROJECT
assert(sizeof(m_rawTarget) > (size * 2));
@ -176,6 +180,10 @@ int32_t xmrig::Job::nonceOffset() const
auto f = algorithm().family();
if (f == Algorithm::KAWPOW) return 32;
if (f == Algorithm::GHOSTRIDER) return 76;
auto id = algorithm().id();
if (id == Algorithm::RX_YADA) return 147;
return 39;
}

View file

@ -100,10 +100,18 @@ RandomX_ConfigurationSafex::RandomX_ConfigurationSafex()
ArgonSalt = "RandomSFX\x01";
}
RandomX_ConfigurationYada::RandomX_ConfigurationYada()
{
ArgonSalt = "RandomXYadaCoin\x03";
SuperscalarLatency = 150;
ArgonIterations = 4;
}
RandomX_ConfigurationBase::RandomX_ConfigurationBase()
: ArgonIterations(3)
, ArgonLanes(1)
, ArgonSalt("RandomX\x03")
, SuperscalarLatency(170)
, ScratchpadL1_Size(16384)
, ScratchpadL2_Size(262144)
, ScratchpadL3_Size(2097152)
@ -350,6 +358,7 @@ RandomX_ConfigurationWownero RandomX_WowneroConfig;
RandomX_ConfigurationArqma RandomX_ArqmaConfig;
RandomX_ConfigurationGraft RandomX_GraftConfig;
RandomX_ConfigurationSafex RandomX_SafexConfig;
RandomX_ConfigurationYada RandomX_YadaConfig;
alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig;

View file

@ -69,7 +69,6 @@ struct RandomX_ConfigurationBase
{
ArgonMemory = 262144,
CacheAccesses = 8,
SuperscalarLatency = 170,
DatasetBaseSize = 2147483648,
DatasetExtraSize = 33554368,
JumpBits = 8,
@ -82,6 +81,7 @@ struct RandomX_ConfigurationBase
uint32_t ArgonIterations;
uint32_t ArgonLanes;
const char* ArgonSalt;
uint32_t SuperscalarLatency;
uint32_t ScratchpadL1_Size;
uint32_t ScratchpadL2_Size;
@ -146,12 +146,14 @@ struct RandomX_ConfigurationWownero : public RandomX_ConfigurationBase { RandomX
struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); };
struct RandomX_ConfigurationGraft : public RandomX_ConfigurationBase { RandomX_ConfigurationGraft(); };
struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); };
struct RandomX_ConfigurationYada : public RandomX_ConfigurationBase { RandomX_ConfigurationYada(); };
extern RandomX_ConfigurationMonero RandomX_MoneroConfig;
extern RandomX_ConfigurationWownero RandomX_WowneroConfig;
extern RandomX_ConfigurationArqma RandomX_ArqmaConfig;
extern RandomX_ConfigurationGraft RandomX_GraftConfig;
extern RandomX_ConfigurationSafex RandomX_SafexConfig;
extern RandomX_ConfigurationYada RandomX_YadaConfig;
extern RandomX_ConfigurationBase RandomX_CurrentConfig;

View file

@ -44,6 +44,9 @@ const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm)
case Algorithm::RX_SFX:
return &RandomX_SafexConfig;
case Algorithm::RX_YADA:
return &RandomX_YadaConfig;
default:
break;
}