Skip to content

Fix ProUpServTx platformNodeID mempool conflict comparing txid to ProTx hash #7381

Open

Description

@thepastaclaw

Context

Found while cleaning up CodeRabbit follow-up commits from #7379. The backmerge PR should stay as a pure merge from master into develop, so this needs to be handled separately on develop if confirmed.

Problem

At #7379's merge-back commit (22a3321aab8d41e2b0be913fdb55345cec62e12d), CTxMemPool::mapProTxPlatformNodeIDs stores a single uint256 value for a platform node ID.

For ProRegTx, that value is the ProTx hash because the transaction hash is the provider hash.

For ProUpServTx, addUnchecked() stores the update-service transaction hash:

mapProTxPlatformNodeIDs.emplace(proTx.platformNodeID, tx_hash);

But existsProviderTxConflict() later compares that stored value against the owning masternode's proTxHash:

if (it != mapProTxPlatformNodeIDs.end() && it->second != opt_proTx->proTxHash) {
    return true;
}

For update-service transactions, the mempool txid and owner proTxHash are different identifiers. That means a second pending ProUpServTx for the same masternode can be rejected as protx-dup when it keeps the same platformNodeID, even though it belongs to the same provider.

The removal path still needs the mempool transaction hash:

uint256 conflictHash = mapProTxPlatformNodeIDs[platformNodeID];

So the map likely needs to track both the conflicting mempool txid and the owning ProTx hash, or use another structure that preserves both lookups.

Scope

Please fix this as a normal develop follow-up, not as part of #7379's release-branch merge-back.

Activity

  1. changed the title [-]fix: ProUpServTx platformNodeID mempool conflict compares txid to ProTx hash[/-] [+]Investigate ProUpServTx platformNodeID mempool conflict comparing txid to ProTx hash[/+] on Jun 26, 2026
  2. thepastaclaw commented on Jun 26, 2026

    @thepastaclaw
    CollaboratorAuthor

    Validation note after a second source pass:

    I have confirmed the source-level mismatch, but I have not yet run a reproducing functional/unit test.

    The precise case is narrower than "any second ProUpServTx". mapProTxAddresses has a similar txid-vs-ProTx comparison, so a second pending update that keeps the same netInfo would likely already be rejected by the address path. The platformNodeID-specific concern is a same-provider second pending ProUpServTx that changes netInfo enough to avoid mapProTxAddresses, but keeps the same platformNodeID.

    Source path at #7379's pure merge-back commit (22a3321...):

    • addUncheckedProTx() stores mapProTxPlatformNodeIDs[platformNodeID] = tx_hash for ProUpServTx.
    • existsProviderTxConflict() checks it->second != opt_proTx->proTxHash for a ProUpServTx using that platformNodeID.
    • There is no broad mapProTxRefs rejection for all same-provider service updates; mapProTxRefs is used for collateral/key-change conflict paths.
    • removeProTxConflicts() needs the mempool txid for recursive removal, so a correct fix probably has to preserve both identifiers rather than simply changing the map value.

    So this should be treated as an investigate/fix follow-up with a regression test, not as something already runtime-proven.

  3. changed the title [-]Investigate ProUpServTx platformNodeID mempool conflict comparing txid to ProTx hash[/-] [+]Fix ProUpServTx platformNodeID mempool conflict comparing txid to ProTx hash[/+] on Jun 26, 2026
  4. thepastaclaw commented on Jun 26, 2026

    @thepastaclaw
    CollaboratorAuthor

    Runtime validation update: reproduced on #7379's pure merge-back commit 22a3321aab8d41e2b0be913fdb55345cec62e12d.

    I added a local-only regression assertion to test/functional/rpc_netinfo.py::test_uniqueness that:

    • submits a ProUpServTx for one Evo provider with a fresh platformNodeID and changed service addresses;
    • leaves that update in mempool;
    • builds a second ProUpServTx for the same provider with different service addresses but the same platformNodeID;
    • checks testmempoolaccept for the second update.

    Expected: allowed, because it is the same provider reusing its own platform node ID.
    Actual: rejected as protx-dup.

    Command run:

    python3 test/functional/rpc_netinfo.py --tmpdir=/tmp/dash-rpc-netinfo-7381 --nocleanup --timeout-factor=2
    

    Failure:

    AssertionError: {'txid': '5849bdef5b37c94e1c30810ab2f63b19ff7938d78c22c2c17ea3b25a672a362d', 'allowed': False, 'reject-reason': 'protx-dup'}
    

    So this is now runtime-confirmed, not just source-inspection.

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