Skip to content

Commit b79a87d

Browse files
committed
Merge branch 'dev'
2 parents d6ce28a + 3dcaffe commit b79a87d

File tree

5 files changed

+58
-8
lines changed

5 files changed

+58
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v6.20.0
2+
- [#538](https://github.com/xmrig/xmrig-proxy/pull/538) Added [Zephyr](https://www.zephyrprotocol.com/) coin support for solo mining.
3+
14
# v6.19.2
25
- [#532](https://github.com/xmrig/xmrig-proxy/pull/532) Added view tag calculation (fixes Wownero solo mining issue).
36
- Sync with latest XMRig.

src/base/crypto/Coin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ static const CoinInfo coinInfo[] = {
5353
{ Algorithm::RX_KEVA, "KVA", "Kevacoin", 0, 0, MAGENTA_BG_BOLD(WHITE_BOLD_S " keva ") },
5454
{ Algorithm::KAWPOW_RVN, "RVN", "Ravencoin", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " raven ") },
5555
{ Algorithm::RX_WOW, "WOW", "Wownero", 300, 100000000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " wownero ") },
56+
{ Algorithm::RX_0, "ZEPH", "Zephyr", 120, 1000000000000, BLUE_BG_BOLD( WHITE_BOLD_S " zephyr ") },
5657
};
5758

5859

src/base/crypto/Coin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class Coin
3939
KEVA,
4040
RAVEN,
4141
WOWNERO,
42+
ZEPHYR,
4243
MAX
4344
};
4445

src/base/tools/cryptonote/BlockTemplate.cpp

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ bool xmrig::BlockTemplate::parse(bool hashes)
197197
ar(m_vote);
198198
}
199199

200+
if (m_coin == Coin::ZEPHYR) {
201+
uint8_t pricing_record[24];
202+
ar(pricing_record);
203+
}
204+
200205
// Miner transaction begin
201206
// Prefix begin
202207
setOffset(MINER_TX_PREFIX_OFFSET, ar.index());
@@ -220,8 +225,8 @@ bool xmrig::BlockTemplate::parse(bool hashes)
220225
ar(m_height);
221226
ar(m_numOutputs);
222227

223-
// must be 1 output
224-
if (m_numOutputs != 1) {
228+
const uint64_t expected_outputs = (m_coin == Coin::ZEPHYR) ? 2 : 1;
229+
if (m_numOutputs != expected_outputs) {
225230
return false;
226231
}
227232

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

238243
ar(m_ephPublicKey, kKeySize);
239244

240-
if (m_outputType == 3) {
245+
if (m_coin == Coin::ZEPHYR) {
246+
if (m_outputType != 2) {
247+
return false;
248+
}
249+
250+
uint64_t asset_type_len;
251+
ar(asset_type_len);
252+
ar.skip(asset_type_len);
253+
ar(m_viewTag);
254+
255+
uint64_t amount2;
256+
ar(amount2);
257+
258+
uint8_t output_type2;
259+
ar(output_type2);
260+
if (output_type2 != 2) {
261+
return false;
262+
}
263+
264+
Span key2;
265+
ar(key2, kKeySize);
266+
267+
ar(asset_type_len);
268+
ar.skip(asset_type_len);
269+
270+
uint8_t view_tag2;
271+
ar(view_tag2);
272+
}
273+
else if (m_outputType == 3) {
241274
ar(m_viewTag);
242275
}
243276

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

284+
bool pubkey_offset_first = true;
285+
251286
while (ar_extra.index() < m_extraSize) {
252287
uint64_t extra_tag = 0;
253288
uint64_t size = 0;
@@ -256,7 +291,10 @@ bool xmrig::BlockTemplate::parse(bool hashes)
256291

257292
switch (extra_tag) {
258293
case 0x01: // TX_EXTRA_TAG_PUBKEY
259-
setOffset(TX_PUBKEY_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
294+
if (pubkey_offset_first) {
295+
pubkey_offset_first = false;
296+
setOffset(TX_PUBKEY_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
297+
}
260298
ar_extra.skip(kKeySize);
261299
break;
262300

@@ -269,14 +307,21 @@ bool xmrig::BlockTemplate::parse(bool hashes)
269307
case 0x03: // TX_EXTRA_MERGE_MINING_TAG
270308
ar_extra(size);
271309
setOffset(TX_EXTRA_MERGE_MINING_TAG_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
272-
ar_extra(m_txMergeMiningTag, size + kKeySize);
310+
ar_extra(m_txMergeMiningTag, size);
273311
break;
274312

275313
default:
276314
return false; // TODO(SChernykh): handle other tags
277315
}
278316
}
279317

318+
if (m_coin == Coin::ZEPHYR) {
319+
uint64_t pricing_record_height, amount_burnt, amount_minted;
320+
ar(pricing_record_height);
321+
ar(amount_burnt);
322+
ar(amount_minted);
323+
}
324+
280325
setOffset(MINER_TX_PREFIX_END_OFFSET, ar.index());
281326
// Prefix end
282327

src/version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
#define APP_ID "xmrig-proxy"
2323
#define APP_NAME "xmrig-proxy"
2424
#define APP_DESC "XMRig Stratum proxy"
25-
#define APP_VERSION "6.19.2"
25+
#define APP_VERSION "6.20.0-dev"
2626
#define APP_DOMAIN "xmrig.com"
2727
#define APP_SITE "www.xmrig.com"
2828
#define APP_COPYRIGHT "Copyright (C) 2016-2023 xmrig.com"
2929
#define APP_KIND "proxy"
3030

3131
#define APP_VER_MAJOR 6
32-
#define APP_VER_MINOR 19
33-
#define APP_VER_PATCH 2
32+
#define APP_VER_MINOR 20
33+
#define APP_VER_PATCH 0
3434

3535
#ifdef _MSC_VER
3636
# if (_MSC_VER >= 1930)

0 commit comments

Comments
 (0)