Skip to content

fix(drive-abci): switching a masternode back to a previous voting address re-enables the wrong voter identity's key #5566

Closed

Description

@shumkov

Problem

When a masternode's voting address changes back to an address it used before, update_voter_identity_v0:

  1. disables every key of the current voter identity (DisableIdentityKeys on old_voter_identifier);
  2. finds that the voter identity for the new address already exists;
  3. pushes ReEnableIdentityKeys { identity_id: old_voter_identifier, keys_ids: new_voter_identity_key_ids }.

Step 3 re-enables keys on the identity it has just disabled, using the key IDs of the returning identity, instead of re-enabling the returning identity's key. The returning voter identity's key stays disabled, so the masternode's current voting key should no longer be able to sign votes. The re-enabled key of the address it left cannot vote for this masternode either, because a vote must be signed by a key whose hash is the masternode's current voting address. The masternode loses its vote until it moves to an address it has never used.

Pre-existing; the same at every protocol version. Not yet reproduced in a test.

Where

packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/update_voter_identity/v0/mod.rs, the branch that handles an already existing voter identity.

Suggested fix

Add an update_voter_identity v1, selected from protocol version 15, that re-enables the keys on new_voter_identity.id(). Keep v0 unchanged so earlier blocks replay the same. Test: voting address A → B → A, then a vote signed with A's key is accepted and the identity for B keeps its key disabled.

Source: found while reviewing masternode identity updates during the 5.0 release-candidate work.

Activity

  1. added this to the v5.1.0 milestone on Oct 24, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions