Post
Topic
Board Announcements (Altcoins)
Re: [ANN][CLAM] CLAMs, Proof-Of-Chain, Proof-Of-Pearl
by
Nthused
on 18/02/2015, 07:30:01 UTC
I guess that means each attempt is only taking a fraction of a second of CPU time, for each 16 second search interval? My wallet [has] 2 unspent outputs (one dust). I'm used to seeing clients trying to stake consume double figure CPU percentage - sometimes even 100% - for an extended period of time.

Every 16 seconds the client loops through your unspent outputs, checks which ones are old enough (>510 blocks since last stake, 4 hours since last transaction) and does a simple sha256 hash for each output. Since you only have 2 unspent outputs, that's basically 2 hashes. That takes approximately 0 seconds...

Still doesn't explain why those attempts are not successful. The extra debugging info you mentioned would be appreciated.

Here's the extra debugging version:

https://github.com/dooglus/clams/releases/tag/debug_staking_tag

Are you able to build from that? I guess you're downloading the whole .tar.gz archive each time, so that's where you'll find it.

If you build and run that, you'll see a bunch of extra debug logging. Each time a block is staked by the network you'll see a log like:

Quote
[STAKE] PASS: hash      38f3e302f765d3f21a83929dbd29d0d30a2259752d5c0ebdfdaa6e4ca3a
[STAKE]  <= target     2d4d3383b000000000000000000000000000000000000000000000000000
2015-02-18 07:21:55 SetBestChain: new best=ac14384781c33dc569d5218dd19912a67e7b7f16c13355eb6e3ae9934d7912f7  height=345208  trust=14360606016385876213  blocktrust=148138062331032  date=02/18/15 07:21:52
2015-02-18 07:21:55 ProcessBlock: ACCEPTED

To stake a block, the hash of the output that is trying to stake must be lower than the target hash. In this case 38f... is less than 2d4d... (it's one character shorter) and so it wins the right to stake.

Then every 16 seconds you'll see your outputs trying to stake:

Quote
[STAKE] searching for staking opportunity:
2015-02-18 07:22:09 [STAKE] checking 18 output(s)
2015-02-18 07:22:09 [STAKE] check fe7c7692b2ca1969ed4fb431144f6a15815f2a57b3bda9bbf8fcb2f338af9d28:107 (4.00 CLAM)
2015-02-18 07:22:09
[STAKE] fail: hash 413d56c739eb1bf553a51d7f642fe66d094f931746e433b14cda85178224d7ce
[STAKE]   > target     2d53118d2c00000000000000000000000000000000000000000000000000
2015-02-18 07:22:09 [STAKE] check fe7c7692b2ca1969ed4fb431144f6a15815f2a57b3bda9bbf8fcb2f338af9d28:125 (4.00 CLAM)
2015-02-18 07:22:09
[STAKE] fail: hash ccd1436cf112218abb68f704f1bfbd54f4b9206d3bc58dc76162af15a05e5266
[STAKE]   > target     2d53118d2c00000000000000000000000000000000000000000000000000

I have 18 unspent outputs, but I've cut the log off after the first 2 failed to stake. In both cases the hash is much bigger than the target, and so those outputs didn't get to stake.

BTW, can I PM you a small diff to ensure that clamd compiles cleanly under FreeBSD? I'm not familiar with git.

Of course.

So what is all this intended for dooglus ?
Is it for the next version of CLAM ?