Skip to content

docs: clarify ProTx platform address RPC help#7375

Draft
thepastaclaw wants to merge 1 commit into
dashpay:developfrom
thepastaclaw:fix-protx-netinfo-help
Draft

docs: clarify ProTx platform address RPC help#7375
thepastaclaw wants to merge 1 commit into
dashpay:developfrom
thepastaclaw:fix-protx-netinfo-help

Conversation

@thepastaclaw

Copy link
Copy Markdown

Issue being fixed or feature implemented

Fixes #7370.

protx register_evo and protx update_service_evo accepted two different platform address formats depending on the ProTx net-info version, but the RPC help only described the Extended-address array form. When a legacy MnNetInfo / version-2 ProTx rejected "ADDR:PORT" or array input for platformP2PAddrs / platformHTTPSAddrs, the error only said the version supported ports, without showing the expected shape.

What was done?

  • Clarified the shared RPC help for coreP2PAddrs, platformP2PAddrs, platformHTTPSAddrs, and update variants to explain legacy MnNetInfo/version-2 bare-port input versus Extended addresses (ExtNetInfo) "ADDR:PORT" array input.
  • Reworded the legacy platform-field rejection to explicitly say the current ProTx version expects a bare port number and that address arrays require an Extended-addresses ProTx.
  • Used field-appropriate examples in the error text: 26656 for Platform P2P and 443 for Platform HTTPS.
  • Updated rpc_netinfo.py expectations so the clearer messages are covered, including the HTTPS example-port case caught during review.

How Has This Been Tested?

Tested on macOS arm64 in the fix-protx-netinfo-help worktree.

  • make -j8 src/dashd
  • test/functional/rpc_netinfo.py
  • code-review dashpay/dash upstream/develop fix-protx-netinfo-help "Fix issue #7370 by clarifying protx register/update platform address help and legacy v2 error messages" → ship

Breaking Changes

None. This changes RPC help/error text and matching functional-test expectations only; parsing behavior is unchanged.

Checklist:

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

The RPC help for `protx register_evo` / `update_service_evo` (and the
register_fund_evo / register_prepare_evo variants) documented
`coreP2PAddrs`, `platformP2PAddrs`, and `platformHTTPSAddrs` only as
`["ADDR:PORT"]` arrays, but a legacy MnNetInfo / version-2 ProTx
accepts a bare port for the platform fields (the IP is inherited from
the core address) and only a single entry for the core field. Users
following the help would hit a terse `ProTx version only supports
ports` error with no example of what was actually accepted.

Update the help strings to call out the legacy vs. Extended addresses
(ExtNetInfo) format, and reword the rejection in `ProcessNetInfoPlatform`
to show an example port and point at Extended addresses for the array
form. Update the matching functional-test expectations and pin the full
new error string in one assertion to prevent regression of the hint.

Fixes dashpay#7370
@thepastaclaw

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@github-actions

Copy link
Copy Markdown

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The change improves clarity of error feedback for legacy (version-2 / MnNetInfo) ProTx address parameters. In ProcessNetInfoPlatform, the generic "ProTx version only supports ports" error is replaced with a purpose-specific RPC_INVALID_PARAMETER message that names an example port number (443 for HTTPS, 26656 for P2P) and explicitly states that the ADDR:PORT/address-array form requires an ExtNetInfo-based ProTx. Five GetRpcArg() help strings (coreP2PAddrs, platformP2PAddrs, platformP2PAddrs_update, platformHTTPSAddrs, platformHTTPSAddrs_update) are extended with equivalent documentation. Functional test expectations in test_validation_legacy are updated to match the new error wording.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • UdjinM6
  • PastaPastaPasta
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately describes the PR's primary change: clarifying RPC help documentation for ProTx platform address parameters.
Description check ✅ Passed Description clearly relates to the changeset, explaining the issue, what was done, and how it was tested.
Linked Issues check ✅ Passed Changes comprehensively address issue #7370 objectives: clarified RPC help text distinguishing legacy vs. Extended address formats, improved error messages with specific port examples, and updated tests accordingly.
Out of Scope Changes check ✅ Passed All changes (RPC help updates, error message improvements, test expectations) directly address the linked issue requirements; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/functional/rpc_netinfo.py`:
- Around line 275-278: The error message validation in the first register_mn
call on line 276 is missing the "Invalid param for platformP2PAddrs," prefix
that the validator actually returns. Additionally, the second register_mn call
on line 278 contains an outdated truncated error message text. Update both error
message strings in these two register_mn calls to match the complete and current
validator error messages, ensuring that the first one includes the "Invalid
param for platformP2PAddrs," prefix and the second one uses the full validator
message text instead of the truncated version.
- Around line 284-293: The error message expectations in all four register_mn
function calls need to be updated to match the new error message format. The
current error messages only contain the old prefix text, but they should be
updated to include the new example-port and ExtNetInfo wording that is now
emitted by ProcessNetInfoPlatform. Update each of the four error message strings
(passed as the last argument to each register_mn call) to include the additional
new wording that ProcessNetInfoPlatform now generates for invalid array-wrapped
port parameters in platformP2PAddrs and platformHTTPSAddrs.
- Around line 294-304: The test assertions for the empty-core and
partial-platform registration cases in the register_mn calls are using outdated
error message formats. Update all error message strings in the register_mn
method calls within this test section to use the full updated error message
format that includes the bare-port example (e.g., "Invalid param for
platformP2PAddrs, this ProTx version only accepts a bare port number"), ensuring
they match the current validator output being checked in the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8f06aaf0-59e9-4cbf-987c-c263d5c0fc9f

📥 Commits

Reviewing files that changed from the base of the PR and between a59ad9e and c3c1d35.

📒 Files selected for processing (3)
  • src/rpc/evo.cpp
  • src/rpc/evo_util.cpp
  • test/functional/rpc_netinfo.py

Comment on lines 275 to +278
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", f"127.0.0.1:{DEFAULT_PORT_PLATFORM_P2P}", DEFAULT_PORT_PLATFORM_HTTP,
-8, "Invalid param for platformP2PAddrs, ProTx version only supports ports")
-8, "this ProTx version only accepts a bare port number (e.g. 26656); the \"ADDR:PORT\" / address-array form requires an Extended addresses (ExtNetInfo) ProTx")
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", [f"127.0.0.1:{DEFAULT_PORT_PLATFORM_P2P}"], DEFAULT_PORT_PLATFORM_HTTP,
-8, "Invalid param for platformP2PAddrs, ProTx version only supports ports")
-8, "Invalid param for platformP2PAddrs, this ProTx version only accepts a bare port number")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Refresh the first legacy P2P rejection string.

Line 276 is missing the Invalid param for platformP2PAddrs, prefix, and Line 278 still checks the old truncated text. Update both to the full validator message so this case actually covers the new wording.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/functional/rpc_netinfo.py` around lines 275 - 278, The error message
validation in the first register_mn call on line 276 is missing the "Invalid
param for platformP2PAddrs," prefix that the validator actually returns.
Additionally, the second register_mn call on line 278 contains an outdated
truncated error message text. Update both error message strings in these two
register_mn calls to match the complete and current validator error messages,
ensuring that the first one includes the "Invalid param for platformP2PAddrs,"
prefix and the second one uses the full validator message text instead of the
truncated version.

Comment on lines 284 to 293
# Port numbers may not be wrapped in arrays, either as integers or strings
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", [DEFAULT_PORT_PLATFORM_P2P], DEFAULT_PORT_PLATFORM_HTTP,
-8, "Invalid param for platformP2PAddrs, ProTx version only supports ports")
-8, "Invalid param for platformP2PAddrs, this ProTx version only accepts a bare port number")
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", [f"{DEFAULT_PORT_PLATFORM_P2P}"], DEFAULT_PORT_PLATFORM_HTTP,
-8, "Invalid param for platformP2PAddrs, ProTx version only supports ports")
-8, "Invalid param for platformP2PAddrs, this ProTx version only accepts a bare port number")
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", DEFAULT_PORT_PLATFORM_P2P, [DEFAULT_PORT_PLATFORM_HTTP],
-8, "Invalid param for platformHTTPSAddrs, ProTx version only supports ports")
-8, "Invalid param for platformHTTPSAddrs, this ProTx version only accepts a bare port number")
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", DEFAULT_PORT_PLATFORM_P2P, [f"{DEFAULT_PORT_PLATFORM_HTTP}"],
-8, "Invalid param for platformHTTPSAddrs, ProTx version only supports ports")
-8, "Invalid param for platformHTTPSAddrs, this ProTx version only accepts a bare port number")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the array-wrapped port expectations.

These four assertions still only match the old prefix. They should include the new example-port and ExtNetInfo wording emitted by ProcessNetInfoPlatform, otherwise these cases won’t verify the new behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/functional/rpc_netinfo.py` around lines 284 - 293, The error message
expectations in all four register_mn function calls need to be updated to match
the new error message format. The current error messages only contain the old
prefix text, but they should be updated to include the new example-port and
ExtNetInfo wording that is now emitted by ProcessNetInfoPlatform. Update each of
the four error message strings (passed as the last argument to each register_mn
call) to include the additional new wording that ProcessNetInfoPlatform now
generates for invalid array-wrapped port parameters in platformP2PAddrs and
platformHTTPSAddrs.

Comment on lines 294 to +304
# coreP2PAddrs cannot be empty when registering a masternode without specifying platform fields
self.node_evo.register_mn(self, False, "", "", "",
-8, "Invalid param for platformP2PAddrs, ProTx version only supports ports")
-8, "Invalid param for platformP2PAddrs, this ProTx version only accepts a bare port number")
self.node_evo.register_mn(self, False, "", "", DEFAULT_PORT_PLATFORM_HTTP,
-8, "Invalid param for platformP2PAddrs, ProTx version only supports ports")
-8, "Invalid param for platformP2PAddrs, this ProTx version only accepts a bare port number")
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", "", "",
-8, "Invalid param for platformP2PAddrs, cannot be empty if other fields populated")
self.node_evo.register_mn(self, False, f"127.0.0.1:{self.node_evo.mn.nodePort}", "", DEFAULT_PORT_PLATFORM_HTTP,
-8, "Invalid param for platformP2PAddrs, cannot be empty if other fields populated")
self.node_evo.register_mn(self, False, "", DEFAULT_PORT_PLATFORM_P2P, "",
-8, "Invalid param for platformHTTPSAddrs, ProTx version only supports ports")
-8, "Invalid param for platformHTTPSAddrs, this ProTx version only accepts a bare port number")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Bring the empty-core/partial-platform cases up to date.

These assertions still expect the short legacy text. Use the full Invalid param for ... message, including the bare-port example, so the updated validator output is actually checked here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/functional/rpc_netinfo.py` around lines 294 - 304, The test assertions
for the empty-core and partial-platform registration cases in the register_mn
calls are using outdated error message formats. Update all error message strings
in the register_mn method calls within this test section to use the full updated
error message format that includes the bare-port example (e.g., "Invalid param
for platformP2PAddrs, this ProTx version only accepts a bare port number"),
ensuring they match the current validator output being checked in the test.

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

Labels

None yet

Projects

None yet

1 participant