1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 23:08:07 +00:00
Commit Graph

861 Commits

Author SHA1 Message Date
Con Kolivas
ec9b32aac0 Zero the best share string memory when zeroing stats. 2012-12-31 09:15:17 +11:00
Con Kolivas
6e2e7d36de Differentiate socket full from sock full. 2012-12-29 10:46:55 +11:00
Con Kolivas
7f46f6e91f Allow stratum to startup without notify but check it is valid before creating stratum work. 2012-12-29 10:42:45 +11:00
Con Kolivas
e1d7ecdd35 Do not try to generate stratum work unless the notify command has succeeded. 2012-12-29 09:45:40 +11:00
Con Kolivas
34a6c59a92 Reset total diff1 shares when zeroing stats as well to show correct work utility. 2012-12-27 09:49:22 +11:00
Con Kolivas
8958ee424b Do not give the share submission failure message on planned stratum disconnects. 2012-12-26 09:38:58 +11:00
Con Kolivas
944af31b99 Parse anything in the stratum socket if it's full without waiting. Empty the socket even if a connection is not needed in case there are share returns. 2012-12-26 09:31:41 +11:00
Con Kolivas
dd4e51594b Provide a mechanism to zero all the statistics from the menu. 2012-12-25 23:44:26 +11:00
Con Kolivas
d3bfee14b3 Display the current pool diff in the status line. 2012-12-25 23:14:21 +11:00
Con Kolivas
fedf0f11e4 Display block diff in status line. 2012-12-25 14:53:44 +11:00
Con Kolivas
98151b2ee4 Generalise the code for solving a block to enable block solve detection with scrypt mining. 2012-12-25 14:36:08 +11:00
Con Kolivas
f0c1782c03 Generate the output hash for scrypt as well and use the one function to set share_diff. 2012-12-25 14:08:27 +11:00
Con Kolivas
f86e893118 Use the flip80 function in regeneratehash and the correct sized hash array. 2012-12-24 14:13:28 +11:00
Con Kolivas
93e3c16aa8 Stage work outside of the stgd lock to prevent attempted recursive locking in clone_available. 2012-12-24 13:49:28 +11:00
Con Kolivas
34879487fc share_diff needs to be performed on a BE version of the output hash to work, leading to false best_share values as spotted by luke-Jr. 2012-12-24 13:31:45 +11:00
Con Kolivas
deb9aec0ed Remove the unused sha224 functions. 2012-12-24 12:54:09 +11:00
Con Kolivas
432bfd0e5c Use the flip functions in hashtest. 2012-12-24 12:39:27 +11:00
Con Kolivas
54e218b6d4 Simplify the setting of the nonce data field in work on submitting nonces. 2012-12-24 11:19:33 +11:00
Con Kolivas
69dd5affe3 Scrypt code does not enter the hashtest function. 2012-12-24 10:45:57 +11:00
ckolivas
9fd60bb53a Merge branch 'master' of github.com:ckolivas/cgminer 2012-12-24 10:34:06 +11:00
Con Kolivas
df7370d066 Go back to cloning available work under staged lock. 2012-12-24 10:26:56 +11:00
ckolivas
d91dc188d2 scrypt_diff uses a uint64_t as well. 2012-12-23 15:44:43 +11:00
Con Kolivas
bb64799c84 Correct target for stratum support with scrypt mining. 2012-12-22 08:37:43 +11:00
Con Kolivas
b9c7f3d169 Remove debugging message :P 2012-12-19 21:31:22 +11:00
Con Kolivas
a07e0155bc Stop all work from the current pool if it's a stratum pool once it is disconnected since it will be invalid upon reconnecting. 2012-12-19 20:53:11 +11:00
Con Kolivas
8dbb3fa2f9 Discard all staged work from stratum pools as well as the shares upon disconnection since all the work becomes invalid. 2012-12-19 20:51:22 +11:00
Con Kolivas
a7128e008f Use correct cbreak after 15 second delay when no pool is found alive. 2012-12-19 20:21:32 +11:00
Con Kolivas
4f1f5c8ec9 Revert "Reset lagging flag after it has been used in the getwork scheduler."
This reverts commit 19267907c0.

Redundant.
2012-12-19 20:04:22 +11:00
ckolivas
19267907c0 Reset lagging flag after it has been used in the getwork scheduler. 2012-12-19 14:41:42 +11:00
ckolivas
14457a0b9b Allow stratum to work with scrypt. 2012-12-19 14:41:29 +11:00
Con Kolivas
3b910336ce Protect the best_share/best_diff values under control lock. 2012-12-18 22:48:56 +11:00
Con Kolivas
9ef73d9300 Check a stratum pool hasn't gone dead while being a backup pool and missed having its idle flag cleared. 2012-12-17 12:27:50 +11:00
Kano
43e8b88a73 Benchmark incorrect work size 2012-12-12 19:52:36 +11:00
Con Kolivas
e51ee93182 Set tv_idle time if a pool is not active when input from the menu. 2012-12-10 21:25:17 +11:00
Con Kolivas
70b6287627 Merge pull request #354 from kanoi/api
minor unlikely zero pointer test
2012-12-09 23:58:54 -08:00
Kano
58a7226d96 minor unlikely zero pointer test 2012-12-10 18:42:32 +11:00
Con Kolivas
c3fb1bcef5 Revert "Selectively discard all work items if a longpoll or stratum restart is received without a new block to work on."
This reverts commit 31f75098b5.

Mistake, set in work_block already.
2012-12-10 15:40:16 +11:00
Con Kolivas
1922e498e3 Only stratum pools that are idle need to be kicked via cnx_needed. 2012-12-10 11:03:50 +11:00
Con Kolivas
c5d9f3ac60 Only set the lagging flag for select_pool() on failed getwork if we're not in opt_fail_only mode. 2012-12-10 10:32:21 +11:00
Con Kolivas
383b42f23e Set the pool lagging flag on startup to avoid it being shown initially, and only unset it once the maximum number of staged work items has been reached. 2012-12-09 17:15:13 +11:00
Con Kolivas
8feb302945 Avoid recursive locking of the stgd lock. 2012-12-09 15:38:44 +11:00
Con Kolivas
c59aeb56ff Revert "Wake the getwork scheduler after every restart threads."
This reverts commit 5b03e7497d.

Redundant.
2012-12-09 15:29:06 +11:00
Con Kolivas
31f75098b5 Selectively discard all work items if a longpoll or stratum restart is received without a new block to work on. 2012-12-09 15:28:30 +11:00
Con Kolivas
5b03e7497d Wake the getwork scheduler after every restart threads. 2012-12-09 15:11:49 +11:00
Con Kolivas
01b9c6dfbf Make main() the getwork scheduler once everything is set up, so that all app exits use the kill_work and quit paths. 2012-12-09 08:22:13 +11:00
Con Kolivas
30f6840b5c Only consider work stale for stratum of different job_id if it's not a share. 2012-12-08 22:08:23 +11:00
Con Kolivas
67a9af68a1 Hash_pop should signal further waiters on its own pthread conditional in case there are multiple waiters. 2012-12-08 21:53:06 +11:00
Con Kolivas
5c4c2d6786 Check the job_id has not changed on stratum work when deciding if the work is stale as might occur across disconnections. 2012-12-08 21:45:15 +11:00
Con Kolivas
fcb265322d Perform pool_resus on getwork pool that generates work in getwork_thread. 2012-12-08 21:35:14 +11:00
Con Kolivas
3d1e9f5098 Set pool lagging message for getwork pool that falls to zero staged in getwork thread. 2012-12-08 21:32:49 +11:00
Con Kolivas
927730ae2c Stage extra work when the primary pool is a getwork pool without rolltime. 2012-12-08 21:27:40 +11:00
Con Kolivas
24de9b8655 Do not try to clean up twice if kill message is given. 2012-12-08 21:23:33 +11:00
Con Kolivas
84b44fd852 Only recalculate total_staged in getwork thread if required. 2012-12-08 21:21:19 +11:00
Con Kolivas
b28055517e Implement a completely new getwork scheduler.
Stage all work from the one thread, making it possible to serialise all requests minimising the number of getworks requested or local work generated.
Use a pthread conditional to wake up the thread whenever work is removed to generate enough work to stay above the watermark set by opt_queue.
Remove all remnants of the old queueing mechanism, deleting the now defunct queued count.
2012-12-08 21:13:04 +11:00
Con Kolivas
dd65818295 Remove all references to the now unused workio_cmd structure. 2012-12-07 13:45:03 +11:00
Con Kolivas
ed1b5cae0d Remove the old workio command queue thread, replacing it with a kill conditional to exit the program. 2012-12-07 13:40:26 +11:00
Con Kolivas
59ddfd07a7 Remove getwork command from workio_cmd queues and do them directly from queue_request. 2012-12-07 13:32:23 +11:00
Con Kolivas
c99636f21b Begin tearing down the old workio command queues by removing submit commands from there and submit them asynchronously via their own threads. 2012-12-07 13:21:46 +11:00
Con Kolivas
c0cd006f42 Allow pool active to be called on stratum or disabled pools in the watchpool thread if the pool has not been probed. 2012-12-04 21:49:11 +11:00
Con Kolivas
52b4bae961 Combine shared padding into one char. 2012-12-04 21:29:49 +11:00
Con Kolivas
e14d1d6e2a Merge pull request #340 from kanoi/main
lock the threaded statistics updates
2012-12-04 00:18:10 -08:00
Kano
120fc7aff9 lock (most of) the threaded statistics updates 2012-12-04 19:14:27 +11:00
ckolivas
b86aa20bf6 Make need connection return true if a pool is idle. 2012-12-04 11:06:35 +11:00
Con Kolivas
777f0573c3 Merge pull request #339 from kanoi/api
API lock access to some summary statistics + API add Best Share to summary
2012-12-03 04:19:17 -08:00
Kano
e55fe73f9a API add Best Share to summary 2012-12-03 23:08:11 +11:00
Con Kolivas
c4b17ae918 Check on creating new GBT work if the structures are up to date and update them as required rather than regularly. 2012-12-03 17:54:57 +11:00
Con Kolivas
401357e657 Enable backup stratum connections for getwork when the primary pool doesn't have longpoll aka solo mining. 2012-12-03 16:45:43 +11:00
Con Kolivas
289d6807ef Check for correct absence of opt_fail_only in cnx_needed. 2012-12-03 16:16:00 +11:00
Con Kolivas
4b28c8595b Remove unused variable. 2012-12-03 15:28:52 +11:00
Con Kolivas
f4d305a9cd The specification for stratum has been elaborated to say that a changed diff applies only to new work so do not retarget when submitting shares. 2012-12-03 15:26:58 +11:00
Con Kolivas
1ad671b094 Use a variable length string array in submit_upstream_work to cope with massive GBT submissions. 2012-12-03 15:17:44 +11:00
Kano
a67e96c3e4 API lock access to some summary statistics (and copy them) 2012-12-03 11:36:15 +11:00
Con Kolivas
fc5d3a0eaf Suspend stratum connections to backup pools when there is no requirement to potentially grab work from them. 2012-12-03 09:52:46 +11:00
Con Kolivas
9a71654761 Merge pull request #338 from denis2342/threadname
small patch to add names to threads, should work for linux, freebsd and osx
2012-12-02 12:46:01 -08:00
Denis Ahrens
4fbdc1eaa8 enumerate the mining threadnames 2012-12-02 18:36:15 +01:00
Kano
152e7e36a2 mmq usb v0.4 + api usb stats 2012-12-02 21:48:37 +11:00
Denis Ahrens
271b05ab04 setting the name of the threads for linux,freebsd,openbsd and osx
code is borrowed from bitcoins util.c, so it is already tested
2012-12-02 11:39:20 +01:00
Con Kolivas
4584068c67 Don't show broken WU value with scrypt mining. 2012-12-02 20:51:21 +11:00
Con Kolivas
b8843546e3 Remove unused getwork times in getswork. 2012-12-02 20:45:57 +11:00
Con Kolivas
cc14f16670 Make gen_stratum_work more robust by using a dynamically allocated array for the header in case bogus data is sent by the pool to avoid overflowing a static array. 2012-12-02 19:29:54 +11:00
Con Kolivas
f94cff77e6 Microoptimise and remove redundant copy of strdup function in calloc_strcat. 2012-12-02 18:06:55 +11:00
Con Kolivas
53c9cdaf56 scrypt_diff now returns a uint64_t 2012-12-02 16:56:36 +11:00
Con Kolivas
d8e18994d5 Support monitoring and reporting much higher diffs for scrypt mining, truncating irrelevant zeroes from displayed hash. 2012-12-01 23:36:17 +11:00
Con Kolivas
0ae02c6ec4 Since we will be using calloc_str to put a string into it, convert the function to calloc_strcat which does it automatically. 2012-12-01 08:26:31 +11:00
Con Kolivas
01eb807ca0 Revert "Handle crash exceptions by trying to restart cgminer unless the --no-restart option is used."
This reverts commit 68c881fde7.

Does not reliably restart on crashes often enough and makes debugging more difficult.
2012-11-29 13:00:02 +11:00
Con Kolivas
bc4f6d928a Count longpoll and GBT decodes as queued work since the count otherwise remains static. 2012-11-29 12:58:42 +11:00
Con Kolivas
1746e4714e Use the string helper functions to create gbt blocks of any length. 2012-11-29 12:49:28 +11:00
Con Kolivas
217be6ed98 Do away with the flaky free_work api in the driver code which would often lose the work data in opencl and simply flush it before exiting the opencl scanhash. 2012-11-25 00:37:46 +11:00
Con Kolivas
c34ff36763 Use base_work for comparison just for cleanness in __copy_work 2012-11-24 23:08:14 +11:00
Con Kolivas
73671ab360 Remove all static work structs, using the make and free functions. 2012-11-24 18:45:02 +11:00
Con Kolivas
3ab92ef6ad Add pool no. to stale share detected message. 2012-11-24 13:35:00 +11:00
Con Kolivas
850d07dffb Add info about which pool share became stale while resubmitting. 2012-11-24 12:58:58 +11:00
Con Kolivas
31e43944bc Do not use or count or use the getworks submitted which are simply testing that pools are still up. This was increasing share leakage and making stats not reflect real work. 2012-11-24 10:58:46 +11:00
Con Kolivas
2d35ac2567 Track all dynamically allocated memory within the work struct by copying work structs in a common place, creating freshly allocated heap ram for all arrays within the copied struct.
Clear all work structs from the same place to ensure memory does not leak from arrays within the struct.
Convert the gbt coinbase and stratum strings within the work struct to heap ram.
This will allow arbitrary lengths without an upper limit for the strings, preventing the overflows that happen with GBT.
2012-11-24 10:47:20 +11:00
Con Kolivas
aa72db369e Provide rudimentary support for the balancing failover strategies with stratum and GBT by switching pools silently on getwork requests. 2012-11-18 23:04:01 +11:00
Con Kolivas
40a3331e72 Remove unintentional block of code in reuse_work. 2012-11-18 22:27:03 +11:00
Con Kolivas
9ad02fe303 Support workid for block submission on GBT pools that use it. 2012-11-18 21:48:44 +11:00
Con Kolivas
61f4e9d604 Revert "Discard all work on longpoll, not just work cgminer recognises as stale."
This reverts commit 1470eea903.

Work block update makes this unnecessary.
2012-11-18 17:22:48 +11:00
Con Kolivas
f14bf5b16c Merge pull request #326 from pshep/error_counters
Error counters
2012-11-17 22:06:49 -08:00
Con Kolivas
4039ee7a93 Convert pool not responding and pool alive message on backup pools to verbose level only since they mean a single failed getwork. 2012-11-18 16:53:39 +11:00