forknote / cryptonote-generator

Generate Cryptonote coin with 1 command
106 stars 211 forks source link

Testing CryptonightV7 #82

Open 2acoin opened 6 years ago

2acoin commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

2acoin commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@egamecash upgrade_height_v2 does nothing btw

egamecash commented 6 years ago

@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 commented 6 years ago

@kennetanti Yes, I know : )

kennetanti commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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