mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Fix LLMQ related test failures on Travis (#2666)
* Use fast_dip3_enforcement instead of fast_dip3_activation DashTestFramework was refactored before ChainLocks got merged, causing tests to fail now. * Move updating of DKG debug status into WaitForNextPhase Otherwise callers of the RPCs might believe that the next phase has already started and start producing more blocks, which would then cancel the current session if it happens faster than the phase handler thread can progress to the next phase.
This commit is contained in:
parent
6fe479aa12
commit
54f576ea7c
@ -17,7 +17,7 @@ Checks LLMQs based ChainLocks
|
||||
|
||||
class LLMQChainLocksTest(DashTestFramework):
|
||||
def __init__(self):
|
||||
super().__init__(11, 10, [], fast_dip3_activation=True)
|
||||
super().__init__(11, 10, [], fast_dip3_enforcement=True)
|
||||
|
||||
def run_test(self):
|
||||
|
||||
|
@ -123,9 +123,6 @@ void CDKGSessionHandler::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBl
|
||||
int phaseInt = quorumStageInt / params.dkgPhaseBlocks + 1;
|
||||
if (fNewPhase && phaseInt >= QuorumPhase_Initialized && phaseInt <= QuorumPhase_Idle) {
|
||||
phase = static_cast<QuorumPhase>(phaseInt);
|
||||
if (phase == QuorumPhase_Initialized) {
|
||||
quorumDKGDebugManager->ResetLocalSessionStatus(params.type, quorumHash, quorumHeight);
|
||||
}
|
||||
}
|
||||
|
||||
quorumDKGDebugManager->UpdateLocalStatus([&](CDKGDebugStatus& status) {
|
||||
@ -133,11 +130,6 @@ void CDKGSessionHandler::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBl
|
||||
status.nHeight = (uint32_t)pindexNew->nHeight;
|
||||
return changed;
|
||||
});
|
||||
quorumDKGDebugManager->UpdateLocalSessionStatus(params.type, [&](CDKGDebugSessionStatus& status) {
|
||||
bool changed = status.phase != (uint8_t)phase;
|
||||
status.phase = (uint8_t)phase;
|
||||
return changed;
|
||||
});
|
||||
}
|
||||
|
||||
void CDKGSessionHandler::ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman)
|
||||
@ -199,7 +191,7 @@ void CDKGSessionHandler::WaitForNextPhase(QuorumPhase curPhase,
|
||||
throw AbortPhaseException();
|
||||
}
|
||||
if (p.first == nextPhase) {
|
||||
return;
|
||||
break;
|
||||
}
|
||||
if (curPhase != QuorumPhase_None && p.first != curPhase) {
|
||||
throw AbortPhaseException();
|
||||
@ -208,6 +200,15 @@ void CDKGSessionHandler::WaitForNextPhase(QuorumPhase curPhase,
|
||||
MilliSleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
if (nextPhase == QuorumPhase_Initialized) {
|
||||
quorumDKGDebugManager->ResetLocalSessionStatus(params.type, quorumHash, quorumHeight);
|
||||
}
|
||||
quorumDKGDebugManager->UpdateLocalSessionStatus(params.type, [&](CDKGDebugSessionStatus& status) {
|
||||
bool changed = status.phase != (uint8_t)nextPhase;
|
||||
status.phase = (uint8_t)nextPhase;
|
||||
return changed;
|
||||
});
|
||||
}
|
||||
|
||||
void CDKGSessionHandler::WaitForNewQuorum(const uint256& oldQuorumHash)
|
||||
|
Loading…
Reference in New Issue
Block a user