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

Testing CryptonightV7 #82

Open
2acoin opened this issue May 19, 2018 · 19 comments
Open

Testing CryptonightV7 #82

2acoin opened this issue May 19, 2018 · 19 comments

Comments

@2acoin
Copy link
Contributor

2acoin commented May 19, 2018

@pmitchev I'd like to start testing the V7 mods you put in place.

I have created a "TestCoin" with the latest generator. What config changes do I need to make to enable V7?

The code check looks backwards to me in the cryptonight-v7.json file;

              "  if (m_POWCryptoNightV7BlockIndex >= block.getBlockIndex() && m_POWCryptoNightV7LastBlock <= block.getBlockIndex())",
              "    cn_variant = 1;",

I would expect the equality checks to be reversed.

Any advice on how to enable V7?

@kennetanti
Copy link

Those equality checks look correct. The two variables that start with m_ are the first block for v7 and the last block for v7. And it basically says cn_variant is 1 if firstV7Block <= currentBlock <= lastV7Block. Im looking into this as well as we speak (although im just kind of a guy and not the Official Mr ForkNote )

@2acoin
Copy link
Contributor Author

2acoin commented May 20, 2018

So, I started a new coin and I set these two variables;

POW_CRYPTONIGHT_V7_BLOCK_INDEX=1
POW_CRYPTONIGHT_V7_LAST_BLOCK=9999

I set these defaults in the CryptoNoteConfig.h file and I am also passing these in the conf.json file for the coin. However, the V7 option does not activate. Combing through the code I can't see where it ever reaches the test for the blockindex to activate V7.

I am a little confused in the above qualifications because I would read it as;

if (m_POWCryptoNightV7BlockIndex (**1**) >= block.getBlockIndex() (current block) && m_POWCryptoNightV7LastBlock (**9999**) <= block.getBlockIndex() (currentblock))",
              "    cn_variant = 1;",

I replaced my values in the code above and the qualifier test for the Variant=1 look backwards to me (see 1 & 9999 in the code)... Am I not reading the code right?

@2acoin
Copy link
Contributor Author

2acoin commented May 20, 2018

Continuing on with my thread....

If the following are used in the coin;

POW_CRYPTONIGHT_V7_BLOCK_INDEX=1
POW_CRYPTONIGHT_V7_LAST_BLOCK=9999

The code;

if (m_POWCryptoNightV7BlockIndex >= block.getBlockIndex() && m_POWCryptoNightV7LastBlock <= block.getBlockIndex())",
              "    cn_variant = 1;",

Would equate to;

if (1 >= block.getBlockIndex() && 9999 <= block.getBlockIndex())",
              "    cn_variant = 1;",

I would think the equality checks need to be reversed to read;

if (1 <= block.getBlockIndex() && 9999 >= block.getBlockIndex())",
              "    cn_variant = 1;",

Would anyone agree with me...?

BTW - I made this change in the code and the V7 algo still does not engage...

@kennetanti
Copy link

Actually you are correct :/ i was very tired when responding the first time... You could just switch the numbers in your config around. Although might i suggest using 4294967294 instead of 9999? If you use 9999 with 2 minute block times you would switch back to v0 at block 10000, or roughly 2 weeks after mining begins. If CryptoNoteConfig.h includes <stdint.h> you could just use UINT32_MAX to make it pretty. Something i found odd when looking into it more, the variables UPGRADE_HEIGHT_V* dont seem to actually do anything. They are just defined and then never referenced anywhere.

Also, i can make a pull request that switches the signs so that the code is more self-documenting because those var names are confusing lol

@kennetanti
Copy link

Oh, also you might want to make it start at block 0 if you want the genesis block to also have a v7 hash. Although it is not required and will probably not impact you in any way and is just being OCD but if someone discovers your blockchain on an abandoned hard drive 100000 years from now, what would they think

@pmitchev
Copy link
Contributor

pmitchev commented May 21, 2018

Every *_LAST_BLOCK should have uint32_t(-1) or whatever the max is as default. It will be fixed in the next commit on the parameters where this is not true

Also, *_LAST_BLOCK should be used only when you need to hardfork out of a feature

@2acoin
Copy link
Contributor Author

2acoin commented May 21, 2018

For my testing I am just trying to invoke V7... However, even with the change in the logic and setting parameters as expected I can't get the V7 (variant=1) to kick in...

Anyone know what I am missing?

I know that V7 is "Not Tested" but that is why I wanted to start playing with it!

@egamecash
Copy link

I'm having the same problem, everything has been configured correctly, but V7 is not enabled.

@2acoin
Copy link
Contributor Author

2acoin commented May 21, 2018

@kennetanti thanks for the offer to create a pull request to update the logic... However, I have already sent a request #83 to the dev.

@egamecash
Copy link

egamecash commented May 21, 2018

@2acoin with this update done by you, is v7 enabled correctly?

the v7 block index in my test was above block 100 height:
POW_CRYPTONIGHT_V7_BLOCK_INDEX = 100;
with
UPGRADE_HEIGHT_V2 = 100;

(test)

@2acoin
Copy link
Contributor Author

2acoin commented May 22, 2018

@egamecash This fixes some of the logic for the execution of the V7 code. However, it still does not enable the code execution. I am still going through the code to see why. @pmitchev may have an swer for us if he has the time.

@kennetanti
Copy link

@egamecash upgrade_height_v2 does nothing btw

@egamecash
Copy link

@2acoin okay, I'll check what I can do for v7 to work on my coin, if I succeed I'll share it for all

@egamecash
Copy link

egamecash commented May 22, 2018

@kennetanti Yes, I know : )

@kennetanti
Copy link

@egamecash same. Ill also share if i find the thing. I have a day job and a girlfriend so my time to work on such things is limited but yeah

@egamecash
Copy link

egamecash commented May 27, 2018

I work at home and I do not have a girlfriend, I think it will make it easier for me, lol

I am looking at v7 now, I can not stand asic mine in my currency, if I continue for another 2 months they will have more coins than I.

@kennetanti
Copy link

@egamecash well if they can afford asics and you cant, im guessing they already have more coins than you. Just not ur coin, ones that matter like usd and btc. Why no focus on making a simple payment processor for games to integrate your coin easily for micropayments and then just take 10% as a fee? Instead of focusing on monopolizing a shitcoin, actually build a thing that makes your coin useful. Whitepapers arent just a trophy, the words they contain are serious. Its not a joke.

@ghost
Copy link

ghost commented Jun 21, 2018

Hello @kennetanti @2acoin and everybody :) If I want to create a completly new coin with premined coin using a Cryptonote V7, what values ​​do these parameters have? I'm very confused about the meaning of these parameters...

POW_CRYPTONIGHT_V7_BLOCK_INDEX=?
POW_CRYPTONIGHT_V7_LAST_BLOCK=?

Thanks!!

@CobitCoin
Copy link

any success with pow v7 ? i tried in several ways and cannot activate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants