//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));
// Search
@ -1143,9 +1143,11 @@ void static RandomXMiner()
hashTarget=HASHTarget;
charrandomxHash[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
// For ac_name=DRAGONX we have 4 + 7 = 11 bytes or 2^88 bits of entropy
charrandomxKey[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[1]=(ASSETCHAINS_MAGIC>>8)&0xff;
randomxKey[2]=(ASSETCHAINS_MAGIC>>16)&0xff;
@ -1154,6 +1156,7 @@ void static RandomXMiner()
for(inti=0;i++;i<strlen(SMART_CHAIN_SYMBOL)){
randomxKey[4+i]=SMART_CHAIN_SYMBOL[i];
}
fprintf(stderr,"RandomXMiner: created randomxKey=%s\n",randomxKey);
crypto_generichash_blake2b_statestate;
// Hash = blake2b( key || ac_name)
@ -1168,6 +1171,7 @@ void static RandomXMiner()
LogPrintf("RandomX cache is null, something is wrong, cannot mine!\n");
return;
}
fprintf(stderr,"RandomXMiner: created randomx flags + cache\n");
// 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