Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
xmrig committed Jul 3, 2023
2 parents d6ce28a + 3dcaffe commit b79a87d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v6.20.0
- [#538](https://github.com/xmrig/xmrig-proxy/pull/538) Added [Zephyr](https://www.zephyrprotocol.com/) coin support for solo mining.

# v6.19.2
- [#532](https://github.com/xmrig/xmrig-proxy/pull/532) Added view tag calculation (fixes Wownero solo mining issue).
- Sync with latest XMRig.
Expand Down
1 change: 1 addition & 0 deletions src/base/crypto/Coin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ 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_0, "ZEPH", "Zephyr", 120, 1000000000000, BLUE_BG_BOLD( WHITE_BOLD_S " zephyr ") },
};


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 @@ -39,6 +39,7 @@ class Coin
KEVA,
RAVEN,
WOWNERO,
ZEPHYR,
MAX
};

Expand Down
55 changes: 50 additions & 5 deletions src/base/tools/cryptonote/BlockTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ bool xmrig::BlockTemplate::parse(bool hashes)
ar(m_vote);
}

if (m_coin == Coin::ZEPHYR) {
uint8_t pricing_record[24];
ar(pricing_record);
}

// Miner transaction begin
// Prefix begin
setOffset(MINER_TX_PREFIX_OFFSET, ar.index());
Expand All @@ -220,8 +225,8 @@ bool xmrig::BlockTemplate::parse(bool hashes)
ar(m_height);
ar(m_numOutputs);

// must be 1 output
if (m_numOutputs != 1) {
const uint64_t expected_outputs = (m_coin == Coin::ZEPHYR) ? 2 : 1;
if (m_numOutputs != expected_outputs) {
return false;
}

Expand All @@ -237,7 +242,35 @@ bool xmrig::BlockTemplate::parse(bool hashes)

ar(m_ephPublicKey, kKeySize);

if (m_outputType == 3) {
if (m_coin == Coin::ZEPHYR) {
if (m_outputType != 2) {
return false;
}

uint64_t asset_type_len;
ar(asset_type_len);
ar.skip(asset_type_len);
ar(m_viewTag);

uint64_t amount2;
ar(amount2);

uint8_t output_type2;
ar(output_type2);
if (output_type2 != 2) {
return false;
}

Span key2;
ar(key2, kKeySize);

ar(asset_type_len);
ar.skip(asset_type_len);

uint8_t view_tag2;
ar(view_tag2);
}
else if (m_outputType == 3) {
ar(m_viewTag);
}

Expand All @@ -248,6 +281,8 @@ bool xmrig::BlockTemplate::parse(bool hashes)
BlobReader<true> ar_extra(blob(TX_EXTRA_OFFSET), m_extraSize);
ar.skip(m_extraSize);

bool pubkey_offset_first = true;

while (ar_extra.index() < m_extraSize) {
uint64_t extra_tag = 0;
uint64_t size = 0;
Expand All @@ -256,7 +291,10 @@ bool xmrig::BlockTemplate::parse(bool hashes)

switch (extra_tag) {
case 0x01: // TX_EXTRA_TAG_PUBKEY
setOffset(TX_PUBKEY_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
if (pubkey_offset_first) {
pubkey_offset_first = false;
setOffset(TX_PUBKEY_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
}
ar_extra.skip(kKeySize);
break;

Expand All @@ -269,14 +307,21 @@ bool xmrig::BlockTemplate::parse(bool hashes)
case 0x03: // TX_EXTRA_MERGE_MINING_TAG
ar_extra(size);
setOffset(TX_EXTRA_MERGE_MINING_TAG_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
ar_extra(m_txMergeMiningTag, size + kKeySize);
ar_extra(m_txMergeMiningTag, size);
break;

default:
return false; // TODO(SChernykh): handle other tags
}
}

if (m_coin == Coin::ZEPHYR) {
uint64_t pricing_record_height, amount_burnt, amount_minted;
ar(pricing_record_height);
ar(amount_burnt);
ar(amount_minted);
}

setOffset(MINER_TX_PREFIX_END_OFFSET, ar.index());
// Prefix end

Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
#define APP_ID "xmrig-proxy"
#define APP_NAME "xmrig-proxy"
#define APP_DESC "XMRig Stratum proxy"
#define APP_VERSION "6.19.2"
#define APP_VERSION "6.20.0-dev"
#define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2023 xmrig.com"
#define APP_KIND "proxy"

#define APP_VER_MAJOR 6
#define APP_VER_MINOR 19
#define APP_VER_PATCH 2
#define APP_VER_MINOR 20
#define APP_VER_PATCH 0

#ifdef _MSC_VER
# if (_MSC_VER >= 1930)
Expand Down

0 comments on commit b79a87d

Please sign in to comment.