Skip to content

refactor: remove dependencies of CChainState on CMasternodeSync#7212

Draft
knst wants to merge 7 commits intodashpay:developfrom
knst:kernel-zero-is-mn-sync
Draft

refactor: remove dependencies of CChainState on CMasternodeSync#7212
knst wants to merge 7 commits intodashpay:developfrom
knst:kernel-zero-is-mn-sync

Conversation

@knst
Copy link
Copy Markdown
Collaborator

@knst knst commented Mar 12, 2026

depends on #7178

Issue being fixed or feature implemented

The class CMasternodeSync is about network communication. It should not be a direct dependency of CChainState.

Most changes are split-off from #7178 to keep 7178 tidy.

What was done?

  • fixed Regression tests of miner to be compatible with Instant Send
  • Instant Send doesn't use CMasternodeSync status during the checks inside 'RejectConflictingBlocks` (split from 7178)
  • CMNPaymentsProcessor uses a new helper CGovernanceManager::IsValidAndSynced instead direct usages of CMasternodeSync

Usages of RejectConflictingBlocks are:

  • ChainLockSigner::TrySignChainTip. This IsBlockchainSynced still checked directly
  • Behavior of Miner BlockAssembler::TestPackageTransactions is changed now. But it should not affect anything beside regression tests, because blocks are not expected to be mined when sync is not done yet.
  • CChainState::ConnectBlock uses it indirectly over helper CChainstateHelper::ShouldInstantSendRejectConflicts

How Has This Been Tested?

Run unit & functional tests.

Breaking Changes

N/A

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • 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)

@github-actions
Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 12, 2026

⚠️ Potential Merge Conflicts Detected

This PR has potential conflicts with the following open PRs:

Please coordinate with the authors of these PRs to avoid merge conflicts.

@knst knst force-pushed the kernel-zero-is-mn-sync branch from f552476 to 24f2705 Compare April 2, 2026 08:31
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.

1 participant