feat(llmq): avoid probing mns too often instead of using a tiny window to probe them (#4904)

We only call AddQuorumProbeConnections when a new quorum is intialized. It's possible to miss the 10 minute probe window if Contribute phase takes too long (when 2 blocks were mined in 10+ minutes). 50 minutes should be enough and probing once in 10 minutes should be safe.
This commit is contained in:
UdjinM6 2022-07-07 00:24:34 +03:00
parent a999023cbd
commit 268b8e97d3
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9

View File

@ -757,11 +757,11 @@ void CLLMQUtils::AddQuorumProbeConnections(const Consensus::LLMQParams& llmqPara
continue; continue;
} }
auto lastOutbound = mmetaman.GetMetaInfo(dmn->proTxHash)->GetLastOutboundSuccess(); auto lastOutbound = mmetaman.GetMetaInfo(dmn->proTxHash)->GetLastOutboundSuccess();
// re-probe after 50 minutes so that the "good connection" check in the DKG doesn't fail just because we're on if (curTime - lastOutbound < 10 * 60) {
// the brink of timeout // avoid re-probing nodes too often
if (curTime - lastOutbound > 50 * 60) { continue;
probeConnections.emplace(dmn->proTxHash);
} }
probeConnections.emplace(dmn->proTxHash);
} }
if (!probeConnections.empty()) { if (!probeConnections.empty()) {