Skip to content

Same-block ProUpServTx signed by a rotated-out operator can revive a masternode #7582

Closed

Description

@PastaPastaPasta

Description

RebuildListFromBlock's revive check in the TRANSACTION_PROVIDER_UPDATE_SERVICE branch only verifies that the operator/voting/owner keys are non-null before calling Revive():

if (newState->IsBanned()) {
    if (newState->pubKeyOperator != CBLSLazyPublicKey() && !newState->keyIDVoting.IsNull() &&
        !newState->keyIDOwner.IsNull()) {
        newState->Revive(nHeight);
        ...

(src/evo/specialtxman.cpp; this exact pattern is on develop today, e.g. develop:src/evo/specialtxman.cpp around line 487.)

CheckProUpServTx verifies a ProUpServTx's signature against dmnman.GetListForBlock(pindexPrev)'s current operator key at admission time — not against the evolving in-block state that RebuildListFromBlock builds up as it processes earlier transactions in the same block.

Failure scenario

  1. A masternode's current operator key is X.
  2. A ProUpServTx signed with key X is broadcast and sits in the mempool (or is otherwise available), valid at that point.
  3. Before it confirms, the owner (via ProUpRegTx) rotates the operator key to Y. CheckProUpRegTx and CheckProUpServTx are each validated independently against pindexPrev, so both can pass individually even though they conflict.
  4. If a block includes the ProUpRegTx (rotating to Y, which resets operator fields and PoSe-bans the masternode) before the old ProUpServTx (still signed by X) in transaction order, RebuildListFromBlock processes the registrar update first (banning the MN, installing key Y), then processes the service update. The service-update branch does not re-verify the signature against the now-current key Y — it just applies the payload's fields (netInfo, scriptOperatorPayout, etc.) to the evolving state and, since pubKeyOperator (Y), keyIDVoting, and keyIDOwner are all non-null, immediately revives the masternode.

Net effect: an operator that has just been displaced by an owner-initiated key rotation can, via a service-update transaction it already had signed under the old key, restore its own scriptOperatorPayout/service fields and immediately un-ban the masternode in the same block — even though it no longer controls the operator key going forward.

Scope note

This affects ordinary (non-shared) masternodes on develop today. It is not introduced by, or specific to, the Decentralized Masternode Shares DIP (#7437) — that PR's ProUpSharedRegTx path deliberately mirrors this same established ProUpRegTx pattern, and inherits the same characteristic. Found via automated review of #7437; verified against develop by direct comparison of RebuildListFromBlock.

Possible fixes (not evaluated in depth)

  • Re-verify a ProUpServTx's signature against the evolving operator key in RebuildListFromBlock, not just at admission time against pindexPrev.
  • Or: reject the combination in-block if the operator key differs between the transaction's signature and the state at the point it's applied.
  • Or: keep the current per-transaction validation model, but explicitly document this as an accepted trust boundary (i.e., an operator key rotation is not "immediately hard" against the previous operator's already-signed-but-not-yet-broadcast transactions within the same block) if that's judged acceptable.

Activity

  1. PastaPastaPasta commented on Aug 12, 2026

    @PastaPastaPasta
    MemberAuthor

    Same class of gap also applies to ProUpRevTx: CheckProUpRevTx verifies its signature against dmnman.GetListForBlock(pindexPrev)'s operator key (identical pattern to CheckProUpServTx), and RebuildListFromBlock's UPDATE_REVOKE branch never re-verifies it either. So a same-block ProUpRegTx operator rotation followed by an old-key-signed ProUpRevTx lets a displaced operator revoke/ban the masternode immediately after being rotated out, mirroring the revive-via-ProUpServTx scenario above. Confirmed identical on develop. Surfaced by review on #7437.


    🤖 Posted autonomously by Claude on behalf of pasta.

  2. added a commit that references this issue on Oct 15, 2026
    cd7520e
  3. added 2 commits that reference this issue on Oct 16, 2026
    b6e2ea4
    8efdf5e
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