Commit Graph

4320 Commits (master)

Author SHA1 Message Date
Sunny King c8e2cc4ced Primecoin: Update development README 2013-07-27 12:58:21 +03:00
Sunny King 3bba49220a Primecoin: Add checkpointsync.h to qt project file 2013-07-27 12:56:36 +03:00
mikaelh ea5ecc0b23 Restore the original linking mode after -l gmp. 2013-07-26 17:28:23 +03:00
mikaelh 6e8970b8f0 Rename 'gensieveroundpercentage' to 'roundsievepercentage' for simplicity. 2013-07-26 00:31:13 +03:00
mikaelh eb2402ac05 Added RPC commands getsievepercentage, setsievepercentage, getgensieveroundpercentage and setgensieveroundpercentage. 2013-07-26 00:14:01 +03:00
mikaelh 41a127a518 Pass pindexPrev from BitcoinMiner() to MineProbablePrimeChain() to avoid potential races. 2013-07-26 00:01:35 +03:00
mikaelh 2bc63f3e6a Fix wiping the bit arrays. 2013-07-25 23:20:02 +03:00
Brian 'geeknik' Carpenter bfcd895e95 Changing references from Bitcoin to Primecoin 2013-07-25 21:02:19 +03:00
Brian 'geeknik' Carpenter 5c0e7880ca Changing more references from Bitcoin to Primecoin 2013-07-25 21:00:57 +03:00
Sunny King b508520658 Primecoin: Update windows product version and copyright notice 2013-07-25 20:59:39 +03:00
mikaelh bd96b81cb0 Added a new configurable round primorial adjustment system.
The new parameter -gensieveroundpercentage (defaults to 30) determines how much time should be spent generating the sieve.
The round primorial is then adjusted so that the desired amount of time is spent generating the sieve.
2013-07-25 20:22:19 +03:00
mikaelh eabc422f5a Change version to -hp8. 2013-07-25 18:04:14 +03:00
mikaelh 0fa0615efb Fix performance regression on mainnet caused by round primorial being adjusted too low.
The expected time dropped when 0 primes were found which caused the adjustment system to always decrease the round primorial.

Changed the calculation so that expected time is very high with 0 primes found.
Added an additional check so that round primorial is always incremented when 0 primes are found.
2013-07-25 17:16:58 +03:00
mikaelh 41c38d982d Added linker flags that allow bundling libgmp.so with the binary release on Linux. 2013-07-25 15:10:24 +03:00
mikaelh 07bbb688e9 Always link against GMP dynamically. 2013-07-25 14:25:50 +03:00
mikaelh 59625e36d7 Only use the fast-div test for the first number in the chain because it skips fractional length calculation, thus preventing a potential block! Thanks to mtrlt for spotting this. 2013-07-25 10:46:41 +03:00
mikaelh c226dcd5af Slightly increase the number of fast divisibility tests. 2013-07-25 01:47:59 +03:00
mikaelh a2173af5d9 Wipe the bit arrays in smaller batches for maximal cache performance. 2013-07-25 01:25:10 +03:00
mikaelh ddfb693be0 Use manual allocation for the big multiplier arrays in CSieveOfEratosthenes::Weave().
This should fix the crashes on Windows with big sieve sizes.
2013-07-25 00:26:58 +03:00
mikaelh de35093ff0 Combine primes through multiplication to produce bigger divisors in CSieveOfEratosthenes::Weave(). 2013-07-24 20:58:09 +03:00
mikaelh df0b09da73 Avoid multiplying the block header hash with the fixed multiplier to make bignum calculations faster in CSieveOfEratosthenes::Weave(). 2013-07-24 20:16:04 +03:00
mikaelh cd6ce096d7 Return out of MineProbablePrimeChain() immediately after a new sieve has been generated so that one call won't take too long. 2013-07-24 18:56:33 +03:00
mikaelh c620620dc9 Try to execute a constant number of tests during each call to MineProbablePrimeChain(). 2013-07-24 18:50:29 +03:00
mikaelh 266d3e4699 Avoid making full copies of GMP variables. 2013-07-24 18:36:01 +03:00
mikaelh e4b5b02881 Faster calculation of next number in the chain. 2013-07-24 18:05:57 +03:00
mikaelh 8bfc979600 Faster computation of nMod8. 2013-07-24 17:44:24 +03:00
mikaelh 27c3cdf5b5 Remove redundant fast div test with the last prime included in the round primorial. 2013-07-24 17:40:11 +03:00
mikaelh bc9a91dddf Speed up fast divisibility tests by dividing with a large number first and then checking whether the remainder with the small primes. 2013-07-24 16:59:12 +03:00
mikaelh 64528eba38 Skip the fractional length calculation if the first primality test fails (as suggested by gatra on bitcointalk). 2013-07-24 12:31:24 +03:00
Sunny King a51d63ea37 Port Sunny King's fix for miner performance issue with large block size
Primecoin: Fix miner performance issue with large block size
           Miner create new block at most once every 10 seconds
2013-07-23 11:18:06 +03:00
mikaelh b0544e41e8 Small optimization to ProcessMultiplier() for x86 CPUs. 2013-07-23 09:34:39 +03:00
mikaelh c868744456 Optimize GetNextCandidateMultiplier() a bit further. 2013-07-21 19:46:19 +03:00
mikaelh 7ca3db818f Added a new tuning parameter -sievepercentage.
Added getchainspermin RPC command.
Added 'chainspermin', 'difficulty', 'sievepercentage' and 'sievesize' to the output of the 'getmininginfo' RPC command.
2013-07-21 19:26:48 +03:00
mikaelh 7a9e0ac77a Restore dynamic round primorial since it seems to be performing pretty well on testnet. 2013-07-21 17:58:10 +03:00
mikaelh f6def2576e Speed up GetNextCandidateMultiplier() by skipping entire words. 2013-07-21 17:15:02 +03:00
mikaelh 7c418590bf Get rid of practically all memory allocations inside the primality testing loop.
Other small optimizations.
2013-07-21 16:18:34 +03:00
mikaelh 9bd1366f8c Optimize primorial computation. 2013-07-21 12:58:26 +03:00
mikaelh cfcdc3112a Drop the 'mining' parameter now that the code paths are separate.
Added fast divisibility testing to EulerLagrangeLifchitzPrimalityTestFast().
2013-07-21 12:16:33 +03:00
mikaelh 97ca422327 Added a copy of the original code for checking proof of work (as per Sunny King's request). 2013-07-21 12:02:52 +03:00
mikaelh 835a7db8bf Optimize the block header hash loop in BitcoinMiner(). 2013-07-21 11:38:38 +03:00
mikaelh 61ca3e5930 Moved the calculation of the fixed multiplier outside the loop in BitcoinMiner(). 2013-07-21 11:26:04 +03:00
mikaelh 973ae84fcf Experimenting with a fixed round primorial.
Added fast divisibility tests before doing the expensive Fermat's test.
2013-07-21 11:17:12 +03:00
mikaelh d8f7447983 Attempt to fix the random crash issue while mining. The crash message was:
primecoind: checkqueue.h:167: CCheckQueueControl::CCheckQueueControl(CCheckQueue*) [with T = CScriptCheck]: Assertion `pqueue->nTotal == pqueue->nIdle’ failed.
2013-07-20 18:47:31 +03:00
mikaelh aecabb6086 Fix compiling after applying the shutdown patch. 2013-07-20 13:49:28 +03:00
sunnyking da7318938d Merge pull request #4 from thared/master
Graceful shutdown of miner threads (David L. Unger)
2013-07-20 12:16:30 +03:00
mikaelh 885da2f55e Move CSieveOfEratosthenes::ProcessMultiplier to prime.h so that it gets inlined. 2013-07-18 20:45:56 +03:00
mikaelh 0fc0a61888 Initialize the candidate array with zeros to prevent silly candidate counts when a new block interrupts CSieveOfEratosthenes::Weave(). 2013-07-18 16:49:18 +03:00
mikaelh 917634906d Clean up the code a bit. 2013-07-18 16:29:27 +03:00
mikaelh a8ac6e1062 Save memory through manual allocation.
Less calls to GetTimeMicros() when testing the sieve.
Copy the value from boost::thread_specific_ptr to a normal pointer.
2013-07-18 12:10:27 +03:00
mikaelh 3a65dad6ce Fix indentation. 2013-07-17 19:59:22 +03:00