Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of CryptoNight v8 ReverseWaltz #2261

Closed
wants to merge 5 commits into from

Conversation

EDDragonWolf
Copy link
Contributor

Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation

We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).

@psychocrypt psychocrypt added the currency Add/Modify a Currency label Feb 26, 2019
@@ -118,7 +119,8 @@ xmrstak::coin_selection coins[] = {
{ "stellite", {POW(cryptonight_v8_half)}, {POW(cryptonight_monero_v8)}, nullptr },
{ "turtlecoin", {POW(cryptonight_turtle), 6u,POW(cryptonight_aeon)}, {POW(cryptonight_aeon)}, nullptr },
{ "plenteum", {POW(cryptonight_turtle)}, {POW(cryptonight_turtle)}, nullptr },
{ "zelerius", {POW(cryptonight_v8_zelerius), 7, POW(cryptonight_monero_v8)}, {POW(cryptonight_monero_v8)}, nullptr }
{ "zelerius", {POW(cryptonight_v8_zelerius), 7, POW(cryptonight_monero_v8)}, {POW(cryptonight_monero_v8)}, nullptr },
{ "reverse_waltz", {POW(cryptonight_v8_reversewaltz)}, {POW(cryptonight_monero_v8)}, "mining.grftpool.com:3333" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rename reverse_waltz to cryptonight_v8_reversewaltz and put it into alphabetic order. cryptonight_v8_reversewaltz is the name yo asl oput in to README.txt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove the inactive pool.

Copy link
Contributor Author

@EDDragonWolf EDDragonWolf Feb 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • cryptonight_v8_reversewaltz is already present, moved it into alphabetic order.
  • removed reverse_waltz. I added it as another alias, however, if I correctly understood, you add as additional aliases only coin names, so I removed it.
  • moved cryptonight_v8_reversewaltz in README.txt and pools.tpl into alphabetic order. Sorry, I didn't notice it before.
    Thanks.

{ "freehaven", {POW(cryptonight_superfast)}, {POW(cryptonight_monero_v8)}, nullptr },
{ "graft", {POW(cryptonight_monero_v8)}, {POW(cryptonight_monero_v8)}, nullptr },
{ "graft", {POW(cryptonight_v8_reversewaltz)}, {POW(cryptonight_monero_v8)}, "mining.grftpool.com:3333" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to {POW(cryptonight_v8_reversewaltz), <forkblockversion>, POW(cryptonight_monero_v8)}, {POW(cryptonight_monero_v8)} to allow to fork on a given block height. must be replaced with the block version where the coin is forking.

Please remove the pool sugestion or add an active pool. If you add an active pool please use not th elargest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • modified "graft" record as you asked;
  • added fork block version - 12;
  • removed pool suggestion. It is active since we maintain it, but it isn't the most popular Graft mining pool and, unfortunately, it has a zero hash rate.
    Thanks.

@@ -794,6 +795,17 @@ __kernel void JOIN(cn1,ALGO) (__global uint4 *Scratchpad, __global ulong *states
}
#endif

#if(ALGO == cryptonight_v8_reversewaltz)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One slight cleanup here:

#endif

#if(ALGO ==

would be better written as:

#elif(ALGO ==

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks.
Done.

Copy link
Contributor

@jagerman jagerman Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think this code could be made simpler still if you did some #define trickery on the declaration, like this:

// (earlier)
#if(ALGO == cryptonight_monero_v8)
#  define CNV8_CHUNK1_INTO chunk1
#  define CNV8_CHUNK3_INTO chunk3
#elif(ALGO == cryptonight_v8_reversewaltz)
#  define CNV8_CHUNK1_INTO chunk3
#  define CNV8_CHUNK3_INTO chunk1
#endif

Then you can ditch the second code block entirely and change the first to:

#if(ALGO == cryptonight_monero_v8 || ALGO == cryptonight_v8_reversewaltz)
		{
			ulong2 CNV8_CHUNK1_INTO = as_ulong2(SCRATCHPAD_CHUNK(1));
			ulong2 chunk2 = as_ulong2(SCRATCHPAD_CHUNK(2));
			ulong2 CNV8_CHUNK3_INTO = as_ulong2(SCRATCHPAD_CHUNK(3));
			SCRATCHPAD_CHUNK(1) = as_uint4(chunk3 + ((ulong2 *)(b_x + 1))[0]);
			SCRATCHPAD_CHUNK(2) = as_uint4(chunk1 + ((ulong2 *)b_x)[0]);
			SCRATCHPAD_CHUNK(3) = as_uint4(chunk2 + ((ulong2 *)a)[0]);
		}
#endif

and then... (continued in next comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it can complicate reading of the code. Also, I wanted to minimize my changes, so I tried to leave original implementation as close to original as I could. However, if @psychocrypt and @fireice-uk agree with your proposal, I'll replace it using defines.

@@ -370,6 +370,22 @@ __global__ void cryptonight_core_gpu_phase2_double(
myChunks[ idx1 ^ 6 + sub ] = chunk2 + ax0;
}

if(ALGO == cryptonight_v8_reversewaltz)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks.
Done.

@psychocrypt
Copy link
Collaborator

Please provide the test pool address and a wallet address I can use for testing

@EDDragonWolf
Copy link
Contributor Author

EDDragonWolf commented Mar 5, 2019

@psychocrypt
Sorry for the delay, we had a big delay with HF on testnet, it forked only now
testnet mining pool - http://3.83.140.241/
if you need some testnet wallet addresses:
FAaegMUw5YV9GcwNGwJsyLdc1jkVRnNWcX3zEd5e1Nmci8HmGQGt3J3NUjeWi19WQi9t52mAwxHCXUSkcufmmU7CMVpjACG
FB4ZejF4V3w8qhRgxQVENyKc8aCmgP4whaUQhZuw7zwnb5rdgEKFq1G5gbGnhUCBXKPHF3bYLDqZD5e7JG7i2Wf3LwNmXDu
F8WjfGHDBqkhtSy674bz1tjaBooPnFEgvF92ooYbrCCNCagzbT8SxogS2PiW3LKuEMhGrE6V2YJP3CgLeENd53JZLExetb6

@jagerman
Copy link
Contributor

jagerman commented Mar 5, 2019

https://testnet.graft.community is also up and running.

@@ -30,6 +30,7 @@ R"===(
#define cryptonight_superfast 12
#define cryptonight_gpu 13
#define cryptonight_conceal 14
#define cryptonight_v8_reversewaltz 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be 17, not 15, to agree with the value in xmrstak/backend/cryptonight.hpp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Fixed. Thanks, @jagerman.

chunk3 = chunk1;
chunk1 = chunk_tmp;
}
#endif
SCRATCHPAD_CHUNK(1) = as_uint4(chunk3 + ((ulong2 *)(b_x + 1))[0]);
SCRATCHPAD_CHUNK(2) = as_uint4(chunk1 + ((ulong2 *)b_x)[0]);
Copy link
Contributor

@jagerman jagerman Mar 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The swap above this is not nice: better to remove it and #ifdef the assignment as:

#if(ALGO == cryptonight_v8_reversewaltz)
			SCRATCHPAD_CHUNK(1) = as_uint4(chunk1 + ((ulong2 *)(b_x + 1))[0]);
			SCRATCHPAD_CHUNK(2) = as_uint4(chunk3 + ((ulong2 *)b_x)[0]);
#else
			SCRATCHPAD_CHUNK(1) = as_uint4(chunk3 + ((ulong2 *)(b_x + 1))[0]);
			SCRATCHPAD_CHUNK(2) = as_uint4(chunk1 + ((ulong2 *)b_x)[0]);
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with you. Fixed. Thanks.

psychocrypt added a commit to psychocrypt/xmr-stak that referenced this pull request Mar 7, 2019
rebased version of fireice-uk#2261

Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation

We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
@psychocrypt
Copy link
Collaborator

thx for the pull request I rebased it in #2282

@psychocrypt psychocrypt closed this Mar 7, 2019
psychocrypt pushed a commit to psychocrypt/xmr-stak that referenced this pull request Mar 7, 2019
rebased version of fireice-uk#2261

Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation

We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
gnagel pushed a commit to gnagel/xmr-stak that referenced this pull request Mar 23, 2019
rebased version of fireice-uk#2261

Added support of CryptoNight v8 Reverse Waltz (named cryptonight_v8_reversewaltz here) - equal to CryptoNight v8 but with 3/4 iterations of CryptoNight v8 and with reversed shuffle operation

We plan to use CryptoNight v8 Reverse Waltz as new PoW algorithm for Graft (graft-project/GraftNetwork#234).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
currency Add/Modify a Currency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants