Skip to content

quorum dkginfo: active_dkgs is 0 for a running DKG session once the masternode manager has no proTxHash #8091

Open

Description

@shumkov

Problem

quorum dkginfo reports active_dkgs: 0 and no upcoming_dkgs while this masternode still takes part in a running DKG session, whenever the active masternode manager has no proTxHash.

#7812 derives active_dkgs from membership, but only for a supplied or local proTxHash (src/rpc/quorums.cpp, if (!proTxHash.IsNull())). The local proTxHash can be cleared in the middle of a session:

  • CActiveMasternodeManager::UpdatedBlockTip (src/active/masternode.cpp) calls reset(...) when the masternode's operator key or primary service address changes, for example after a ProUpServTx or ProUpRegTx is mined. That clears m_protx_hash.
  • InitInternal only sets it again if it can match the node's local address. A node whose new address is not yet reachable stays at PROTX_IP_CHANGED/SOME_ERROR with a null proTxHash.
  • A DKG session that is already running keeps its own myProTxHash (src/active/dkgsession.cpp). It goes on sending contributions, complaints, justifications and premature commitments, so stopping the node then still makes it a bad member.

So "is this masternode in a DKG right now?" gets the answer "no" from quorum dkginfo exactly when an operator has just changed the service address and is most likely to restart the node.

Impact

Tools that decide when a masternode can restart without a PoSe penalty cannot rely on active_dkgs alone. Dashmate's DKG-safe stop (dashpay/platform#5841) therefore also reads quorum dkgstatus session records on Core 24.1+, and blocks on any record still inside its Commit-phase window. That works, but only because debug records happen to outlive the reset. A restarted Core loses them, and they are not an API contract.

Suggested fix

Count sessions the DKG workers are running for this node in active_dkgs, from each session handler's current session with a non-null myProTxHash through its Commit phase, whether or not the active manager currently has a proTxHash. Alternatively, report those sessions in a separate field.

A functional test: mine a ProUpServTx for a quorum member between its Contribute and Commit phases, then assert quorum dkginfo still counts the session until quorumHeight + 5 * dkgPhaseBlocks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions