Forum

Attention: For Live support and discussion, please visit our Discord!  https://discord.me/curecoin

Problem with testnet 2.0a3  

  RSS
wilding2004
(@wilding2004)
Estimable Member Customer

Hi all,

I've tried running the testnet packages and something definitely starts to happen. But everything seems to hang after the first block has finished. This is all I get from the miner

..........
Current hash rate: 61 KH/s of 12 x SHA256
Mined 0 blocks.
SHA256(4JTR7glkIeyq1255475211, 12) = 0000007A4BA23C335882AF97CF4F69509B5E91A53B7
E792CBE25A1CF7449ABE9
Submitting 4JTR7glkIeyq1255475211 to work server....

and this if the last few lines from the core? (not sure what you call it)

Validating block 917
Attempting to add block 917 with hash 4F965E4ECDDA95545D30F98DBE06E9286CFDF82D16
EC183837AF86ACEE3EF70D
Validating block 917
Don't need to regen address file...
Got connection from /155.94.254.14.
Sent:: REQUEST_NET_STATE
PUTTING INTO WRITE BUFFER: REQUEST_NET_STATE
Caught up with network.
Sending REQUEST_NET_STATE to /155.94.254.14

They both just sit like that with no cpu activity at all.

Cheers

Dave.

ReplyQuote
Posted : 25/09/2015 2:31 pm
wuffy68
(@wuffy68)
Member Admin

I'll let Vork know. I haven't run the client for a couple of weeks, so he'll be the best to answer this.

ReplyQuote
Posted : 26/09/2015 10:55 pm
vorksholk
(@imported_vorksholk)
Trusted Member Customer

Yup, I'm aware of the issue, seems to occur intermittently when the Certificate Server hangs for some reason that I haven't yet been able to reproduce in testing, since the server hangs occasionally without rhyme or reason.

ReplyQuote
Posted : 26/09/2015 11:05 pm
wilding2004
(@wilding2004)
Estimable Member Customer

Seems to be running ok again now. 🙂

Quick question - what does "certificate failed with target score .........." mean?

Cheers

ReplyQuote
Posted : 28/09/2015 1:41 pm
vorksholk
(@imported_vorksholk)
Trusted Member Customer

@wilding2004 wrote:

Seems to be running ok again now. 🙂

Quick question - what does "certificate failed with target score .........." mean?

Cheers

Wow, sorry about the late response!

Basically, a target score is a "maximum" value that a certificate can get when hashed. So say we SHA256 hash something (like, the meat of a 2.0 block), and get
05a16c1f28e81aae518b6ea128a71bed8cb0d72faf3dce56d7c413fb84f06076

This is, of course, in HEX, but it can be converted to a decimal:
2546772849017425687159647563665887022579435802844030155809744462562074845302

Big number, but it makes sense. The hard part is getting a SHA256 hash which is a "small" decimal number. The target is the decimal value that a SHA256 hash of the certificate plus nonce must fall under. At higher difficulties, this target is smaller. At maximum difficulty, this target would be 1, meaning the hash would have to be entirely zeros to solve a block.

Now, due to the reasonable range of mining difficulties, we can simplify the above by only using 1/4 of the actual hash, or the first 8 bytes. The actual code to get the target is:


byte[] hash = md.digest(certificateWithNonce.getBytes("UTF-8"));
long score = 0L;
for (int j = 0; j < 8; j++)
{
score = (hash[j] & 0xff) + (score << 8); //This takes the first 8 bytes of the hash, and turns it into a long. Works out nicely, as a Long is 64 bits.
}

This gives us 05a16c1f28e81aae from the above example, which is 405724322526141102 in decimal. As a result, the difficulty would have to be about 45.466 (rounded for convenience), as 9223372036854775807 (the maximum value of a signed 64-bit number) divided by half of 45.466 is just above the above block hash.

At a difficulty of 45.466, the target would be 405726126637697435, which our above-found score (405724322526141102) is lower than.

ReplyQuote
Posted : 01/12/2015 12:08 am
Share:
  
Working

Please Login or Register