Skip to content

Commit

Permalink
init: add flag to disable the DKG processes.
Browse files Browse the repository at this point in the history
Updating p2p_quorum_connect.py test with it

And move -pushversion to GetTierTwoHelpString as well.
  • Loading branch information
furszy committed Jan 19, 2022
1 parent 6035112 commit c445333
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,6 @@ std::string HelpMessage(HelpMessageMode mode)
AppendParamsHelpMessages(strUsage, showDebug);

strUsage += GetTierTwoHelpString(showDebug);
if (showDebug) {
strUsage += HelpMessageOpt("-pushversion",
strprintf("Modifies the mnauth serialization if the version is lower than %d."
"testnet/regtest only; ", MNAUTH_NODE_VER_VERSION));
}

strUsage += HelpMessageGroup("Node relay options:");
if (showDebug) {
Expand Down
20 changes: 17 additions & 3 deletions src/tiertwo/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ std::string GetTierTwoHelpString(bool showDebug)
strUsage += HelpMessageOpt("-masternodeaddr=<n>", strprintf("Set external address:port to get to this masternode (example: %s)", "128.127.106.235:51472"));
strUsage += HelpMessageOpt("-budgetvotemode=<mode>", "Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)");
strUsage += HelpMessageOpt("-mnoperatorprivatekey=<WIF>", "Set the masternode operator private key. Only valid with -masternode=1. When set, the masternode acts as a deterministic masternode.");
if (showDebug) {
strUsage += HelpMessageOpt("-pushversion", strprintf("Modifies the mnauth serialization if the version is lower than %d."
"testnet/regtest only; ", MNAUTH_NODE_VER_VERSION));
strUsage += HelpMessageOpt("-disabledkg", "Disable the DKG sessions process threads for the entire lifecycle. testnet/regtest only.");
}
return strUsage;
}

Expand Down Expand Up @@ -235,8 +240,17 @@ bool InitActiveMN()
void StartTierTwoThreadsAndScheduleJobs(boost::thread_group& threadGroup, CScheduler& scheduler)
{
threadGroup.create_thread(std::bind(&ThreadCheckMasternodes));
// start LLMQ system
llmq::StartLLMQSystem();

// Start LLMQ system
if (gArgs.GetBoolArg("-disabledkg", false)) {
if (Params().NetworkIDString() == CBaseChainParams::MAIN) {
throw std::runtime_error("DKG system can be disabled only on testnet/regtest");
} else {
LogPrintf("DKG system disabled.\n");
}
} else {
llmq::StartLLMQSystem();
}
}

void StopTierTwoThreads()
Expand All @@ -249,4 +263,4 @@ void DeleteTierTwo()
llmq::DestroyLLMQSystem();
deterministicMNManager.reset();
evoDb.reset();
}
}
2 changes: 1 addition & 1 deletion test/functional/p2p_quorum_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def set_test_params(self):
self.minerPos = 0
self.controllerPos = 1
self.setup_clean_chain = True
self.extra_args = [["-nuparams=v5_shield:1", "-nuparams=v6_evo:101"]] * self.num_nodes
self.extra_args = [["-nuparams=v5_shield:1", "-nuparams=v6_evo:101", "-disabledkg"]] * self.num_nodes
self.extra_args[0].append("-sporkkey=932HEevBSujW2ud7RfB1YF91AFygbBRQj3de3LyaCRqNzKKgWXi")

def add_new_dmn(self, mns, strType, op_keys=None, from_out=None):
Expand Down

0 comments on commit c445333

Please sign in to comment.