Rebrand hush3 to DragonX and share RandomX dataset across mining threads
Minimal rebrand (see compliant-rebrand branch for full rebrand): - Rename binaries: hushd/hush-cli/hush-tx → dragonxd/dragonx-cli/dragonx-tx - Default to DRAGONX chain params without -ac_* flags (randomx, blocktime=36, private=1) - Update configure.ac: AC_INIT([DragonX],[1.0.0]) - Update client version string and user-agent to /DragonX:1.0.0/ - Add chainparams.cpp with DRAGONX network parameters - Update build.sh, miner.cpp, pow.cpp for DragonX - Add bootstrap-dragonx.sh utility script - Update .gitignore for release directory Share single RandomX dataset across all mining threads: - Add RandomXDatasetManager with readers-writer lock, reducing RAM from ~2GB per thread to ~2GB total plus ~2MB per thread for the VM scratchpad - Add LogProcessMemory() diagnostic helper for Linux and Windows
This commit is contained in:
+35
-62
@@ -1413,20 +1413,20 @@ void hush_configfile(char *symbol,uint16_t rpcport)
|
||||
#ifdef _WIN32
|
||||
while ( fname[strlen(fname)-1] != '\\' )
|
||||
fname[strlen(fname)-1] = 0;
|
||||
strcat(fname,"HUSH3.conf");
|
||||
strcat(fname,"DRAGONX.conf");
|
||||
#else
|
||||
while ( fname[strlen(fname)-1] != '/' )
|
||||
fname[strlen(fname)-1] = 0;
|
||||
#ifdef __APPLE__
|
||||
strcat(fname,"HUSH3.conf");
|
||||
strcat(fname,"DRAGONX.conf");
|
||||
#else
|
||||
strcat(fname,"HUSH3.conf");
|
||||
strcat(fname,"DRAGONX.conf");
|
||||
#endif
|
||||
#endif
|
||||
if ( (fp= fopen(fname,"rb")) != 0 )
|
||||
{
|
||||
if ( (hushport= _hush_userpass(username,password,fp)) != 0 )
|
||||
HUSH3_PORT = hushport;
|
||||
DRAGONX_PORT = hushport;
|
||||
sprintf(HUSHUSERPASS,"%s:%s",username,password);
|
||||
fclose(fp);
|
||||
//printf("HUSH.(%s) -> userpass.(%s)\n",fname,HUSHUSERPASS);
|
||||
@@ -1790,38 +1790,28 @@ void hush_args(char *argv0)
|
||||
}
|
||||
|
||||
|
||||
name = GetArg("-ac_name","HUSH3");
|
||||
name = GetArg("-ac_name","DRAGONX");
|
||||
fprintf(stderr,".oO Starting %s Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",name.c_str(),HUSH_MININGTHREADS, IS_HUSH_NOTARY);
|
||||
|
||||
vector<string> HUSH_nodes = {};
|
||||
// Only HUSH3 uses these by default, other HACs must opt-in via -connect/-addnode
|
||||
const bool ishush3 = strncmp(name.c_str(), "HUSH3",5) == 0 ? true : false;
|
||||
vector<string> DRAGONX_nodes = {};
|
||||
// Only DRAGONX connects to these by default, other chains must opt-in via -connect/-addnode
|
||||
const bool isdragonx = strncmp(name.c_str(), "DRAGONX",7) == 0 ? true : false;
|
||||
|
||||
LogPrint("net", "%s: ishush3=%d\n", __func__, ishush3);
|
||||
if (ishush3) {
|
||||
HUSH_nodes = {"node1.hush.is","node2.hush.is","node3.hush.is",
|
||||
"node4.hush.is","node5.hush.is","node6.hush.is",
|
||||
"node7.hush.is","node8.hush.is",
|
||||
"178.250.189.141",
|
||||
"31.202.19.157",
|
||||
"45.132.75.69",
|
||||
"45.63.58.167",
|
||||
"b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion",
|
||||
"dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion",
|
||||
"vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion",
|
||||
"plrobkepqjxs2cmig273mxnqh3qhuhdaioyb2n5kafn264ramb7tqxid.onion"
|
||||
LogPrint("net", "%s: isdragonx=%d\n", __func__, isdragonx);
|
||||
if (isdragonx) {
|
||||
DRAGONX_nodes = {"node1.dragonx.is","node2.dragonx.is","node3.dragonx.is",
|
||||
"node4.dragonx.is","node5.dragonx.is"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
vector<string> more_nodes = mapMultiArgs["-addnode"];
|
||||
if (more_nodes.size() > 0) {
|
||||
fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() );
|
||||
}
|
||||
// Add default HUSH nodes after custom addnodes, if applicable
|
||||
if(HUSH_nodes.size() > 0) {
|
||||
LogPrint("net", "%s: adding %d HUSH3 hostname-based nodes\n", __func__, HUSH_nodes.size() );
|
||||
more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() );
|
||||
// Add default DRAGONX nodes after custom addnodes, if applicable
|
||||
if(DRAGONX_nodes.size() > 0) {
|
||||
LogPrint("net", "%s: adding %d DRAGONX hostname-based nodes\n", __func__, DRAGONX_nodes.size() );
|
||||
more_nodes.insert( more_nodes.end(), DRAGONX_nodes.begin(), DRAGONX_nodes.end() );
|
||||
}
|
||||
|
||||
mapMultiArgs["-addnode"] = more_nodes;
|
||||
@@ -1830,10 +1820,15 @@ void hush_args(char *argv0)
|
||||
WITNESS_CACHE_SIZE = MAX_REORG_LENGTH+10;
|
||||
ASSETCHAINS_CC = GetArg("-ac_cc",0);
|
||||
HUSH_CCACTIVATE = GetArg("-ac_ccactivate",0);
|
||||
ASSETCHAINS_BLOCKTIME = GetArg("-ac_blocktime",60);
|
||||
// We do not support ac_public=1 chains, Hush is a platform for privacy
|
||||
|
||||
// Set defaults based on chain
|
||||
int default_blocktime = isdragonx ? 36 : 60;
|
||||
int default_private = isdragonx ? 1 : 0;
|
||||
|
||||
ASSETCHAINS_BLOCKTIME = GetArg("-ac_blocktime", default_blocktime);
|
||||
// We do not support ac_public=1 chains, DragonX is a platform for privacy
|
||||
ASSETCHAINS_PUBLIC = 0;
|
||||
ASSETCHAINS_PRIVATE = GetArg("-ac_private",0);
|
||||
ASSETCHAINS_PRIVATE = GetArg("-ac_private", default_private);
|
||||
HUSH_SNAPSHOT_INTERVAL = GetArg("-ac_snapshot",0);
|
||||
Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0);
|
||||
|
||||
@@ -1871,7 +1866,9 @@ void hush_args(char *argv0)
|
||||
ASSETCHAINS_EARLYTXIDCONTRACT = GetArg("-ac_earlytxidcontract",0);
|
||||
if ( name.c_str()[0] != 0 )
|
||||
{
|
||||
std::string selectedAlgo = GetArg("-ac_algo", std::string(ASSETCHAINS_ALGORITHMS[0]));
|
||||
// Default algo is randomx for DRAGONX, equihash for others
|
||||
std::string default_algo = isdragonx ? "randomx" : std::string(ASSETCHAINS_ALGORITHMS[0]);
|
||||
std::string selectedAlgo = GetArg("-ac_algo", default_algo);
|
||||
|
||||
for ( int i = 0; i < ASSETCHAINS_NUMALGOS; i++ )
|
||||
{
|
||||
@@ -1900,7 +1897,6 @@ void hush_args(char *argv0)
|
||||
|
||||
// Set our symbol from -ac_name value
|
||||
strncpy(SMART_CHAIN_SYMBOL,name.c_str(),sizeof(SMART_CHAIN_SYMBOL)-1);
|
||||
const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
|
||||
// Set RandomX validation activation height per chain
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_RANDOMX) {
|
||||
@@ -1915,9 +1911,6 @@ void hush_args(char *argv0)
|
||||
}
|
||||
|
||||
ASSETCHAINS_LASTERA = GetArg("-ac_eras", 1);
|
||||
if(ishush3) {
|
||||
ASSETCHAINS_LASTERA = 3;
|
||||
}
|
||||
if ( ASSETCHAINS_LASTERA < 1 || ASSETCHAINS_LASTERA > ASSETCHAINS_MAX_ERAS )
|
||||
{
|
||||
ASSETCHAINS_LASTERA = 1;
|
||||
@@ -1951,33 +1944,13 @@ void hush_args(char *argv0)
|
||||
ASSETCHAINS_SCRIPTPUB = GetArg("-ac_script","");
|
||||
|
||||
|
||||
fprintf(stderr,"%s: Setting custom %s reward HUSH3=%d reward,halving,subsidy chain values...\n",__func__, SMART_CHAIN_SYMBOL, ishush3);
|
||||
if(ishush3) {
|
||||
// Migrated from hushd script
|
||||
ASSETCHAINS_CC = 2;
|
||||
ASSETCHAINS_BLOCKTIME = 150; // this will change to 75 at the correct block
|
||||
ASSETCHAINS_COMMISSION = 11111111;
|
||||
// 6250000 - (Sprout pool at block 500,000)
|
||||
ASSETCHAINS_SUPPLY = 6178674;
|
||||
ASSETCHAINS_FOUNDERS = 1;
|
||||
fprintf(stderr,"%s: Setting custom %s reward isdragonx=%d reward,halving,subsidy chain values...\n",__func__, SMART_CHAIN_SYMBOL, isdragonx);
|
||||
if(isdragonx) {
|
||||
// DragonX chain parameters (previously set via wrapper script)
|
||||
// -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1
|
||||
ASSETCHAINS_SAPLING = 1;
|
||||
// this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn
|
||||
ASSETCHAINS_SCRIPTPUB = "76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac";
|
||||
// we do not want to change the magic of HUSH3 mainnet so we do not call devtax_scriptpub_for_height() here,
|
||||
// instead we call it whenever ASSETCHAINS_SCRIPTPUB is used later on
|
||||
|
||||
// Over-ride HUSH3 values from CLI params. Changing our blocktime to 75s changes things
|
||||
ASSETCHAINS_REWARD[0] = 0;
|
||||
ASSETCHAINS_REWARD[1] = 1125000000;
|
||||
ASSETCHAINS_REWARD[2] = 281250000; // 2.8125 HUSH goes to miners per block after 1st halving at Block 340K
|
||||
ASSETCHAINS_REWARD[3] = 140625000; // 1.40625 HUSH after 2nd halving at Block 2020000
|
||||
ASSETCHAINS_HALVING[0] = 129;
|
||||
ASSETCHAINS_HALVING[1] = GetArg("-z2zheight",340000);
|
||||
ASSETCHAINS_HALVING[2] = 2020000; // 2020000 = 340000 + 1680000 (1st halving block plus new halving interval)
|
||||
ASSETCHAINS_HALVING[3] = 3700000; // ASSETCHAINS_HALVING[2] + 1680000;
|
||||
ASSETCHAINS_ENDSUBSIDY[0] = 129;
|
||||
ASSETCHAINS_ENDSUBSIDY[1] = GetArg("-z2zheight",340000);
|
||||
ASSETCHAINS_ENDSUBSIDY[2] = 2*5422111; // TODO: Fix this, twice the previous end of rewards is an estimate
|
||||
ASSETCHAINS_REWARD[0] = 300000000; // 3 DRAGONX per block
|
||||
ASSETCHAINS_HALVING[0] = 3500000; // halving every 3.5M blocks
|
||||
}
|
||||
Split(GetArg("-ac_decay",""), sizeof(ASSETCHAINS_DECAY)/sizeof(*ASSETCHAINS_DECAY), ASSETCHAINS_DECAY, 0);
|
||||
Split(GetArg("-ac_notarypay",""), sizeof(ASSETCHAINS_NOTARY_PAY)/sizeof(*ASSETCHAINS_NOTARY_PAY), ASSETCHAINS_NOTARY_PAY, 0);
|
||||
@@ -2492,11 +2465,11 @@ void hush_args(char *argv0)
|
||||
void hush_nameset(char *symbol,char *dest,char *source)
|
||||
{
|
||||
if ( source[0] == 0 ) {
|
||||
strcpy(symbol,(char *)"HUSH3");
|
||||
strcpy(symbol,(char *)"DRAGONX");
|
||||
strcpy(dest,(char *)"BTC");
|
||||
} else {
|
||||
strcpy(symbol,source);
|
||||
strcpy(dest,(char *)"HUSH3");
|
||||
strcpy(dest,(char *)"DRAGONX");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user