Skip to content

Commit

Permalink
# 3.4.1
Browse files Browse the repository at this point in the history
* Added Tuske RandomX variant (`rx/tuske`)
* Rebase on latest xmrig-6.21.3
* Removed Lozzax RandomX variant (`rx/lozz`) [DEAD]
  • Loading branch information
Bendr0id authored May 23, 2024
1 parent cfa8796 commit 72ac25f
Show file tree
Hide file tree
Showing 17 changed files with 545 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ test/
*CMakeFiles*
*.a
*.cbp
.cmake/api/v1/reply
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 3.4.1
* Added Tuske RandomX variant (`rx/tuske`)
* Rebase on latest xmrig-6.21.3
* Removed Lozzax RandomX variant (`rx/lozz`) [DEAD]
# 3.4.0
* Dashboard changes
Expand Down
1 change: 1 addition & 0 deletions cmake/randomx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if (WITH_RANDOMX)
src/crypto/randomx/allocator.cpp
src/crypto/randomx/blake2_generator.cpp
src/crypto/randomx/blake2/blake2b.c
src/crypto/randomx/sha256/sha256.c
src/crypto/randomx/bytecode_machine.cpp
src/crypto/randomx/dataset.cpp
src/crypto/randomx/instructions_portable.cpp
Expand Down
1 change: 1 addition & 0 deletions doc/ALGORITHMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Option `coin` useful for pools without algorithm negotiation support or daemon t

| Name | Memory | Version | Notes | Info |
|-----------------------|--------|-------------|---------------------------------------------------------------------------|-----------|
| `rx/tuske` | 2 MB | 3.4.1 | RandomxTuske (vkax). | CPU only
| `ghostrider/mike` | 2 MB | 3.3.1 | Ghostrider variant Mike (vkax). | CPU only
| `rx/xdag` | 2 MB | 3.2.1 | RandomXDAG (xdagger). | CPU only
| `astroBWT/v2` | - | 3.2.0 | AstroBWT v2 (Dero HE). | removed
Expand Down
4 changes: 0 additions & 4 deletions src/backend/cpu/CpuConfig_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ 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)) {
count += generate(Algorithm::kRX_YADA, threads, Algorithm::RX_YADA, limit);
}

count += generate(Algorithm::kRX, threads, Algorithm::RX_0, limit);

return count;
Expand Down
7 changes: 5 additions & 2 deletions src/backend/cpu/CpuWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@

#ifdef XMRIG_ALGO_RANDOMX
# include "crypto/randomx/randomx.h"
# include "crypto/randomx/sha256/sha256.h"
#endif




namespace xmrig {

static constexpr uint32_t kReserveCount = 32768;
Expand Down Expand Up @@ -306,6 +305,10 @@ void xmrig::CpuWorker<N>::start()
job.generateMinerSignature(m_job.blob(), job.size(), miner_signature_ptr);
}
randomx_calculate_hash_next(m_vm, tempHash, m_job.blob(), job.size(), m_hash);

if (job.algorithm() == Algorithm::RX_TUSKE) {
SHA256d_Buf(m_hash, RANDOMX_HASH_SIZE, m_hash);
}
}
else
# endif
Expand Down
6 changes: 5 additions & 1 deletion src/base/crypto/Algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const char *Algorithm::kRX_SFX = "rx/sfx";
const char *Algorithm::kRX_KEVA = "rx/keva";
const char *Algorithm::kRX_YADA = "rx/yada";
const char *Algorithm::kRX_XDAG = "rx/xdag";
const char *Algorithm::kRX_TUSKE = "rx/tuske";
#endif

#ifdef XMRIG_ALGO_ARGON2
Expand Down Expand Up @@ -161,6 +162,7 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
ALGO_NAME(RX_KEVA),
ALGO_NAME(RX_YADA),
ALGO_NAME(RX_XDAG),
ALGO_NAME(RX_TUSKE),
# endif

# ifdef XMRIG_ALGO_ARGON2
Expand Down Expand Up @@ -288,6 +290,8 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
ALGO_ALIAS(RX_YADA, "randomyada"),
ALGO_ALIAS_AUTO(RX_XDAG), ALGO_ALIAS(RX_XDAG, "randomx/xdag"),
ALGO_ALIAS(RX_XDAG, "randomxdag"),
ALGO_ALIAS_AUTO(RX_TUSKE), ALGO_ALIAS(RX_TUSKE, "randomx/tuske"),
ALGO_ALIAS(RX_TUSKE, "randomtuske"),
# endif

# ifdef XMRIG_ALGO_ARGON2
Expand Down Expand Up @@ -379,7 +383,7 @@ std::vector<xmrig::Algorithm> xmrig::Algorithm::all(const std::function<bool(con
CN_PICO_0, CN_PICO_TLO,
CN_UPX2,
CN_GPU,
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA, RX_YADA, RX_XDAG,
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA, RX_YADA, RX_XDAG, RX_TUSKE,
AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ,
KAWPOW_RVN,
GHOSTRIDER_RTM, GHOSTRIDER_MIKE
Expand Down
2 changes: 2 additions & 0 deletions src/base/crypto/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Algorithm
RX_KEVA = 0x7214116b, // "rx/keva" RandomKEVA (Keva).
RX_YADA = 0x72151279, // "rx/yada" RandomYADA (Yada).
RX_XDAG = 0x72151278, // "rx/xdag" RandomXDAG (xdagger).
RX_TUSKE = 0x72151274, // "rx/tuske" RandomTuske (TUSKE).
AR2_CHUKWA = 0x61130000, // "argon2/chukwa" Argon2id (Chukwa).
AR2_CHUKWA_V2 = 0x61140000, // "argon2/chukwav2" Argon2id (Chukwa v2).
AR2_WRKZ = 0x61120000, // "argon2/wrkz" Argon2id (WRKZ)
Expand Down Expand Up @@ -154,6 +155,7 @@ class Algorithm
static const char *kRX_KEVA;
static const char *kRX_YADA;
static const char *kRX_XDAG;
static const char *kRX_TUSKE;
# endif

# ifdef XMRIG_ALGO_ARGON2
Expand Down
7 changes: 4 additions & 3 deletions src/base/crypto/Coin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ static const CoinInfo coinInfo[] = {
{ Algorithm::RX_KEVA, "KVA", "Kevacoin", 0, 0, MAGENTA_BG_BOLD(WHITE_BOLD_S " keva ") },
{ Algorithm::KAWPOW_RVN, "RVN", "Ravencoin", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " raven ") },
{ Algorithm::RX_WOW, "WOW", "Wownero", 300, 100000000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " wownero ") },
{ Algorithm::RX_YADA, "YADA", "YadaCoin", 120, 10000000000, BLUE_BG_BOLD( WHITE_BOLD_S " yada ") },
{ Algorithm::RX_XDAG, "XDAG", "Xdagger", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " xdagger ") },
{ Algorithm::RX_0, "ZEPH", "Zephyr", 120, 1000000000000, BLUE_BG_BOLD( WHITE_BOLD_S " zephyr ") },
{ Algorithm::RX_YADA, "YADA", "YadaCoin", 120, 10000000000, BLUE_BG_BOLD( WHITE_BOLD_S " yada ") },
{ Algorithm::RX_XDAG, "XDAG", "Xdagger", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " xdagger ") },
{ 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_TUSKE, "TSK", "Tuske", 120, 1000000000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " tuske ") },
};


Expand Down
1 change: 1 addition & 0 deletions src/base/crypto/Coin.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Coin
XDAG,
ZEPHYR,
TOWNFORGE,
TUSKE,
MAX
};

Expand Down
8 changes: 8 additions & 0 deletions src/crypto/randomx/randomx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ RandomX_ConfigurationYada::RandomX_ConfigurationYada()
ArgonIterations = 4;
}

RandomX_ConfigurationTuske::RandomX_ConfigurationTuske()
{
ArgonSalt = "TuskeRandomX\x03";
ArgonIterations = 4;
ArgonLanes = 2;
}

RandomX_ConfigurationBase::RandomX_ConfigurationBase()
: SuperscalarLatency(170)
, ArgonIterations(3)
Expand Down Expand Up @@ -367,6 +374,7 @@ RandomX_ConfigurationGraft RandomX_GraftConfig;
RandomX_ConfigurationSafex RandomX_SafexConfig;
RandomX_ConfigurationKeva RandomX_KevaConfig;
RandomX_ConfigurationYada RandomX_YadaConfig;
RandomX_ConfigurationTuske RandomX_TuskeConfig;

alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig;

Expand Down
2 changes: 2 additions & 0 deletions src/crypto/randomx/randomx.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ struct RandomX_ConfigurationGraft : public RandomX_ConfigurationBase { RandomX_C
struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); };
struct RandomX_ConfigurationKeva : public RandomX_ConfigurationBase { RandomX_ConfigurationKeva(); };
struct RandomX_ConfigurationYada : public RandomX_ConfigurationBase { RandomX_ConfigurationYada(); };
struct RandomX_ConfigurationTuske : public RandomX_ConfigurationBase { RandomX_ConfigurationTuske(); };

extern RandomX_ConfigurationMonero RandomX_MoneroConfig;
extern RandomX_ConfigurationWownero RandomX_WowneroConfig;
Expand All @@ -156,6 +157,7 @@ extern RandomX_ConfigurationGraft RandomX_GraftConfig;
extern RandomX_ConfigurationSafex RandomX_SafexConfig;
extern RandomX_ConfigurationKeva RandomX_KevaConfig;
extern RandomX_ConfigurationYada RandomX_YadaConfig;
extern RandomX_ConfigurationTuske RandomX_TuskeConfig;

extern RandomX_ConfigurationBase RandomX_CurrentConfig;

Expand Down
Loading

0 comments on commit 72ac25f

Please sign in to comment.