Skip to content

Conversation

kwvg
Copy link
Collaborator

@kwvg kwvg commented Aug 10, 2025

Additional Information

  • feat: introduce basic extended addresses implementation, stop using platform{HTTP,P2P}Port #6666

  • No help text has been updated to mark platformP2PPort and platformHTTPPort as deprecated outputs as we do not generate help text that mentions what these fields represent. This gap will be addressed in a future PR and the text "(DEPRECATED)" will be appended there.

    • Like service, the field is only marked as deprecated in documentation but is accessible without any additional runtime flags.

Breaking Changes

Refer to release notes.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (note: N/A)
  • 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)

@kwvg kwvg added the RPC Some notable changes to RPC params/behaviour/descriptions label Aug 10, 2025
Copy link

github-actions bot commented Aug 10, 2025

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@kwvg kwvg added this to the 23 milestone Aug 12, 2025
Copy link

This pull request has conflicts, please rebase.

Due to transitional concerns, while the fields are still considered
deprecated, they will currently remain unenforced through gating. Also,
don't use the word 'field' and 'key' interchangeably.
@kwvg kwvg marked this pull request as ready for review September 23, 2025 16:53
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

The changes remove the deprecated-RPC gating for the “service”/“address” output across multiple components and make these fields unconditionally present. The helper IsServiceDeprecatedRPCEnabled() is deleted from netinfo.{h,cpp}. JSON serialization for masternodes, proTx-related structures, CoinJoin session info, quorum members, and masternodelist now always includes the service/address derived from netInfo->GetPrimary().ToStringAddrPort(). RPC help text is updated accordingly. Release notes are added/updated to clarify deprecations and replacements with the addresses key. Functional tests are updated: deprecation-focused checks are replaced with field presence checks, and the test topology is reduced from 3 to 2 nodes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.88% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately and concisely summarizes the primary changes: reverting the gating of the service/address fields behind -deprecatedrpc=service and marking platformP2PPort/platformHTTPPort as deprecated, making it clear and specific for a quick history scan.
Description Check ✅ Passed The PR description is directly related to the changeset, documents the revert and deprecation decisions, references the linked PR, notes the help-text gap and release-notes guidance, and includes a checklist, so it is on-topic and sufficient for this lenient check.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/functional/rpc_netinfo.py (1)

461-463: Destroying the wrong node instance at teardown

This test section operates on node_two, but destroys node_evo. Fix to avoid unintended side effects.

-        self.node_evo.destroy_mn(self)
+        self.node_two.destroy_mn(self)
🧹 Nitpick comments (5)
doc/release-notes-6811.md (1)

4-8: Minor grammar/clarity nits

Consider:

  • “have been deprecated … and have been replaced with the key ‘addresses’.”
  • “The deprecated keys are still available … but are liable to be removed …”
doc/release-notes-6665.md (1)

9-12: Wording tweak for consistency

Suggest “replaced with the ‘addresses’ key” and pluralize “deprecated keys … are still available …”.

test/functional/rpc_netinfo.py (3)

21-21: Prefer decimal over _decimal for portability

Use the standard library import to avoid environment-specific failures.

-from _decimal import Decimal
+from decimal import Decimal

123-124: Avoid constructing Decimal from a float literal

Float → Decimal can introduce rounding artifacts; construct from a string.

-                {self.mn.fundsAddr: float(address_funds_value - Decimal(0.001))}
+                {self.mn.fundsAddr: float(address_funds_value - Decimal("0.001"))}

361-418: Good coverage for addresses; consider asserting service in masternode_status

Since service is now ungated, also assert it via masternode_status to catch regressions in CDeterministicMNState::ToJson().

         masternode_status = self.node_evo.node.masternode('status')
+        assert_equal(masternode_status['dmnState']['service'], f"127.0.0.1:{self.node_evo.mn.nodePort}")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b5310a and ed3db7c.

📒 Files selected for processing (11)
  • doc/release-notes-6665.md (1 hunks)
  • doc/release-notes-6811.md (1 hunks)
  • src/coinjoin/client.cpp (1 hunks)
  • src/evo/core_write.cpp (3 hunks)
  • src/evo/dmnstate.cpp (2 hunks)
  • src/evo/netinfo.cpp (0 hunks)
  • src/evo/netinfo.h (0 hunks)
  • src/rpc/coinjoin.cpp (1 hunks)
  • src/rpc/masternode.cpp (1 hunks)
  • src/rpc/quorums.cpp (1 hunks)
  • test/functional/rpc_netinfo.py (8 hunks)
💤 Files with no reviewable changes (2)
  • src/evo/netinfo.h
  • src/evo/netinfo.cpp
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{cpp,h,cc,cxx,hpp}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{cpp,h,cc,cxx,hpp}: Dash Core C++ codebase must be written in C++20 and require at least Clang 16 or GCC 11.1
Dash uses unordered_lru_cache for efficient caching with LRU eviction

Files:

  • src/rpc/masternode.cpp
  • src/evo/dmnstate.cpp
  • src/evo/core_write.cpp
  • src/coinjoin/client.cpp
  • src/rpc/quorums.cpp
  • src/rpc/coinjoin.cpp
src/{masternode,evo}/**/*.{cpp,h,cc,cxx,hpp}

📄 CodeRabbit inference engine (CLAUDE.md)

Masternode lists must use immutable data structures (Immer library) for thread safety

Files:

  • src/evo/dmnstate.cpp
  • src/evo/core_write.cpp
doc/**

📄 CodeRabbit inference engine (CLAUDE.md)

Unless specifically prompted, avoid making changes to the doc directory (documentation)

Files:

  • doc/release-notes-6811.md
  • doc/release-notes-6665.md
test/functional/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Functional tests should be written in Python and placed in test/functional/

Files:

  • test/functional/rpc_netinfo.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: knst
PR: dashpay/dash#6805
File: src/wallet/rpc/wallet.cpp:357-357
Timestamp: 2025-08-08T07:01:47.332Z
Learning: In src/wallet/rpc/wallet.cpp, the upgradetohd RPC now returns a UniValue string message (RPCResult::Type::STR) instead of a boolean, including guidance about mnemonic backup and null-character passphrase handling; functional tests have been updated to assert returned strings in several cases.
📚 Learning: 2025-06-06T11:53:09.094Z
Learnt from: kwvg
PR: dashpay/dash#6665
File: src/evo/providertx.h:82-82
Timestamp: 2025-06-06T11:53:09.094Z
Learning: In ProTx serialization code (SERIALIZE_METHODS), version checks should use hardcoded maximum flags (/*is_basic_scheme_active=*/true, /*is_extended_addr=*/true) rather than deployment-based flags. This is because serialization code should be able to deserialize any structurally valid ProTx up to the maximum version the code knows how to handle, regardless of current consensus validity. Validation code, not serialization code, is responsible for checking whether a ProTx version is consensus-valid based on deployment status.

Applied to files:

  • src/evo/core_write.cpp
📚 Learning: 2025-06-16T17:59:55.669Z
Learnt from: kwvg
PR: dashpay/dash#6665
File: src/evo/deterministicmns.cpp:1284-1287
Timestamp: 2025-06-16T17:59:55.669Z
Learning: In Dash masternode ProRegTx validation, platform ports (platformHTTPPort and platformP2PPort) are mandatory and must be non-zero, while netInfo (ipAndPort) is optional. This means that even if an empty netInfo returns 0 from GetPrimary().GetPort(), it won't cause false positives in port duplication checks since platform ports cannot be 0.

Applied to files:

  • test/functional/rpc_netinfo.py
🧬 Code graph analysis (1)
test/functional/rpc_netinfo.py (1)
test/functional/test_framework/util.py (1)
  • assert_equal (69-74)
🪛 GitHub Actions: Clang Diff Format Check
src/rpc/coinjoin.cpp

[error] 1-1: Clang format differences found. Command failed with exit code 1: 'git diff -U0 origin/develop -- $(git ls-files -- $(cat test/util/data/non-backported.txt)) | ./contrib/devtools/clang-format-diff.py -p1 > diff_output.txt'. Review and run clang-format-diff.py or clang-format to apply formatting changes.

🔇 Additional comments (14)
src/rpc/coinjoin.cpp (1)

436-438: Help text deprecation tag for "service" — LGTM

Consistent with the PR’s deprecation approach while keeping the field available.

src/rpc/quorums.cpp (2)

1-3: Fix clang-format CI failure

CI reports a clang-format diff. Please run the project’s formatter to align with the style check (same command CI uses).

Run locally:

  • git fetch upstream (or origin) develop
  • ./contrib/devtools/clang-format-diff.py -p1 > diff_output.txt
  • Review and apply the suggested formatting

If needed, use git clang-format on the PR range.


206-211: Always include “service” in quorum member JSON — LGTM

Matches the un-gated exposure across the codebase; ordering with “addresses” is consistent.

src/coinjoin/client.cpp (1)

1874-1878: Expose “service” in CoinJoin session info — LGTM

Aligned with the deprecation policy; “addrs_core_p2p” remains for detailed endpoints.

src/rpc/masternode.cpp (1)

616-620: Keep both “address” and “addresses” for compatibility — LGTM

Matches the plan: legacy singular field retained; structured “addresses” provided alongside.

src/evo/dmnstate.cpp (2)

38-41: Unconditional “service” in CDeterministicMNState::ToJson — LGTM

Consistent with removed gating and mirrors other serializers.


73-76: Include “service” in state diffs when netInfo changes — LGTM

Appropriate to surface primary address changes via diffs.

src/evo/core_write.cpp (1)

75-77: Un-gated “service” in ProTx/SMN JSON — LGTM

CProRegTx, CProUpServTx and CSimplifiedMNListEntry consistently expose "service" alongside "addresses"; no service-specific gating found.

test/functional/rpc_netinfo.py (6)

184-184: Switch to fields-focused flow: LGTM


432-441: Legacy (basic) path checks: LGTM

Validates empty addresses with [::]:0 service and legacy platform ports as expected.


449-460: Extended (empty) addresses behavior: LGTM

Correctly asserts empty addresses and -1 platform ports.


469-469: Comment-only change

No action needed.


507-508: Unconditional service asserts: LGTM

Confirms service mirrors coreP2PAddrs[0] post-ungating.


138-142: Topology reduced to 2 nodes — no stale references to a third node found

No occurrences of self.nodes[2] or any "[2]" index in test/functional/rpc_netinfo.py; reconnect_nodes uses range(1, self.num_nodes) which is correct for 2 nodes.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK ed3db7c

@PastaPastaPasta PastaPastaPasta merged commit 3a27f30 into dashpay:develop Sep 25, 2025
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants