Skip to content

Commit

Permalink
okay, now how is this commit at preventing duplicate shares? I try to…
Browse files Browse the repository at this point in the history
… prevent the overflow of pdata[19] so the if (work.data[19] >= end_nonce) in the miner thread can detect that we've reached the end of the search space.
  • Loading branch information
cbuchner1 committed Feb 9, 2014
1 parent 5cba5b3 commit ef265aa
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
11 changes: 7 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

CudaMiner release February 6th 2014 - MaxCoin release
---------------------------------------------------
CudaMiner release February 9th 2014 - MaxCoin release #3
--------------------------------------------------------

***************************************************************
If you find this tool useful and like to support its continued
Expand Down Expand Up @@ -310,8 +310,8 @@ Compute 3.5 devices. Best to try. Launch configs should look somewhat like this
-l K1000x32 << fastest on my GTX 780
-l T1000x24

Best to replace the 1000 blocks with a large multiple of your card's
multiprocessor count. At least a few hundred, but probably less than 3000.
Best to replace the 1000 blocks with the number of your card's CUDA
cores, or even twice that value. It seems fastest that way,

Pick a pool or solo-mine. Good luck!

Expand Down Expand Up @@ -367,6 +367,9 @@ best to re-tune your kernel configuration after every N-factor change.

>>> RELEASE HISTORY <<<

The February 9th release adds performance improvements and a fix
for stratum rejects in maxcoin (duplicate submitted shares).

The February 7th release adds fixes for stratum pool mining.

The February 6th release added a first, but working keccak algorithm
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([cudaminer], [2014.02.07])
AC_INIT([cudaminer], [2014.02.09])

AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM
Expand Down
2 changes: 1 addition & 1 deletion cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ char *device_config[8] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
char *device_name[8] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};

#define PROGRAM_NAME "cudaminer"
#define PROGRAM_VERSION "2014-02-07"
#define PROGRAM_VERSION "2014-02-09"
#define DEF_RPC_URL "http://127.0.0.1:9332/"
#define LP_SCANTIME 60

Expand Down
4 changes: 2 additions & 2 deletions cpuminer-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
#define PACKAGE_NAME "cudaminer"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "cudaminer 2014.02.07"
#define PACKAGE_STRING "cudaminer 2014.02.09"

/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
Expand All @@ -161,7 +161,7 @@
#undef PACKAGE_URL

/* Define to the version of this package. */
#define PACKAGE_VERSION "2014.02.07"
#define PACKAGE_VERSION "2014.02.09"

/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
Expand Down
10 changes: 6 additions & 4 deletions maxcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ int scanhash_keccak(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
gettimeofday(tv_start, NULL);

uint32_t n = pdata[19] - 1;
const uint32_t first_nonce = pdata[19];

// TESTING ONLY
// ((uint32_t*)ptarget)[7] = 0x0000000f;
Expand Down Expand Up @@ -75,7 +74,7 @@ int scanhash_keccak(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
crypto_hash( (unsigned char*)hash64, (unsigned char*)&endiandata[0], 80 );
if (result >= nonce[cur] && result < nonce[cur]+throughput && hash64[7] <= Htarg && fulltest(hash64, ptarget)) {
pdata[19] = result;
*hashes_done = n-throughput - first_nonce + 1;
*hashes_done = n-throughput - pdata[19] + 1;
gettimeofday(tv_end, NULL);
return true;
} else {
Expand All @@ -86,8 +85,11 @@ int scanhash_keccak(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
nxt = (nxt + 1) % 2;
} while ((n-throughput) < max_nonce && !work_restart[thr_id].restart);

*hashes_done = n-throughput - first_nonce + 1;
pdata[19] = n-throughput;
*hashes_done = n-throughput - pdata[19] + 1;
if (n-throughput > pdata[19])
pdata[19] = min(max_nonce, n-throughput); // CB: don't report values bigger max_nonce
else
pdata[19] = 0xffffffffU; // CB: prevent nonce space overflow.
gettimeofday(tv_end, NULL);
return 0;
}

0 comments on commit ef265aa

Please sign in to comment.