diff --git a/Makefile.am b/Makefile.am index 2cd7d1ca..721c91d4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,7 +33,7 @@ endif sgminer_SOURCES := miner.c miner.h sgminer_SOURCES += api.c -sgminer_SOURCES += elist.h compat.h bench_block.h +sgminer_SOURCES += elist.h compat.h sgminer_SOURCES += util.c util.h uthash.h sgminer_SOURCES += sha2.c sha2.h sgminer_SOURCES += logging.c logging.h diff --git a/README.md b/README.md index 7726e190..703b197f 100644 --- a/README.md +++ b/README.md @@ -431,7 +431,7 @@ displayed for Accepted or Rejected work done. An example would be: The first 2 hex codes are the previous block hash, the rest are reported in seconds unless stated otherwise: The previous hash is followed by the getwork mode used M:X where X is one of -P:Pool, T:Test Pool, L:LP or B:Benchmark, +P:Pool, T:Test Pool or L:LP, then D:d.ddd is the difficulty required to get a share from the work, then G:hh:mm:ss:n.nnn, which is when the getwork or LP was sent to the pool and the n.nnn is how long it took to reply, diff --git a/bench_block.h b/bench_block.h deleted file mode 100644 index 4f45c6fe..00000000 --- a/bench_block.h +++ /dev/null @@ -1,39 +0,0 @@ -#if !defined(__BENCH_BLOCK_H__) - #define __BENCH_BLOCK_H__ 1 - - // Random work pulled from a pool - #define SGMINER_BENCHMARK_BLOCK \ - 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0xD8, 0x07, 0x17, 0xC9, 0x13, 0x6F, 0xDC, 0xBE, 0xDE, 0xB7, \ - 0xB2, 0x14, 0xEF, 0xD1, 0x72, 0x7F, 0xA3, 0x72, 0xB2, 0x5D, 0x88, 0xF0, 0x00, 0x00, 0x05, 0xAA, \ - 0x00, 0x00, 0x00, 0x00, 0x92, 0x8B, 0x4C, 0x77, 0xF5, 0xB2, 0xE6, 0x56, 0x96, 0x27, 0xE0, 0x66, \ - 0x3C, 0x5B, 0xDD, 0xDC, 0x88, 0x6A, 0x7D, 0x7C, 0x7B, 0x8C, 0xE4, 0x92, 0x38, 0x92, 0x58, 0x2E, \ - 0x18, 0x4D, 0x95, 0x9E, 0x4E, 0x44, 0xF1, 0x5F, 0x1A, 0x08, 0xE1, 0xE5, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, \ - 0x86, 0x7E, 0x3A, 0xAF, 0x37, 0x83, 0xAF, 0xA0, 0xB5, 0x33, 0x2C, 0x28, 0xED, 0xA9, 0x89, 0x3E, \ - 0x0A, 0xB6, 0x46, 0x81, 0xC2, 0x71, 0x4F, 0x34, 0x5A, 0x74, 0x89, 0x0E, 0x2B, 0x04, 0xB3, 0x16, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xF6, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, \ - 0x55, 0xF1, 0x44, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x79, 0x63, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - -#endif // !defined(__BENCH_BLOCK_H__) diff --git a/miner.c b/miner.c index 8b0032f9..6f73723b 100644 --- a/miner.c +++ b/miner.c @@ -53,7 +53,6 @@ char *curly = ":D"; #include "findnonce.h" #include "adl.h" #include "driver-opencl.h" -#include "bench_block.h" #include "algorithm.h" #include "scrypt.h" @@ -82,7 +81,6 @@ static char packagename[256]; bool opt_work_update; bool opt_protocol; -static bool opt_benchmark; bool have_longpoll; bool want_per_device_stats; bool use_syslog; @@ -1182,9 +1180,6 @@ static struct opt_table opt_config_table[] = { OPT_WITHOUT_ARG("--balance", set_balance, &pool_strategy, "Change multipool strategy from failover to even share balance"), - OPT_WITHOUT_ARG("--benchmark", - opt_set_bool, &opt_benchmark, - "Run sgminer in benchmark mode - produces no shares"), #ifdef HAVE_CURSES OPT_WITHOUT_ARG("--compact", opt_set_bool, &opt_compact, @@ -3098,24 +3093,6 @@ static void calc_diff(struct work *work, double known) } } -static void get_benchmark_work(struct work *work) -{ - // Use a random work block pulled from a pool - static uint8_t bench_block[] = { SGMINER_BENCHMARK_BLOCK }; - - size_t bench_size = sizeof(*work); - size_t work_size = sizeof(bench_block); - size_t min_size = (work_size < bench_size ? work_size : bench_size); - memset(work, 0, sizeof(*work)); - memcpy(work, &bench_block, min_size); - work->mandatory = true; - work->pool = pools[0]; - cgtime(&work->tv_getwork); - copy_time(&work->tv_getwork_reply, &work->tv_getwork); - work->getwork_mode = GETWORK_MODE_BENCHMARK; - calc_diff(work, 0); -} - #ifdef HAVE_CURSES static void disable_curses_windows(void) { @@ -3624,9 +3601,6 @@ static bool stale_work(struct work *work, bool share) struct pool *pool; int getwork_delay; - if (opt_benchmark) - return false; - if (work->work_block != work_block) { applog(LOG_DEBUG, "Work stale due to block mismatch"); return true; @@ -7057,33 +7031,6 @@ void reinit_device(struct cgpu_info *cgpu) static struct timeval rotate_tv; -/* We reap curls if they are unused for over a minute */ -static void reap_curl(struct pool *pool) -{ - struct curl_ent *ent, *iter; - struct timeval now; - int reaped = 0; - - cgtime(&now); - - mutex_lock(&pool->pool_lock); - list_for_each_entry_safe(ent, iter, &pool->curlring, node) { - if (pool->curls < 2) - break; - if (now.tv_sec - ent->tv.tv_sec > 300) { - reaped++; - pool->curls--; - list_del(&ent->node); - curl_easy_cleanup(ent->curl); - free(ent); - } - } - mutex_unlock(&pool->pool_lock); - - if (reaped) - applog(LOG_DEBUG, "Reaped %d curl%s from %s", reaped, reaped > 1 ? "s" : "", pool->name); -} - static void *watchpool_thread(void __maybe_unused *userdata) { int intervals = 0; @@ -7105,9 +7052,6 @@ static void *watchpool_thread(void __maybe_unused *userdata) for (i = 0; i < total_pools; i++) { struct pool *pool = pools[i]; - if (!opt_benchmark) - reap_curl(pool); - /* Get a rolling utility per pool over 10 mins */ if (intervals > 19) { int shares = pool->diff1 - pool->last_shares; @@ -8041,21 +7985,6 @@ int main(int argc, char *argv[]) if (!config_loaded) load_default_config(); - if (opt_benchmark) { - struct pool *pool; - - // FIXME: executes always (leftover from SHA256d days) - quit(1, "Cannot use benchmark mode with scrypt"); - pool = add_pool(); - pool->rpc_url = (char *)malloc(255); - strcpy(pool->rpc_url, "Benchmark"); - pool->rpc_user = pool->rpc_url; - pool->rpc_pass = pool->rpc_url; - enable_pool(pool); - pool->idle = false; - successful_connect = true; - } - #ifdef HAVE_CURSES if (opt_realquiet || opt_display_devs) use_curses = false; @@ -8233,9 +8162,6 @@ int main(int argc, char *argv[]) } } - if (opt_benchmark) - goto begin_bench; - /* Set pool state */ for (i = 0; i < total_pools; i++) { struct pool *pool = pools[i]; @@ -8297,7 +8223,6 @@ int main(int argc, char *argv[]) } } while (!pools_active); -begin_bench: total_mhashes_done = 0; for (i = 0; i < total_devices; i++) { struct cgpu_info *cgpu = devices[i]; @@ -8426,13 +8351,6 @@ retry: continue; } - if (opt_benchmark) { - get_benchmark_work(work); - applog(LOG_DEBUG, "Generated benchmark work"); - stage_work(work); - continue; - } - #ifdef HAVE_LIBCURL struct curl_ent *ce; diff --git a/miner.h b/miner.h index 7db088fd..f80269e7 100644 --- a/miner.h +++ b/miner.h @@ -1301,7 +1301,6 @@ struct pool { #define GETWORK_MODE_TESTPOOL 'T' #define GETWORK_MODE_POOL 'P' #define GETWORK_MODE_LP 'L' -#define GETWORK_MODE_BENCHMARK 'B' #define GETWORK_MODE_STRATUM 'S' #define GETWORK_MODE_GBT 'G' diff --git a/winbuild/sgminer.vcxproj b/winbuild/sgminer.vcxproj index 6aa2ec57..f7d2583b 100644 --- a/winbuild/sgminer.vcxproj +++ b/winbuild/sgminer.vcxproj @@ -272,7 +272,6 @@ exit 0 - diff --git a/winbuild/sgminer.vcxproj.filters b/winbuild/sgminer.vcxproj.filters index 4c69f63b..9f6999fa 100644 --- a/winbuild/sgminer.vcxproj.filters +++ b/winbuild/sgminer.vcxproj.filters @@ -106,9 +106,6 @@ Header Files - - Header Files - Header Files