Author

Topic: [ANN][RIC] Riecoin: constellations POW *CPU* HARD FORK successful, world record - page 244. (Read 685362 times)

dga
hero member
Activity: 737
Merit: 511
Hi All

Next n-1 optimization got me an 11% gain.  In scanriecoin.c's init funtion change memset and start looping @ 1 (note I've other optimizaitons which might have "confused" this code section so no complaints).

Code:
        // Just memset odd/even and be done
        memset( pSieve, 0xAA, opt_sieve_size/8 );

        // We set odd primes in the memset ;-) so start @ 2nd prime (3)
        for(unsigned int primeIndex = 1 ; primeIndex < primeTableSize; primeIndex++ ) {

We can do this as the base is always an even number so no point looping to bit set every second bit.  Also there is a slight variance as the original code never marked the 1st bit as composite (doesn'tmake much of a difference, but did cause me concern until I spent some quality time in gdb.

Off to work, enjoy.

--
bsunau7



For others:  Be very careful when doing this.  You need to take steps to *ensure* that the base is always even -- changes elsewhere in code can render this assumption false.  I ran into this the hard way.

The real risk here is that you *won't know that you screwed up* unless you've applied my length-reporting patch.  The kh/s numbers will go up if you apply this change wrong, and it will look great, but it will look good because it's reporting all sorts of crap that then get counted in kh/s but filtered out by the rabin-miller tests.

Ahem, giving away my secret sauce a bit, you can easily ensure that the base is something you want by unconditionally mpz_set'ting or clearing, as you need for your other tweaks, the last bit of 'b' before the call to init().

Apply the length outputting patch and then test bsunau7's suggestion.  It will make things faster if it works right. Smiley

  -Dave
member
Activity: 114
Merit: 10
Current n-1 improvement (already mentioned elsewhere):

Run rminerd with a larger sieve.  12% improvement in going from 1Mb (default) to 2Mb on xeon class machines (i.e with large caches).  For example

Code:
./rminerd -q -o http://10.10.10.10:28332 -O awallet:apassword -t 8 -i 2097152 

Regards,

--
bsunau7

Next n-1 improvement is a small one (1-2% depending on how sieve size used) and was found before I focused on the time critical code:

Replace all

Code:
  if( mpz_probab_prime_p ( bnTarget, MR_TESTS) )

With

Code:
  if( mpz_millerrabin ( bnTarget, MR_TESTS) )

mpz_probab_prime_p is a wrapper around mpz_millerrabin which includes tests for small primes.  The sieve which riecoin uses has already sieved the numbers so no need to double sieve.

I would expect this to make more than a few % points on small memory systems.

Regards,

--
bsunau7

Hi All

Next n-1 optimization got me an 11% gain.  In scanriecoin.c's init funtion change memset and start looping @ 1 (note I've other optimizaitons which might have "confused" this code section so no complaints).

Code:
        // Just memset odd/even and be done
        memset( pSieve, 0xAA, opt_sieve_size/8 );

        // We set odd primes in the memset ;-) so start @ 2nd prime (3)
        for(unsigned int primeIndex = 1 ; primeIndex < primeTableSize; primeIndex++ ) {

We can do this as the base is always an even number so no point looping to bit set every second bit.  Also there is a slight variance as the original code never marked the 1st bit as composite (doesn'tmake much of a difference, but did cause me concern until I spent some quality time in gdb.

Off to work, enjoy.

--
bsunau7

sr. member
Activity: 350
Merit: 250
DTC unofficial team
run:
listtransactions '*'

It will show you any orphaned blocks.
what does '*' mean here? afaik 'riecoind listtransactions' shows everything  we need
sr. member
Activity: 278
Merit: 250
run:
listtransactions '*'

It will show you any orphaned blocks.

That command works great. Thank You.
full member
Activity: 213
Merit: 100
run:
listtransactions '*'

It will show you any orphaned blocks.
sr. member
Activity: 278
Merit: 250
I also seem to have some orphan blocks:

2014-02-12 11:17:03 proof-of-work found
  hash: b3bd87acc17fb9d4e1fa39553118f1a6884c0ad6972ab6d827c6665c430ffbc3
  diff compacted: 0202d900 nOffset: 00000000000000000000000000000000000000000000000000000000c006bab9
2014-02-12 11:17:03 CBlock(hash=92fbd77a8e06240f95a9a043b7066e54fd8f4704f5dbaaf0fa67a4f0c5583381, ver=2, hashPrevBlock=3e3ece911e2fdaff6effbb30ba827352b543ac983edc51d67ead9eb5c964683d, hashMerkleRoot=e0fe2228b7ea95f9d259c8b29055914d5c05733fee1df1f6422697080fa1357a, nTime=1392203783, nBitsCompact=0x0202d900, nOffset=00000000000000000000000000000000000000000000000000000000c006bab9, vtx=1)
2014-02-12 11:17:03   CTransaction(hash=e0fe2228b7ea95f9d259c8b29055914d5c05733fee1df1f6422697080fa1357a, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 02af0602a10a062f503253482f)
    CTxOut(nValue=50.00000000, scriptPubKey=0317892d4cc157ab5228f8c5db0a01)
  vMerkleTree: e0fe2228b7
2014-02-12 11:17:03 generated 50.00
2014-02-12 11:17:03 keypool keep 20
2014-02-12 11:17:03 AddToWallet e0fe2228b7ea95f9d259c8b29055914d5c05733fee1df1f6422697080fa1357a  new
2014-02-12 11:17:04 Committing 1 changed transactions to coin database...
2014-02-12 11:17:04 SetBestChain: new best=92fbd77a8e06240f95a9a043b7066e54fd8f4704f5dbaaf0fa67a4f0c5583381  height=1711  work=21398734299177002605089976848  tx=1802  date=2014-02-12 11:16:23  progress=0.999842
sr. member
Activity: 616
Merit: 321
Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   

This is network stats, not your stats. amirite?

i am mining solo atm ..............
You're mining solo but how is your wallet supposed to know about the other blocks on the network? Your log shows that your wallet added another block to your local database. Stop your wallet for a few hours and let it resync and see how many blocks it processes and commits to your database.

hmm oke il do that , its strang wile i use the original wallet and the original rminerd .................
sr. member
Activity: 616
Merit: 321
Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   
height=735 is lagging latest blocks by a lot. Maybe you are on a fork?


hmm have the original wallet and original rminerd and solo what can go wrong then ?
legendary
Activity: 1176
Merit: 1134
Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   
height=735 is lagging latest blocks by a lot. Maybe you are on a fork?
sr. member
Activity: 294
Merit: 250
sr. member
Activity: 278
Merit: 250
So difficulty is currently at 774 bits or 234 decimal digits and I haven't found a block in over 24 hours. At this number size, expect about one (1) out of every 540 integers to be prime. Well, until we optimize the segmented sieve of Eratosthenes further for finding prime sextuplets, it is back to Primecoin mining for me. The miners released with this coin are a joke.

So many people have pointed out that unless you have massive amounts of processing power, this coin is not for you. It is a shame because a lot of people will be left out.

It is going to be interesting to see how a pool miner will be implemented - there are a lot of  2 - 4 chains, but very few 5 - 6 chains.

EECS in your .signature tag and not interested in doing the optimization? *grins*  If only the release happened during IAP.

The difficulty is high, but - solo mining is hard, period.  An optimized sieve won't change the difficulty of solo mining.

What the optimized sieve will do is level the playing field.  Right now there's a factor of 14x difference, at least, between the best private miners and the released one.  It's great fun for people who like to tweak the code, but probably not the best long-term thing for the coin.

I will have a few hours of down-time this weekend to optimize the sieve.

Also, I found a block after 26 hours from my last block on a 32-core (Intel) server:

2014-02-13 17:33:09 riecoinMiner:
2014-02-13 17:33:09 proof-of-work found
  hash: 58d1dc2537f82da8467ee8c8289b18ca6b610777eb53b83e04262a0f870de40d
  diff compacted: 02030800 nOffset: 000000000000000000000000000000000000000000000000000000008a4f195d
legendary
Activity: 1610
Merit: 1000
Crackpot Idealist
newbie
Activity: 58
Merit: 0
Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   

This is network stats, not your stats. amirite?

i am mining solo atm ..............
You're mining solo but how is your wallet supposed to know about the other blocks on the network? Your log shows that your wallet added another block to your local database. Stop your wallet for a few hours and let it resync and see how many blocks it processes and commits to your database.
member
Activity: 98
Merit: 10
we really need hit a bigger exchange platform for riecoin!

such as mcxnow or bter or cryptsy.
sr. member
Activity: 616
Merit: 321
Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   

This is network stats, not your stats. amirite?

i am mining solo atm ..............
member
Activity: 98
Merit: 10
hi

everybody

although we are listed on a exchange platform, but it’s a new platform.

so do not sell all your coins, the platform do not have so many user to buy RIE!
newbie
Activity: 27
Merit: 0
Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   

This is network stats, not your stats. amirite?
sr. member
Activity: 616
Merit: 321
 Huh Huh


2014-02-12 00:22:54 ProcessBlock: ACCEPTED
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:55 getblocks -1 to 0000000000000000000000000000000000000000000000000000000000000000 limit 500
2014-02-12 00:22:56 CreateNewBlock(): total size 1000
2014-02-12 00:23:02 received block 0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4
2014-02-12 00:23:02 Committing 1 changed transactions to coin database...2014-02-12 00:23:02 SetBestChain: new best=0561bb7a8a50a6461ddeb3a67611d61bac4e567e5ad98d2b96a89b781ad9b0e4  height=735  work=221353328532540772575871072  tx=736  date=2014-02-12 00:22:50  progress=0.999887


so it is clear to me we are mining for others


accepted understand that but i get accepted 0 in rminerd ?   
legendary
Activity: 1176
Merit: 1134
well i dont know muts about this all but you can see for your self in console
type :   gettxoutsetinfo  

results :

{
"height" : 2286,
"bestblock" : "bdecef8a7979e6f5dd9061ee58824830708744b57bb34ad6e5dae3ce030774dc",
"transactions" : 2123,
"txouts" : 2175,
"bytes_serialized" : 148458,
"hash_serialized" : "e560084d0d4564daac0ef2e46540780d5a72e1692ebaf96b638ab897955ae482",
"total_amount" : 71124.99999744
}


so in my eyes strange right ? or do i miss something here?
The 71124 total_amount is the number of coins mined and it matches what we would expect at block 2286
The thing that confuses me is that we are generating blocks closer to one per minute than one per 2.5 minutes.
Maybe the OP is wrong about the time between blocks?
sr. member
Activity: 616
Merit: 321
well i dont know muts about this all but you can see for your self in console
type :   gettxoutsetinfo  

results :

{
"height" : 2286,
"bestblock" : "bdecef8a7979e6f5dd9061ee58824830708744b57bb34ad6e5dae3ce030774dc",
"transactions" : 2123,
"txouts" : 2175,
"bytes_serialized" : 148458,
"hash_serialized" : "e560084d0d4564daac0ef2e46540780d5a72e1692ebaf96b638ab897955ae482",
"total_amount" : 71124.99999744
}


so in my eyes strange right ? or do i miss something here?
Jump to: