Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CheckQuorumConnections should not be running on regular non-watching nodes #5738

Closed
wants to merge 1 commit into from

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Nov 27, 2023

Issue being fixed or feature implemented

No need to waste CPU on regular non-watching nodes

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@UdjinM6 UdjinM6 added this to the 20.1 milestone Nov 27, 2023
@UdjinM6 UdjinM6 changed the title fix: move CheckQuorumConnections to a separate thread, run it only when it's needed fix: CheckQuorumConnections should not be running on regular non-watching nodes Nov 28, 2023
@UdjinM6 UdjinM6 marked this pull request as ready for review November 28, 2023 00:54
@@ -301,6 +301,10 @@ void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fInitial

void CQuorumManager::CheckQuorumConnections(const Consensus::LLMQParams& llmqParams, const CBlockIndex* pindexNew) const
{
if (!fMasternodeMode && !utils::IsWatchQuorumsEnabled()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not it be CQuorumManager::UpdatedBlockTip instead?

 void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fInitialDownload) const
+    if (!fMasternodeMode && !utils::IsWatchQuorumsEnabled()) return;
     if (!m_mn_sync->IsBlockchainSynced()) {
         return;
     }

mapQuorumData seems used only for MNs; CleanupOldQuorumData and TriggerQuorumDataRecoveryThreads both check flags fMasternodeMode too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! 👍 There are indeed more related things to fix. I opened #5745 to address them all.

@UdjinM6 UdjinM6 removed this from the 20.1 milestone Nov 29, 2023
@UdjinM6
Copy link
Author

UdjinM6 commented Nov 29, 2023

superseded by #5745

@UdjinM6 UdjinM6 closed this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants