more randomx debug
This commit is contained in:
@@ -1119,7 +1119,7 @@ void static RandomXMiner()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
|
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
|
||||||
//fprintf(stderr,"Running HushMiner.%s with %u transactions in block\n",solver.c_str(),(int32_t)pblock->vtx.size());
|
fprintf(stderr,"Running HushRandomXMiner with %u transactions in block\n",(int32_t)pblock->vtx.size());
|
||||||
LogPrintf("Running HushRandomXMiner with %u transactions in block (%u bytes)\n",pblock->vtx.size(),::GetSerializeSize(*pblock,SER_NETWORK,PROTOCOL_VERSION));
|
LogPrintf("Running HushRandomXMiner with %u transactions in block (%u bytes)\n",pblock->vtx.size(),::GetSerializeSize(*pblock,SER_NETWORK,PROTOCOL_VERSION));
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
@@ -1143,9 +1143,11 @@ void static RandomXMiner()
|
|||||||
hashTarget = HASHTarget;
|
hashTarget = HASHTarget;
|
||||||
|
|
||||||
char randomxHash[RANDOMX_HASH_SIZE];
|
char randomxHash[RANDOMX_HASH_SIZE];
|
||||||
|
fprintf(stderr,"RandomXMiner: created randomxHash of size %d\n", RANDOMX_HASH_SIZE);
|
||||||
// Initial randomx key is chain magic || ac_name which is >= 2^40 bits of entropy assuming strlen(ac_name) >= 1
|
// Initial randomx key is chain magic || ac_name which is >= 2^40 bits of entropy assuming strlen(ac_name) >= 1
|
||||||
// For ac_name=DRAGONX we have 4 + 7 = 11 bytes or 2^88 bits of entropy
|
// For ac_name=DRAGONX we have 4 + 7 = 11 bytes or 2^88 bits of entropy
|
||||||
char randomxKey[4 + strlen(SMART_CHAIN_SYMBOL)];
|
char randomxKey[4 + strlen(SMART_CHAIN_SYMBOL)];
|
||||||
|
fprintf(stderr,"RandomXMiner: creating randomxKey of size %d\n", 4 + strlen(SMART_CHAIN_SYMBOL));
|
||||||
randomxKey[0] = ASSETCHAINS_MAGIC & 0xff;
|
randomxKey[0] = ASSETCHAINS_MAGIC & 0xff;
|
||||||
randomxKey[1] = (ASSETCHAINS_MAGIC >> 8) & 0xff;
|
randomxKey[1] = (ASSETCHAINS_MAGIC >> 8) & 0xff;
|
||||||
randomxKey[2] = (ASSETCHAINS_MAGIC >> 16) & 0xff;
|
randomxKey[2] = (ASSETCHAINS_MAGIC >> 16) & 0xff;
|
||||||
@@ -1154,6 +1156,7 @@ void static RandomXMiner()
|
|||||||
for(int i=0; i++; i<strlen(SMART_CHAIN_SYMBOL) ) {
|
for(int i=0; i++; i<strlen(SMART_CHAIN_SYMBOL) ) {
|
||||||
randomxKey[4+i] = SMART_CHAIN_SYMBOL[i];
|
randomxKey[4+i] = SMART_CHAIN_SYMBOL[i];
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"RandomXMiner: created randomxKey=%s\n", randomxKey);
|
||||||
|
|
||||||
crypto_generichash_blake2b_state state;
|
crypto_generichash_blake2b_state state;
|
||||||
// Hash = blake2b( key || ac_name)
|
// Hash = blake2b( key || ac_name)
|
||||||
@@ -1168,6 +1171,7 @@ void static RandomXMiner()
|
|||||||
LogPrintf("RandomX cache is null, something is wrong, cannot mine!\n");
|
LogPrintf("RandomX cache is null, something is wrong, cannot mine!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"RandomXMiner: created randomx flags + cache\n");
|
||||||
|
|
||||||
// The key block will change every ~21.3 hours with a 75s block time
|
// The key block will change every ~21.3 hours with a 75s block time
|
||||||
// and every ~17 hours with the default 60s block time for HSCs
|
// and every ~17 hours with the default 60s block time for HSCs
|
||||||
@@ -1177,7 +1181,7 @@ void static RandomXMiner()
|
|||||||
|
|
||||||
// Use the initial key at the start of the chain
|
// Use the initial key at the start of the chain
|
||||||
if( (Mining_height-randomxBlockLag) < randomxInterval) {
|
if( (Mining_height-randomxBlockLag) < randomxInterval) {
|
||||||
LogPrintf("RandomX using initial key\n");
|
fprintf(stderr,"RandomX using initial key with interval=%d and lag=%d\n", randomxInterval, randomxBlockLag);
|
||||||
randomx_init_cache(randomxCache, &randomxKey, sizeof randomxKey);
|
randomx_init_cache(randomxCache, &randomxKey, sizeof randomxKey);
|
||||||
} else {
|
} else {
|
||||||
// At heights between intervals, we use the same block key and wait randomxBlockLag blocks until changing
|
// At heights between intervals, we use the same block key and wait randomxBlockLag blocks until changing
|
||||||
|
|||||||
Reference in New Issue
Block a user