-
Notifications
You must be signed in to change notification settings - Fork 95
[INVALID] Custom mining with verification. #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[INVALID] Custom mining with verification. #360
Conversation
static constexpr unsigned long long _invalidTaskIndex = 0xFFFFFFFFFFFFFFFFULL; | ||
void init() | ||
{ | ||
allocatePool(CUSTOM_MINING_TASK_STORAGE_COUNT * sizeof(CustomMiningTask), (void**)&_customMiningTasks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use allocPoolWithErrorLog
instead
_customMiningPhaseCount = 1; | ||
} | ||
|
||
void checkAndReset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a note here which process calling this
} | ||
|
||
// Binary search for taskIndex or closest greater-than task index | ||
unsigned long long searchTaskIndex(unsigned long long taskIndex, bool& exactMatch) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add unit tests for this function, we usually have hang/bug on binary search function before
static constexpr unsigned long long _invalidIndex = 0xFFFFFFFFFFFFFFFFULL; | ||
void init() | ||
{ | ||
allocatePool(maxItems * sizeof(DataType), (void**)&_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use allocPoolWithErrorLog
instead
struct RespondCustomMiningTask | ||
{ | ||
static constexpr int _maxNumberOfTasks = 4; | ||
static constexpr int _maxNumberSolutions = 64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any intention behind these numbers 4
and 64
?
@@ -2,7 +2,7 @@ | |||
|
|||
#include <lib/platform_efi/uefi.h> | |||
|
|||
static unsigned char consoleLoggingLevel = 1; | |||
static unsigned char consoleLoggingLevel = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this
@@ -4,7 +4,7 @@ | |||
|
|||
// Do NOT share the data of "Private Settings" section with anybody!!! | |||
|
|||
#define OPERATOR "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | |||
#define OPERATOR "YRZVDJHUSNYBQFIWUWCVSEQVBLWBIMNOUUVJKWXLSAAODNHMZYQASNWDMQNA" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this
const unsigned short computorID = request->nonce % NUMBER_OF_COMPUTORS; | ||
|
||
ACQUIRE(gCustomMiningSharesCountLock); | ||
gCustomMiningSharesCount[computorID]++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no verifier, the nodes consider all shares are valid by default. (need to re-think)
So when verifier tells node that nonce_X
isn't valid, we do gCustomMiningSharesCount[nonce_X % 676]--
. Otherwise, no action needed.
It would be nice to have a flag indicating if nonce_X
is verified or not
This PR contains,