Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Oct 13, 2025

What was done?

Backports from bitcoin that validates RPC help.
Also missing changes from bitcoin#20459.

How Has This Been Tested?

Replaced all RPCResults{} to relevant doc.
Run functional tests and fix leftover failures one-by-one.

Breaking Changes

Only if running with -rpcdoccheck or if configure&build with --enable_debug.

Some type of failures when RPCResult could be caught now in runtime.

When calling RPC:

2025-10-13T19:52:59.999000Z TestFramework (INFO): Expecting InstantLock for 9264f1ed8dbcf05b2aec8e71dd1babc3cdb3f5bab9c538a5ed1af0abb18e77fb
2025-10-13T19:53:00.632000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "DASH/test/functional/test_framework/test_framework.py", line 163, in main
    self.run_test()
    ~~~~~~~~~~~~~^^
  File "DASH/test/functional/interface_zmq_dash.py", line 156, in run_test
    self.test_governance_publishers()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "DASH/test/functional/interface_zmq_dash.py", line 415, in test_governance_publishers
    rpc_proposal_votes = self.nodes[0].gobject('getcurrentvotes', rpc_proposal_hash)
  File "DASH/test/functional/test_framework/coverage.py", line 49, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "DASH/test/functional/test_framework/authproxy.py", line 146, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Internal bug detected: "std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); })"
rpc/util.cpp:542 (HandleRequest)
Dash Core v22.1.3-2097-g2d11884d100b-dirty
Please report this issue here: https://github.com/dashpay/dash/issues
 (-1)

When app starts:

************************
"AppInit()" raised an exception
Exception: type=NonFatalCheckError, what="Internal bug detected: "inner_needed != m_inner.empty()"
rpc/util.cpp:865 (CheckInnerDoc)
Dash Core v22.1.3-2097-g3e577dd864a8-dirty
Please report this issue here: https://github.com/dashpay/dash/issues
"
   0#: (0x5C9C7743AFA6) check.h:24                - bool&& inline_check_non_fatal<bool>(bool&&, char const*, int, char const*, char const*)
   1#: (0x5C9C7770C3C7) util.h:313                - RPCResult::RPCResult(RPCResult::Type, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<RPCResult, std::allocator<RPCResult> >)
   2#: (0x5C9C7770C643) util.h:320                - RPCResult::RPCResult(RPCResult::Type, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<RPCResult, std::allocator<RPCResult> >)
   3#: (0x5C9C777F16A9) quorums.cpp:311           - quorum_dkgstatus
   4#: (0x5C9C7770B77C) server.h:108              - CRPCCommand::CRPCCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, RPCHelpMan (*)())
   5#: (0x5C9C777E2EFA) quorums.cpp:1234          - RegisterQuorumsRPCCommands(CRPCTable&)
   6#: (0x5C9C774926A1) stl_iterator.h:1068       - __gnu_cxx::__normal_iterator<std::unique_ptr<interfaces::ChainClient, std::default_delete<interfaces::ChainClient> >*, std::vector<std::unique_ptr<interfaces::ChainClient, std::default_delete<interfaces::ChainClient> >, std::allocator<std::unique_ptr<interfaces::ChainClient, std::default_delete<interfaces::ChainClient> > > > >::__normal_iterator(std::unique_ptr<interfaces::ChainClient, std::default_delete<interfaces::ChainClient> >* const&)
   7#: (0x5C9C774926A1) stl_vector.h:894          - std::vector<std::unique_ptr<interfaces::ChainClient, std::default_delete<interfaces::ChainClient> >, std::allocator<std::unique_ptr<interfaces::ChainClient, std::default_delete<interfaces::ChainClient> > > >::end()
   8#: (0x5C9C774926A1) init.cpp:1534             - AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)
   9#: (0x5C9C7745E040) bitcoind.cpp:240          - AppInit
  10#: (0x5C9C7745E040) bitcoind.cpp:283          - main
  11#: (0x75B8D622A578) libc_start_call_main.h:74 - __libc_start_call_main
  12#: (0x75B8D622A63B) libc-start.c:128          - call_init
  13#: (0x75B8D622A63B) libc-start.c:347          - __libc_start_main_impl
  14#: (0x5C9C77472695) <unknown-file>            - ???

************************

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)

@knst knst added this to the 23 milestone Oct 13, 2025
@github-actions
Copy link

github-actions bot commented Oct 13, 2025

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a build-time preprocessor flag and runtime option to enable RPC documentation checks: configure.ac adds AX_CHECK_PREPROC_FLAG for -DRPC_DOC_CHECK; src/rpc/util.h defines DEFAULT_RPC_DOC_CHECK from that macro; src/init.cpp registers the -rpcdoccheck argument; src/rpc/util.cpp changes RPCHelpMan::HandleRequest to compute the RPC return value and, when -rpcdoccheck is enabled, perform a non-fatal validation of the result against the RPCResult schema before returning; src/rpc/quorums.cpp expands quorum_info RPC output (adds previousConsecutiveDKGFailures, a populated members array, and quorumIndex), renames mineableCommitments -> minableCommitments in quorum_dkgstatus, and updates help text; src/evo/core_write.cpp adds a quorumIndex RPC result entry; test/functional/test_framework/util.py writes rpcdoccheck=1 into test configs.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RPCHelper as RPCHelpMan::HandleRequest
    participant Validator as RPCResult Validator
    participant Result

    Client->>RPCHelper: Invoke RPC method
    RPCHelper->>RPCHelper: Compute ret (RPC result)

    alt RPC_DOC_CHECK built-in AND -rpcdoccheck enabled at runtime
        rect rgb(230,245,255)
        RPCHelper->>Validator: Validate ret against RPCResult schema
        Validator-->>RPCHelper: Validation outcome (logged, non-fatal)
        end
    end

    RPCHelper-->>Result: Return ret
    Result-->>Client: Respond
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect src/rpc/quorums.cpp: verify types, presence/formatting of previousConsecutiveDKGFailures, members array and per-member fields, and the quorumIndex population.
  • Review src/rpc/util.cpp: ensure validation call is non-fatal, does not change RPC semantics, and has acceptable performance/side-effects.
  • Check src/rpc/util.h and src/init.cpp: confirm DEFAULT_RPC_DOC_CHECK definition and -rpcdoccheck flag registration (ALLOW_ANY | DEBUG_ONLY).
  • Validate src/evo/core_write.cpp: quorumIndex entry type/description consistency.
  • Confirm configure.ac and test/functional/test_framework/util.py: flag detection and test config injection behavior.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 summarizes the main change: backporting specific Bitcoin PRs that add RPC help validation.
Description check ✅ Passed The description is clearly related to the changeset, explaining what was done (backporting RPC validation), how it was tested, and documenting breaking changes with concrete error examples.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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: 7

Caution

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

⚠️ Outside diff range comments (2)
src/test/fuzz/rpc.cpp (1)

128-141: Remove the duplicate entry.

The command "gettxspendingprevout" appears twice in RPC_COMMANDS_SAFE_FOR_FUZZING (lines 128 and 141). This duplication will cause the validation check at lines 331-334 to fail with an error stating the command is found in both lists.

Apply this diff to remove the duplicate:

     "getmempoolentry",
-    "gettxspendingprevout",
     "getmempoolinfo",
src/rpc/rawtransaction.cpp (1)

375-379: Fix RPC example: missing trailing quote

The RPC example is missing the closing single-quote.

Apply this diff:

-+ HelpExampleRpc("getrawtransactionmulti",
-+                                     R"('{"blockhash1":["txid1","txid2"], "0":["txid3"]})")
++ HelpExampleRpc("getrawtransactionmulti",
++                                     R"('{"blockhash1":["txid1","txid2"], "0":["txid3"]}')")
🧹 Nitpick comments (5)
src/rpc/util.cpp (1)

540-545: Good addition: non-fatal runtime doc/type check

  • Properly gated by -rpcdoccheck; won’t affect normal flow.
  • Note: if m_results is empty, CHECK_NONFATAL will trigger. Ensure all RPCs define at least one RPCResult when enabling the flag.
  • Minor: avoid an extra UniValue copy.
-    const UniValue ret = m_fun(*this, request);
+    const UniValue& ret = m_fun(*this, request);

Please confirm intent regarding empty m_results causing a NonFatalCheckError when -rpcdoccheck=1.

src/rpc/mempool.cpp (1)

325-327: Consider emitting a boolean instead of string for instantlock

Currently writes "true"/"false"/"unknown" strings. Prefer a boolean (and omit the field if unknown) for type stability.

-    info.pushKV("instantlock", isman ? (isman->IsLocked(tx.GetHash()) ? "true" : "false") : "unknown");
+    if (isman) {
+        info.pushKV("instantlock", isman->IsLocked(tx.GetHash()));
+    }

If adopting this, update the help to Type::BOOL and mark it optional.

src/rpc/quorums.cpp (2)

106-123: Prefer OBJ_DYN for dynamic quorum-hash keyed objects

The listextended result nests an object keyed by dynamic quorum hashes but uses a placeholder field name "xxxx". Use RPCResult::Type::OBJ_DYN like getrawmempool’s verbose path to better reflect dynamic keys in doc checks.


780-788: Document recoveryMembers in quorum selectquorum

The RPC returns “recoveryMembers” (Lines 812–818) but the help omits it. Add it to the result schema for completeness.

         RPCResult{
             RPCResult::Type::OBJ, "", "",
             {
                 {RPCResult::Type::STR_HEX, "quorumHash", "Hash of chosen quorum"},
+                {RPCResult::Type::ARR, "recoveryMembers", "List of members selected for signature recovery",
+                    {{RPCResult::Type::STR_HEX, "", "ProTx hash of member"}}},
             }
         },
src/rpc/rawtransaction.cpp (1)

361-373: Result schema matches implementation; consider OBJ_DYN for clarity

Docs align with returned hex/object/"None". Optionally, use OBJ_DYN with a dynamic "txid" key to mirror map semantics more explicitly.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6de66a4 and 098367b.

📒 Files selected for processing (26)
  • configure.ac (1 hunks)
  • doc/release-notes/release-notes-24408.md (1 hunks)
  • src/init.cpp (1 hunks)
  • src/rpc/blockchain.cpp (1 hunks)
  • src/rpc/client.cpp (1 hunks)
  • src/rpc/coinjoin.cpp (3 hunks)
  • src/rpc/evo.cpp (6 hunks)
  • src/rpc/governance.cpp (15 hunks)
  • src/rpc/masternode.cpp (7 hunks)
  • src/rpc/mempool.cpp (2 hunks)
  • src/rpc/mining.cpp (1 hunks)
  • src/rpc/net.cpp (1 hunks)
  • src/rpc/node.cpp (1 hunks)
  • src/rpc/quorums.cpp (17 hunks)
  • src/rpc/rawtransaction.cpp (2 hunks)
  • src/rpc/server.cpp (1 hunks)
  • src/rpc/txoutproof.cpp (0 hunks)
  • src/rpc/util.cpp (2 hunks)
  • src/rpc/util.h (1 hunks)
  • src/test/fuzz/rpc.cpp (1 hunks)
  • src/wallet/rpc/wallet.cpp (3 hunks)
  • src/zmq/zmqrpc.cpp (1 hunks)
  • test/functional/mempool_packages.py (1 hunks)
  • test/functional/rpc_mempool_info.py (1 hunks)
  • test/functional/test_framework/util.py (1 hunks)
  • test/functional/test_runner.py (1 hunks)
💤 Files with no reviewable changes (1)
  • src/rpc/txoutproof.cpp
🧰 Additional context used
📓 Path-based instructions (4)
test/functional/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • test/functional/mempool_packages.py
  • test/functional/test_runner.py
  • test/functional/rpc_mempool_info.py
  • test/functional/test_framework/util.py
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/util.h
  • src/rpc/node.cpp
  • src/rpc/util.cpp
  • src/rpc/coinjoin.cpp
  • src/rpc/mining.cpp
  • src/init.cpp
  • src/rpc/blockchain.cpp
  • src/rpc/client.cpp
  • src/rpc/server.cpp
  • src/wallet/rpc/wallet.cpp
  • src/rpc/net.cpp
  • src/rpc/evo.cpp
  • src/rpc/quorums.cpp
  • src/test/fuzz/rpc.cpp
  • src/rpc/masternode.cpp
  • src/rpc/mempool.cpp
  • src/rpc/governance.cpp
  • src/zmq/zmqrpc.cpp
  • src/rpc/rawtransaction.cpp
doc/**

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • doc/release-notes/release-notes-24408.md
src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp}

📄 CodeRabbit inference engine (CLAUDE.md)

Unit tests for C++ code should be placed in src/test/, src/wallet/test/, or src/qt/test/ and use Boost::Test or Qt 5 for GUI tests

Files:

  • src/test/fuzz/rpc.cpp
🔇 Additional comments (40)
doc/release-notes/release-notes-24408.md (1)

1-5: LGTM!

The release notes clearly document the new gettxspendingprevout RPC and its purpose.

src/zmq/zmqrpc.cpp (2)

34-34: LGTM!

Adding the RPC example improves documentation completeness for the getzmqnotifications RPC.


54-56: LGTM!

The compact initializer list format aligns with the broader refactoring across RPC command registrations in this PR.

test/functional/test_framework/util.py (1)

393-393: LGTM!

Adding rpcdoccheck=1 to the test configuration enables runtime RPC documentation validation during functional tests, which aligns with the new -rpcdoccheck flag introduced in this PR.

src/rpc/client.cpp (1)

202-202: LGTM!

The conversion entry for gettxspendingprevout follows the established pattern and correctly specifies that the first parameter ("outputs") needs JSON conversion.

test/functional/mempool_packages.py (1)

102-106: LGTM!

The consistency check validates that gettxspendingprevout correctly identifies spending transactions in the mempool, providing good test coverage for the new RPC.

test/functional/test_runner.py (1)

395-395: LGTM!

Adding rpc_mempool_info.py to the extended test suite expands coverage for mempool-related RPCs, including the newly introduced gettxspendingprevout.

src/rpc/util.h (1)

26-32: LGTM!

The DEFAULT_RPC_DOC_CHECK constant is correctly defined using static constexpr with internal linkage, which is appropriate for a header file constant. The conditional compilation based on RPC_DOC_CHECK enables compile-time control of runtime RPC documentation validation.

src/rpc/util.cpp (1)

17-17: Include looks correct

Needed for gArgs usage below. No issues.

src/rpc/blockchain.cpp (1)

2762-2795: RPC registration table LGTM

Consistent categories, complete set of blockchain commands. No functional concerns.

src/rpc/mining.cpp (1)

1097-1108: RPC registration table LGTM

Command set unchanged and correctly categorized. Good cleanup.

src/rpc/node.cpp (1)

828-828: Explicit NONE result is correct

Matches returned NullUniValue and aligns with help validation.

src/rpc/server.cpp (1)

270-276: Command list init LGTM

Style-only change; bindings preserved.

src/wallet/rpc/wallet.cpp (3)

99-99: Explicit NONE result is correct

Switching to RPCResult::Type::NONE aligns with commands returning NullUniValue. No behavior change.


130-130: Explicit NONE result is correct

Consistent with returning NullUniValue; matches RPC doc checks.


1156-1226: Command table refactor LGTM

Static const initializer improves clarity and removes clang-format guards; command set/order preserved.

src/rpc/mempool.cpp (3)

596-677: New RPC gettxspendingprevout: solid implementation

Strict arg checking, negative vout guard, mempool-locked lookup, and per-prevout result shaping look correct. Matches the functional test expectations.


774-775: Registration LGTM

gettxspendingprevout properly registered under “blockchain”.


236-268: RPC result doc/type mismatches: instantsend vs instantlock; fee units

Two issues that will trip -rpcdoccheck:

  • Field name/type: help documents “instantsend” as BOOL, but code emits “instantlock” as a string ("true"/"false"/"unknown") in entryToJSON.
  • Deprecated fee fields “descendantfees” and “ancestorfees” are documented as STR_AMOUNT but code emits numeric satoshis (no ValueFromAmount), and the description says “CURRENCY_ATOMs”.

Fix the help to match actual output:

@@
-    RPCResult{RPCResult::Type::STR_AMOUNT, "descendantfees", /*optional=*/true,
-              "transaction fees of in-mempool descendants (including this one) with fee deltas used for mining priority, denominated in " +
-                  CURRENCY_ATOM + "s (DEPRECATED, returned only if config option -deprecatedrpc=fees is passed)"},
+    RPCResult{RPCResult::Type::NUM, "descendantfees", /*optional=*/true,
+              "transaction fees of in-mempool descendants (including this one) with fee deltas used for mining priority, denominated in " +
+                  CURRENCY_ATOM + "s (DEPRECATED, returned only if config option -deprecatedrpc=fees is passed)"},
@@
-    RPCResult{RPCResult::Type::NUM, "ancestorcount", "number of in-mempool ancestor transactions (including this one)"},
+    RPCResult{RPCResult::Type::NUM, "ancestorcount", "number of in-mempool ancestor transactions (including this one)"},
@@
-    RPCResult{RPCResult::Type::STR_AMOUNT, "ancestorfees", /*optional=*/true,
-              "transaction fees of in-mempool ancestors (including this one) with fee deltas used for mining priority, denominated in " +
-                  CURRENCY_ATOM + "s (DEPRECATED, returned only if config option -deprecatedrpc=fees is passed)"},
+    RPCResult{RPCResult::Type::NUM, "ancestorfees", /*optional=*/true,
+              "transaction fees of in-mempool ancestors (including this one) with fee deltas used for mining priority, denominated in " +
+                  CURRENCY_ATOM + "s (DEPRECATED, returned only if config option -deprecatedrpc=fees is passed)"},
@@
-    RPCResult{RPCResult::Type::BOOL, "instantsend", "True if this transaction was locked via InstantSend"},
+    RPCResult{RPCResult::Type::STR, "instantlock", "InstantSend lock status: \"true\", \"false\", or \"unknown\""},

Alternative (if you prefer strong typing): change entryToJSON to emit a boolean field named “instantsend” (and omit it when unknown), and keep the original help. Happy to provide that diff if preferred.

src/rpc/evo.cpp (2)

1889-1909: Wallet evo command table refactor LGTM

Initializer list is clear; same commands preserved.


1915-1922: Non-wallet command registration refactor LGTM

Separation between always-available and wallet-dependent commands is correct and preserved.

src/rpc/quorums.cpp (1)

245-251: quorum info result doc uses ELISION: acceptable

Using ELISION is fine given the detailed, versioned structure.

test/functional/rpc_mempool_info.py (1)

16-102: Good coverage for gettxspendingprevout

Builds a mempool DAG and validates spent/unspent cases and error paths. Matches the RPC behavior and strict arg checking.

src/rpc/rawtransaction.cpp (1)

1923-1944: LGTM: registration table modernization

Initializer list + append loop is consistent and correct.

src/rpc/masternode.cpp (4)

52-55: LGTM: return shape for connect

Returns a simple status string as documented.


184-189: LGTM: ELISION placeholder for status

Acceptable interim schema until a strict schema is defined.


722-725: LGTM: wallet masternode commands registration

Initializer list is correct.


731-740: LGTM: masternode commands registration

Registration table looks consistent.

src/rpc/governance.cpp (12)

119-124: LGTM: simple “OK” status schema

Matches implementation.


174-175: LGTM: prepare returns hex string

Doc matches returning the collateral txid.


285-293: LGTM: list-prepared returns array of objects

Schema aligns with code.


523-538: LGTM: shared vote result schema

Reusable object matches VoteWithMasternodes output.


550-551: LGTM: use shared vote schema (vote-many)

Consistent with helper output.


603-604: LGTM: use shared vote schema (vote-alias)

Consistent with helper output.


783-790: LGTM: gobject_get returns an object

Doc aligns with implementation.


887-891: LGTM: current votes map

Schema matches “hash -> presentation string”.


957-958: LGTM: umbrella command returns NONE

Matches throwing behavior.


979-979: LGTM: voteraw returns a string

Aligned with implementation.


1132-1137: LGTM: wallet governance commands registration

Initializer list is fine.


1145-1157: LGTM: governance commands registration

Looks correct.

Comment on lines 83 to 94
{
RPCResult{
RPCResult::Type::OBJ, "", "Deserialized governance object",
{
// TODO: list fields of output for RPC help instead ELISION
{RPCResult::Type::ELISION, "", ""}
}
},
RPCResult{"for mode = all",
RPCResult::Type::STR, "", "The transaction hash in hex"
},
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Deserialize returns string, but doc says object; also stray “mode = all”

Either the code should return an object or the doc should say STR. Prefer returning the parsed object.

Apply these diffs:

Change the result doc and remove the irrelevant alternate:

-        {
-            RPCResult{
-                RPCResult::Type::OBJ, "", "Deserialized governance object",
-                {
-                    // TODO: list fields of output for RPC help instead ELISION
-                    {RPCResult::Type::ELISION, "", ""}
-                }
-            },
-            RPCResult{"for mode = all",
-                RPCResult::Type::STR, "", "The transaction hash in hex"
-            },
-        },
+        RPCResult{
+            RPCResult::Type::OBJ, "", "Deserialized governance object",
+            {
+                // TODO: list fields of output for RPC help instead ELISION
+                {RPCResult::Type::ELISION, "", ""}
+            }
+        },

Return the parsed object:

-    return u.write().c_str();
+    return u;
🤖 Prompt for AI Agents
In src/rpc/governance.cpp around lines 83 to 94, the RPC result currently
documents an OBJ but actually returns a STR and contains a stray alternate entry
"for mode = all"; update the implementation to return the parsed governance
object and adjust the RPCResult documentation accordingly: change the RPCResult
to Type::OBJ and replace the ELISION placeholder with concrete field entries
that mirror the parsed governance object fields (e.g., governance id, time,
payload, signature, status — list actual struct members), remove the stray
alternate RPCResult for "for mode = all", and ensure the function returns the
constructed object representation rather than a hex/string value so the doc and
output match.

Comment on lines 288 to 337
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "time", "Adjusted time for the last update, timestamp"},
{RPCResult::Type::STR, "timeStr", "Adjusted time for the last update, human friendly"},
{RPCResult::Type::ARR, "session", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "llmqType", "Name of quorum"},
{RPCResult::Type::NUM, "quorumIndex", "Relevant for rotation quorums only, for non rotating quorums is 0"},
{RPCResult::Type::OBJ, "status", "",
{
// TODO: list fields of output for RPC help instead ELISION
{RPCResult::Type::ELISION, "", ""},
}},
}},
},
},
{RPCResult::Type::ARR, "quorumConnections", "",
// TODO: list fields of output for RPC help instead ELISION
{{RPCResult::Type::ELISION, "", ""}},
},
{RPCResult::Type::ARR, "mineableCommitments", "",
// TODO: list fields of output for RPC help instead ELISION
{{RPCResult::Type::ELISION, "", ""}},
},
},
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Typo in documented key: “mineableCommitments” vs code “minableCommitments”

Help says “mineableCommitments”, but code produces key “minableCommitments” (Lines 343, 407). Align the help to match the output or rename the output; recommend updating the help to avoid breaking clients.

-                {RPCResult::Type::ARR, "mineableCommitments", "",
+                {RPCResult::Type::ARR, "minableCommitments", "",
                     // TODO: list fields of output for RPC help instead ELISION
                     {{RPCResult::Type::ELISION, "", ""}},
                 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "time", "Adjusted time for the last update, timestamp"},
{RPCResult::Type::STR, "timeStr", "Adjusted time for the last update, human friendly"},
{RPCResult::Type::ARR, "session", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "llmqType", "Name of quorum"},
{RPCResult::Type::NUM, "quorumIndex", "Relevant for rotation quorums only, for non rotating quorums is 0"},
{RPCResult::Type::OBJ, "status", "",
{
// TODO: list fields of output for RPC help instead ELISION
{RPCResult::Type::ELISION, "", ""},
}},
}},
},
},
{RPCResult::Type::ARR, "quorumConnections", "",
// TODO: list fields of output for RPC help instead ELISION
{{RPCResult::Type::ELISION, "", ""}},
},
{RPCResult::Type::ARR, "mineableCommitments", "",
// TODO: list fields of output for RPC help instead ELISION
{{RPCResult::Type::ELISION, "", ""}},
},
},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "time", "Adjusted time for the last update, timestamp"},
{RPCResult::Type::STR, "timeStr", "Adjusted time for the last update, human friendly"},
{RPCResult::Type::ARR, "session", "",
{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::NUM, "llmqType", "Name of quorum"},
{RPCResult::Type::NUM, "quorumIndex", "Relevant for rotation quorums only, for non rotating quorums is 0"},
{RPCResult::Type::OBJ, "status", "",
{
// TODO: list fields of output for RPC help instead ELISION
{RPCResult::Type::ELISION, "", ""},
}},
}},
},
},
{RPCResult::Type::ARR, "quorumConnections", "",
// TODO: list fields of output for RPC help instead ELISION
{{RPCResult::Type::ELISION, "", ""}},
},
{RPCResult::Type::ARR, "minableCommitments", "",
// TODO: list fields of output for RPC help instead ELISION
{{RPCResult::Type::ELISION, "", ""}},
},
},
},

@knst knst marked this pull request as draft October 15, 2025 19:54
PastaPastaPasta added a commit that referenced this pull request Oct 24, 2025
9af4c55 fix: typos and capitalizations (Konstantin Akimov)
690ff3a fix: apply suggestions from code review (Konstantin Akimov)
6e89094 fix: multiple code-review comments (Konstantin Akimov)
661db51 fix: add missing RPC help result for quorum RPCs (Konstantin Akimov)
72284b5 fix: add missing RPC help result for RPC getrawtransactionmulti (Konstantin Akimov)
7d6b606 fix: add missing RPC help result for evo RPCs (Konstantin Akimov)
3b4095c fix: add proper RPC result for governance RPC (Konstantin Akimov)
b216d13 fix: set proper RPCResult for coinjoin RPC (Konstantin Akimov)
b174fe0 fix: add missing RPC help result for RPC mockscheduler (Konstantin Akimov)
cc1a8fd fix: add missing RPC help result for masternode RPCs (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  For many dash specific RPC we use stub `RPCResults` instead real documentation for returned values.
  It was possible because some important changes from backport bitcoin#20495 has been skipped.

  ## What was done?
  Replaced all stub RPCResults{} in RPC code to real help, or map with ELISION inside.
  For some RPC replaced ELISION to real description.

  ## How Has This Been Tested?
  See PR #6887: done extra testing with backports  bitcoin#20495, bitcoin#25161, bitcoin#25170, bitcoin#24408, bitcoin#25237 and fixed all failures in functional tests.

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] 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
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 9af4c55
  kwvg:
    utACK 9af4c55

Tree-SHA512: 7b8842255050a9154ea4e2d8e7245888dfe96543c856b0e299b95e861156a2fc22a20abb882153ede75f901cfe420df344bbfd1c82364a7b44eb357c38fab4bb
@github-actions
Copy link

This pull request has conflicts, please rebase.

1 similar comment
@github-actions
Copy link

This pull request has conflicts, please rebase.

knst and others added 4 commits October 25, 2025 03:45
… runtime flag

b953ea6 rpc: Put undocumented JSON failure mode behind a runtime flag (Suhail Saqan)

Pull request description:

  Fixes bitcoin#24695 (Put undocumented JSON failure mode behind a runtime flag)

ACKs for top commit:
  luke-jr:
    utACK b953ea6
  vincenzopalazzo:
    ACK bitcoin@b953ea6

Tree-SHA512: 2005ee1b1f3b637918390b2ecd4166f2fd8c86e3c59fba3da8a0cbd5b1dffd03190c92f6dca3c489ecce4276eaf3108b2edcf9cd6224b713adb52f5bb848163b
fafae67 build: Enable RPC_DOC_CHECK on --enable-debug (MacroFake)

Pull request description:

  This probably makes no large difference, as the setting is already enabled by default in the functional tests. However, I think it is nice to also enable it in debug builds by default to catch issues while manually testing without the runtime flags specified.

  See also bitcoin#24709

ACKs for top commit:
  vincenzopalazzo:
    utACK bitcoin@fafae67

Tree-SHA512: cea3276fc9b5a3bc0f6d9819be9a50b19ecf762729d3e3975abdf00da06beaa3f664b18a826fbab1fedd9143bc0624a95a490bfe40c4b5b0a0f94dbc565ce738
20ff499 rpc: Capture potentially large UniValue by ref for rpcdoccheck (Martin Zumsande)

Pull request description:

  Capturing it by reference instead of value should save us from making a copy of a potentially large object. Saw this while having a look at bitcoin#25229 although I couldn't reproduce an actual leak, so this is not a fix for that issue.

ACKs for top commit:
  MarcoFalke:
    review ACK 20ff499
  theStack:
    Code-review ACK 20ff499
  furszy:
    Code ACK 20ff499

Tree-SHA512: faf7bb14e37f8324b93a39095b07693626329da47c4a1ac8929bf99385e2e0567008e959e7e8540bc7d454d08fa41cccd39f55253c9a839fa88362922058a93b
@knst knst marked this pull request as ready for review October 25, 2025 19:18
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR backports Bitcoin Core's RPC documentation validation system (bitcoin#24408, bitcoin#24959, bitcoin#25161, bitcoin#25170, bitcoin#25237), introducing runtime checks that verify RPC help documentation matches actual return values. The implementation adds a new -rpcdoccheck flag (enabled by default in debug builds via --enable-debug or explicitly via -Drpcdoccheck) that triggers non-fatal assertions when RPCResult specifications diverge from actual UniValue responses. The system works by capturing RPC function return values in RPCHelpMan::HandleRequest() and validating them against the documented RPCResult structure using MatchesType(). This backport required comprehensive documentation updates across the codebase, replacing numerous empty RPCResults{} placeholders with explicit field specifications. The functional test framework now enables this validation by default (rpcdoccheck=1) to catch documentation drift during testing. The change integrates with Dash's existing assertion infrastructure (CHECK_NONFATAL) to surface issues during development while avoiding production overhead.

Important Files Changed

Filename Score Overview
src/rpc/util.h 5/5 Added DEFAULT_RPC_DOC_CHECK compile-time constant controlled by RPC_DOC_CHECK preprocessor macro
configure.ac 5/5 Added -DRPC_DOC_CHECK to debug build flags via AX_CHECK_PREPROC_FLAG
src/init.cpp 5/5 Registered -rpcdoccheck command-line argument as DEBUG_ONLY flag
test/functional/test_framework/util.py 5/5 Enabled rpcdoccheck=1 in all functional test node configurations
src/rpc/util.cpp 5/5 Implemented runtime validation by capturing return values and checking against RPCResult specs
src/rpc/quorums.cpp 3.5/5 Added detailed RPCResult documentation for quorum commands; contains typo ("collaterial") and potential type mismatch (service field documented as NUM but likely returns string)

Confidence score: 4/5

  • This PR is safe to merge with minimal risk in production but requires attention to documentation accuracy issues flagged in previous reviews.
  • Score reflects solid implementation of the validation infrastructure itself, but deducted one point due to outstanding documentation issues identified in previous reviews (typos like "collaterial", type mismatches in service fields, and incorrect field names in other RPC files that may still exist).
  • Pay close attention to src/rpc/quorums.cpp and verify all previously flagged documentation issues in other RPC files (src/rpc/masternode.cpp, src/rpc/governance.cpp, src/rpc/evo.cpp mentioned in previous reviews) have been addressed before enabling this validation in production.

Context used:

  • Context from dashboard - CLAUDE.md (source)

6 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "proTxHash", "ProTx of collaterial"},
Copy link

Choose a reason for hiding this comment

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

syntax: Typo: 'collaterial' should be 'collateral'

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/rpc/quorums.cpp
Line: 259:259

Comment:
**syntax:** Typo: 'collaterial' should be 'collateral'

How can I resolve this? If you propose a fix, please make it concise.

{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "proTxHash", "ProTx of collaterial"},
{RPCResult::Type::NUM, "service", "Address of node. Legacy, will be deprecated in further versions. See `addresses` instead."},
Copy link

Choose a reason for hiding this comment

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

logic: Type mismatch: service field is documented as NUM but the value is a string (address). Should be STR or STR_ADDR.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/rpc/quorums.cpp
Line: 260:260

Comment:
**logic:** Type mismatch: `service` field is documented as NUM but the value is a string (address). Should be STR or STR_ADDR.

How can I resolve this? If you propose a fix, please make it concise.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 098367b and 5fe76ef.

📒 Files selected for processing (6)
  • configure.ac (1 hunks)
  • src/init.cpp (1 hunks)
  • src/rpc/quorums.cpp (3 hunks)
  • src/rpc/util.cpp (2 hunks)
  • src/rpc/util.h (1 hunks)
  • test/functional/test_framework/util.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • configure.ac
  • test/functional/test_framework/util.py
  • src/init.cpp
🧰 Additional context used
📓 Path-based instructions (1)
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/util.cpp
  • src/rpc/quorums.cpp
  • src/rpc/util.h
🧠 Learnings (1)
📓 Common learnings
Learnt from: kwvg
PR: dashpay/dash#6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
🧬 Code graph analysis (1)
src/rpc/util.cpp (1)
src/rpc/util.h (1)
  • DEFAULT_RPC_DOC_CHECK (26-32)
🪛 GitHub Actions: Clang Diff Format Check
src/rpc/quorums.cpp

[error] 1-1: Clang format differences found. Run clang-format-diff.py (or clang-format) to fix formatting in this file.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: linux64_nowallet-test / Test source
  • GitHub Check: linux64_multiprocess-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: win64-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64-build / Build source
🔇 Additional comments (6)
src/rpc/util.h (1)

26-32: LGTM!

The preprocessor-driven constant definition is clean and appropriate for controlling RPC documentation validation at compile time.

src/rpc/util.cpp (2)

17-17: LGTM!

The include is necessary to access gArgs for the runtime flag check added below.


539-543: LGTM!

The post-execution validation logic is sound. Using std::any_of correctly handles RPCResults with multiple alternatives, and CHECK_NONFATAL provides appropriate debug-time validation without crashing production builds.

src/rpc/quorums.cpp (3)

332-332: LGTM!

The documentation now correctly matches the implementation at line 428, which uses minableCommitments (not mineableCommitments). This addresses the typo flagged in the past review comment.


450-450: LGTM!

The updated help text is clearer and more grammatically correct than the original.


1-1: Verify formatting locally using clang-format.

The sandbox environment does not have clang-format available. Please run clang-format locally on your machine to identify and fix any formatting issues in src/rpc/quorums.cpp:

clang-format -i src/rpc/quorums.cpp
git diff src/rpc/quorums.cpp

After applying the formatting fixes, commit the changes and re-run the pipeline to confirm the clang-format-diff check passes.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@knst knst modified the milestones: 23, 23.1 Oct 25, 2025
Copy link
Collaborator

@kwvg kwvg left a comment

Choose a reason for hiding this comment

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

As we're enabling -rpcdoccheck, consider resolving the following TODOs

// TODO: Use CDeterministicMN::GetJsonHelp() for mn

// TODO: Use CDeterministicMNStateDiff::GetJsonHelp() for stateDiff

// TODO: Use CDeterministicMNState::GetJsonHelp() for dmnState

// TODO: Use CFinalCommitment::GetJsonHelp() for fqc

{
{RPCResult::Type::STR_HEX, "proTxHash", "ProTx of collaterial"},
{RPCResult::Type::STR, "service", "Address of node. Legacy, will be deprecated in further versions. See `addresses` instead."},
{RPCResult::Type::ARR, "addresses", "Addresses of node",
Copy link
Collaborator

@kwvg kwvg Oct 25, 2025

Choose a reason for hiding this comment

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

Please use GetRpcResult("addresses") (see example below)

dash/src/evo/core_write.cpp

Lines 498 to 508 in f650f65

RPCResult CSimplifiedMNListEntry::GetJsonHelp(const std::string& key, bool optional)
{
return {RPCResult::Type::OBJ, key, optional, key.empty() ? "" : "The simplified masternode list entry",
{
{RPCResult::Type::NUM, "nVersion", "Version of the entry"},
{RPCResult::Type::NUM, "nType", "Masternode type"},
{RPCResult::Type::STR_HEX, "proRegTxHash", "Hash of the ProRegTx identifying the masternode"},
{RPCResult::Type::STR_HEX, "confirmedHash", "Hash of the block where the masternode was confirmed"},
GetRpcResult("service"),
GetRpcResult("addresses"),
GetRpcResult("pubKeyOperator"),

It's forward declared in core_io.h (see below)

dash/src/core_io.h

Lines 60 to 61 in f650f65

// evo/core_write.cpp
RPCResult GetRpcResult(const std::string& key, bool optional = false);

// TODO - expand it when extended addresses are fully implemented
{{RPCResult::Type::ELISION, "", ""}},
},
{RPCResult::Type::STR_HEX, "pubKeyOperator", "The operator BLS public key"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

We've already defined pubKeyOperator (see below), please use GetRpcResult()

RESULT_MAP_ENTRY("pubKeyOperator", RPCResult::Type::STR, "BLS public key used for operator signing"),

{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "proTxHash", "ProTx of collaterial"},
{RPCResult::Type::STR, "service", "Address of node. Legacy, will be deprecated in further versions. See `addresses` instead."},
Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment, would keep deprecation text synced in all instances

RESULT_MAP_ENTRY("service", RPCResult::Type::STR, "(DEPRECATED) IP address and port of the masternode"),

{
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::STR_HEX, "proTxHash", "ProTx of collaterial"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment

RESULT_MAP_ENTRY("proTxHash", RPCResult::Type::STR_HEX, "Hash of the masternode's initial ProRegTx"),

{RPCResult::Type::NUM, "height", "Quorum Height"},
{RPCResult::Type::STR, "type", "Quorum type"},
{RPCResult::Type::STR_HEX, "quorumHash", "Quorum hash"},
{RPCResult::Type::NUM, "quorumIndex", "Quorum index (applicable only to rotated quorums)."},
Copy link
Collaborator

Choose a reason for hiding this comment

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

quorumIndex is defined twice (see below), consider adding it to RPCRESULT_MAP

{RPCResult::Type::NUM, "quorumIndex", "Quorum index (applicable only to rotated quorums)."},

{RPCResult::Type::NUM, "quorumIndex", "Relevant for rotation quorums only, 0 for non-rotating quorums"},

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: 1

🧹 Nitpick comments (1)
src/rpc/quorums.cpp (1)

252-252: Consider using GetRpcResult("quorumIndex") for consistency.

Since quorumIndex is now defined in RPCRESULT_MAP (src/evo/core_write.cpp line 61), consider using GetRpcResult("quorumIndex") instead of the inline definition for consistency with other fields in this result. As per coding guidelines.

Apply this diff if you'd like to align with the pattern:

-                {RPCResult::Type::NUM, "quorumIndex", "Quorum index (applicable only to rotated quorums)."},
+                GetRpcResult("quorumIndex"),

Note: The description in RPCRESULT_MAP is "Quorum index. Relevant for rotation quorums only, 0 for non-rotating quorums" which differs slightly from the inline "Quorum index (applicable only to rotated quorums)." You may want to align the descriptions as well.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 35ea486 and a3c3dda.

📒 Files selected for processing (2)
  • src/evo/core_write.cpp (1 hunks)
  • src/rpc/quorums.cpp (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
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/evo/core_write.cpp
  • src/rpc/quorums.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/core_write.cpp
🧠 Learnings (9)
📓 Common learnings
Learnt from: knst
Repo: dashpay/dash PR: 6916
File: src/univalue/include/univalue.h:81-88
Timestamp: 2025-10-25T07:08:51.918Z
Learning: For backport PRs from bitcoin/bitcoin, bitcoin-core/gui, etc., backported changes should match the original upstream PRs even if they appear strange, modify vendored code, or seem to violate coding guidelines. Still flag genuine issues like bugs, undefined behavior, crashes, compilation errors, or linter failures.
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: knst
Repo: dashpay/dash PR: 6883
File: src/rpc/rawtransaction.cpp:1088-1125
Timestamp: 2025-10-13T12:37:12.357Z
Learning: In backport pull requests (especially from Bitcoin Core), treat "moved" or refactored code as out-of-scope for content-level review. Focus validation on verifying that code is moved correctly: no fields added, no fields removed, no fields reordered, and no unexpected changes beyond whitespace adjustments. Pre-existing issues in the upstream code should be preserved to maintain fidelity to the original implementation.
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6786
File: ci/test/04_install.sh:99-101
Timestamp: 2025-08-01T07:46:37.840Z
Learning: In backport PRs like #6786, UdjinM6 prefers to defer non-critical fixes (such as shell command expansion issues) to separate commits/PRs to maintain focus on the primary backport objectives, consistent with the project's pattern of avoiding scope creep.
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.
Learnt from: PastaPastaPasta
Repo: dashpay/dash PR: 6804
File: src/qt/proposalwizard.cpp:40-42
Timestamp: 2025-08-11T17:16:36.654Z
Learning: In the Dash repository, when a PR adds new files that are not from Bitcoin backports, these files must be added to the list in test/util/data/non-backported.txt. This applies to newly created files like qt/proposalwizard.{h,cpp} and forms/proposalwizard.ui. Limited exemptions may exist for subtrees and similar cases.
📚 Learning: 2025-08-08T07:01:47.332Z
Learnt from: knst
Repo: dashpay/dash PR: 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.

Applied to files:

  • src/evo/core_write.cpp
  • src/rpc/quorums.cpp
📚 Learning: 2025-05-10T00:54:15.597Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6629
File: src/evo/deterministicmns.cpp:473-485
Timestamp: 2025-05-10T00:54:15.597Z
Learning: In the current implementation of `NetInfoEntry`, only `CService` is a valid type and `std::monostate` represents an invalid state. Entries that don't provide a valid `CService` through `GetAddrPort()` should be rejected with an exception, not silently skipped.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-02-14T15:19:17.218Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6529
File: src/wallet/rpcwallet.cpp:3002-3003
Timestamp: 2025-02-14T15:19:17.218Z
Learning: The `GetWallet()` function calls in `src/wallet/rpcwallet.cpp` are properly validated with null checks that throw appropriate RPC errors, making additional validation unnecessary.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-10-05T20:38:28.457Z
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-23T09:30:34.631Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/chainlock/signing.h:5-6
Timestamp: 2025-07-23T09:30:34.631Z
Learning: Dash Core uses BITCOIN_ prefix for header guards as the standard convention, inherited from Bitcoin Core. Only a few BLS-specific files in src/bls/ use DASH_ prefix. The vast majority of files (385+) use BITCOIN_ prefix.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-19T14:57:31.801Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-19T15:08:00.835Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/commitment.cpp:54-60
Timestamp: 2025-08-19T15:08:00.835Z
Learning: In Dash Core, llmq_params.size == 1 is used only for regtest environments, not on public networks, which significantly reduces the risk profile of code paths specific to single-member quorums.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-15T14:53:04.819Z
Learnt from: knst
Repo: dashpay/dash PR: 6691
File: src/test/llmq_params_tests.cpp:148-151
Timestamp: 2025-07-15T14:53:04.819Z
Learning: In the Dash Core LLMQ implementation, signingActiveQuorumCount is never 0 in the actual parameters defined in params.h, making division by zero scenarios unrealistic in the max_cycles() function.

Applied to files:

  • src/rpc/quorums.cpp
🧬 Code graph analysis (1)
src/rpc/quorums.cpp (1)
src/evo/core_write.cpp (2)
  • GetRpcResult (74-82)
  • GetRpcResult (74-74)
🪛 GitHub Actions: Clang Diff Format Check
src/rpc/quorums.cpp

[error] 1-1: Clang format differences found. Run the clang-format-diff tool to fix formatting. Command failed: 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

🔇 Additional comments (3)
src/rpc/quorums.cpp (3)

316-316: Good use of GetRpcResult("quorumIndex").

This correctly references the centralized definition from RPCRESULT_MAP, aligning with the pattern established in other RPC help definitions.


329-329: Correct fix for the documentation mismatch.

This change aligns the RPC help documentation with the actual output key name minableCommitments used at line 425, addressing the past review comment about the typo mismatch.


447-447: LGTM: Clear reference to detailed documentation.

The help text update appropriately directs users to help quorum info for field details, avoiding duplication while providing clear guidance.

Copy link
Collaborator

@kwvg kwvg left a comment

Choose a reason for hiding this comment

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

One more pending quorumIndex use, otherwise LGTM

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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9382fc2 and 2883bdd.

📒 Files selected for processing (1)
  • src/rpc/quorums.cpp (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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/quorums.cpp
🧠 Learnings (9)
📓 Common learnings
Learnt from: knst
Repo: dashpay/dash PR: 6916
File: src/univalue/include/univalue.h:81-88
Timestamp: 2025-10-25T07:08:51.918Z
Learning: For backport PRs from bitcoin/bitcoin, bitcoin-core/gui, etc., backported changes should match the original upstream PRs even if they appear strange, modify vendored code, or seem to violate coding guidelines. Still flag genuine issues like bugs, undefined behavior, crashes, compilation errors, or linter failures.
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: knst
Repo: dashpay/dash PR: 6883
File: src/rpc/rawtransaction.cpp:1088-1125
Timestamp: 2025-10-13T12:37:12.357Z
Learning: In backport pull requests (especially from Bitcoin Core), treat "moved" or refactored code as out-of-scope for content-level review. Focus validation on verifying that code is moved correctly: no fields added, no fields removed, no fields reordered, and no unexpected changes beyond whitespace adjustments. Pre-existing issues in the upstream code should be preserved to maintain fidelity to the original implementation.
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6786
File: ci/test/04_install.sh:99-101
Timestamp: 2025-08-01T07:46:37.840Z
Learning: In backport PRs like #6786, UdjinM6 prefers to defer non-critical fixes (such as shell command expansion issues) to separate commits/PRs to maintain focus on the primary backport objectives, consistent with the project's pattern of avoiding scope creep.
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Learnt from: PastaPastaPasta
Repo: dashpay/dash PR: 6804
File: src/qt/proposalwizard.cpp:40-42
Timestamp: 2025-08-11T17:16:36.654Z
Learning: In the Dash repository, when a PR adds new files that are not from Bitcoin backports, these files must be added to the list in test/util/data/non-backported.txt. This applies to newly created files like qt/proposalwizard.{h,cpp} and forms/proposalwizard.ui. Limited exemptions may exist for subtrees and similar cases.
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.
📚 Learning: 2025-08-08T07:01:47.332Z
Learnt from: knst
Repo: dashpay/dash PR: 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.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-05-10T00:54:15.597Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6629
File: src/evo/deterministicmns.cpp:473-485
Timestamp: 2025-05-10T00:54:15.597Z
Learning: In the current implementation of `NetInfoEntry`, only `CService` is a valid type and `std::monostate` represents an invalid state. Entries that don't provide a valid `CService` through `GetAddrPort()` should be rejected with an exception, not silently skipped.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-02-14T15:19:17.218Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6529
File: src/wallet/rpcwallet.cpp:3002-3003
Timestamp: 2025-02-14T15:19:17.218Z
Learning: The `GetWallet()` function calls in `src/wallet/rpcwallet.cpp` are properly validated with null checks that throw appropriate RPC errors, making additional validation unnecessary.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-10-05T20:38:28.457Z
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-23T09:30:34.631Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/chainlock/signing.h:5-6
Timestamp: 2025-07-23T09:30:34.631Z
Learning: Dash Core uses BITCOIN_ prefix for header guards as the standard convention, inherited from Bitcoin Core. Only a few BLS-specific files in src/bls/ use DASH_ prefix. The vast majority of files (385+) use BITCOIN_ prefix.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-19T14:57:31.801Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-19T15:08:00.835Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/commitment.cpp:54-60
Timestamp: 2025-08-19T15:08:00.835Z
Learning: In Dash Core, llmq_params.size == 1 is used only for regtest environments, not on public networks, which significantly reduces the risk profile of code paths specific to single-member quorums.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-15T14:53:04.819Z
Learnt from: knst
Repo: dashpay/dash PR: 6691
File: src/test/llmq_params_tests.cpp:148-151
Timestamp: 2025-07-15T14:53:04.819Z
Learning: In the Dash Core LLMQ implementation, signingActiveQuorumCount is never 0 in the actual parameters defined in params.h, making division by zero scenarios unrealistic in the max_cycles() function.

Applied to files:

  • src/rpc/quorums.cpp
🔇 Additional comments (4)
src/rpc/quorums.cpp (4)

329-329: LGTM! Documentation now matches implementation.

The field name has been corrected to minableCommitments to match the actual output key used in the implementation (line 425).


316-316: LGTM! Proper use of GetRpcResult for consistency.

Using GetRpcResult("quorumIndex") ensures consistent documentation across different RPC methods.


251-252: LGTM! Excellent use of GetRpcResult for shared fields.

Using GetRpcResult() for quorumHash, quorumIndex, proTxHash, service, addresses, and pubKeyOperator ensures consistent type definitions and descriptions across all RPC methods that return these fields.

Also applies to: 259-262


447-447: LGTM! Appropriate use of cross-reference.

Using ELISION with a reference to help quorum info is a good approach to avoid duplicating detailed documentation.

@knst knst requested a review from kwvg November 4, 2025 13:42
kwvg
kwvg previously approved these changes Nov 4, 2025
Copy link
Collaborator

@kwvg kwvg left a comment

Choose a reason for hiding this comment

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

utACK 2883bdd

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.

Looks good overall but pls check coderabbit's suggestions

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

see udjin / coderabbit

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2883bdd and 449d7fa.

📒 Files selected for processing (1)
  • src/rpc/quorums.cpp (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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/quorums.cpp
🧠 Learnings (17)
📓 Common learnings
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: knst
Repo: dashpay/dash PR: 6916
File: src/univalue/include/univalue.h:81-88
Timestamp: 2025-10-25T07:08:51.918Z
Learning: For backport PRs from bitcoin/bitcoin, bitcoin-core/gui, etc., backported changes should match the original upstream PRs even if they appear strange, modify vendored code, or seem to violate coding guidelines. Still flag genuine issues like bugs, undefined behavior, crashes, compilation errors, or linter failures.
Learnt from: knst
Repo: dashpay/dash PR: 6883
File: src/rpc/rawtransaction.cpp:1088-1125
Timestamp: 2025-10-13T12:37:12.357Z
Learning: In backport pull requests (especially from Bitcoin Core), treat "moved" or refactored code as out-of-scope for content-level review. Focus validation on verifying that code is moved correctly: no fields added, no fields removed, no fields reordered, and no unexpected changes beyond whitespace adjustments. Pre-existing issues in the upstream code should be preserved to maintain fidelity to the original implementation.
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6786
File: ci/test/04_install.sh:99-101
Timestamp: 2025-08-01T07:46:37.840Z
Learning: In backport PRs like #6786, UdjinM6 prefers to defer non-critical fixes (such as shell command expansion issues) to separate commits/PRs to maintain focus on the primary backport objectives, consistent with the project's pattern of avoiding scope creep.
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Learnt from: PastaPastaPasta
Repo: dashpay/dash PR: 6804
File: src/qt/proposalwizard.cpp:40-42
Timestamp: 2025-08-11T17:16:36.654Z
Learning: In the Dash repository, when a PR adds new files that are not from Bitcoin backports, these files must be added to the list in test/util/data/non-backported.txt. This applies to newly created files like qt/proposalwizard.{h,cpp} and forms/proposalwizard.ui. Limited exemptions may exist for subtrees and similar cases.
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.
📚 Learning: 2025-08-08T07:01:47.332Z
Learnt from: knst
Repo: dashpay/dash PR: 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.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-11-04T18:24:27.241Z
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6933
File: src/llmq/utils.cpp:284-298
Timestamp: 2025-11-04T18:24:27.241Z
Learning: In consensus-critical code (such as quorum formation, block validation, or deployment activation logic), do not suggest changes to the logic itself even if the implementation appears theoretically incorrect or off-by-one. Consensus rules, once deployed on the Dash network, must be preserved exactly to avoid network forks. Refactoring PRs should maintain perfect behavioral equivalence. Only suggest logic changes if explicitly accompanied by a DIP (Dash Improvement Proposal) or if the maintainer indicates the consensus rule needs to be changed with appropriate activation logic.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-05-10T00:54:15.597Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6629
File: src/evo/deterministicmns.cpp:473-485
Timestamp: 2025-05-10T00:54:15.597Z
Learning: In the current implementation of `NetInfoEntry`, only `CService` is a valid type and `std::monostate` represents an invalid state. Entries that don't provide a valid `CService` through `GetAddrPort()` should be rejected with an exception, not silently skipped.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-02-14T15:19:17.218Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6529
File: src/wallet/rpcwallet.cpp:3002-3003
Timestamp: 2025-02-14T15:19:17.218Z
Learning: The `GetWallet()` function calls in `src/wallet/rpcwallet.cpp` are properly validated with null checks that throw appropriate RPC errors, making additional validation unnecessary.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-10-05T20:38:28.457Z
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-23T09:30:34.631Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/chainlock/signing.h:5-6
Timestamp: 2025-07-23T09:30:34.631Z
Learning: Dash Core uses BITCOIN_ prefix for header guards as the standard convention, inherited from Bitcoin Core. Only a few BLS-specific files in src/bls/ use DASH_ prefix. The vast majority of files (385+) use BITCOIN_ prefix.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-19T14:57:31.801Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-19T15:08:00.835Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/commitment.cpp:54-60
Timestamp: 2025-08-19T15:08:00.835Z
Learning: In Dash Core, llmq_params.size == 1 is used only for regtest environments, not on public networks, which significantly reduces the risk profile of code paths specific to single-member quorums.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-15T14:53:04.819Z
Learnt from: knst
Repo: dashpay/dash PR: 6691
File: src/test/llmq_params_tests.cpp:148-151
Timestamp: 2025-07-15T14:53:04.819Z
Learning: In the Dash Core LLMQ implementation, signingActiveQuorumCount is never 0 in the actual parameters defined in params.h, making division by zero scenarios unrealistic in the max_cycles() function.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-10-25T07:08:51.918Z
Learnt from: knst
Repo: dashpay/dash PR: 6916
File: src/univalue/include/univalue.h:81-88
Timestamp: 2025-10-25T07:08:51.918Z
Learning: For backport PRs from bitcoin/bitcoin, bitcoin-core/gui, etc., backported changes should match the original upstream PRs even if they appear strange, modify vendored code, or seem to violate coding guidelines. Still flag genuine issues like bugs, undefined behavior, crashes, compilation errors, or linter failures.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-11T17:16:36.654Z
Learnt from: PastaPastaPasta
Repo: dashpay/dash PR: 6804
File: src/qt/proposalwizard.cpp:40-42
Timestamp: 2025-08-11T17:16:36.654Z
Learning: In the Dash repository, when a PR adds new files that are not from Bitcoin backports, these files must be added to the list in test/util/data/non-backported.txt. This applies to newly created files like qt/proposalwizard.{h,cpp} and forms/proposalwizard.ui. Limited exemptions may exist for subtrees and similar cases.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-08-01T07:46:37.840Z
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6786
File: ci/test/04_install.sh:99-101
Timestamp: 2025-08-01T07:46:37.840Z
Learning: In backport PRs like #6786, UdjinM6 prefers to defer non-critical fixes (such as shell command expansion issues) to separate commits/PRs to maintain focus on the primary backport objectives, consistent with the project's pattern of avoiding scope creep.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-10-13T12:37:12.357Z
Learnt from: knst
Repo: dashpay/dash PR: 6883
File: src/rpc/rawtransaction.cpp:1088-1125
Timestamp: 2025-10-13T12:37:12.357Z
Learning: In backport pull requests (especially from Bitcoin Core), treat "moved" or refactored code as out-of-scope for content-level review. Focus validation on verifying that code is moved correctly: no fields added, no fields removed, no fields reordered, and no unexpected changes beyond whitespace adjustments. Pre-existing issues in the upstream code should be preserved to maintain fidelity to the original implementation.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-06-09T16:43:20.996Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-29T14:32:48.369Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/chainlock/signing.cpp:247-250
Timestamp: 2025-07-29T14:32:48.369Z
Learning: In PR #6761, kwvg acknowledged a null pointer check issue in ChainLockSigner::Cleanup() method but deferred it to follow-up, consistent with the pattern of avoiding scope creep in refactoring PRs.

Applied to files:

  • src/rpc/quorums.cpp
📚 Learning: 2025-07-29T14:33:01.040Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/wallet/wallet.cpp:0-0
Timestamp: 2025-07-29T14:33:01.040Z
Learning: In refactoring PRs like #6761, kwvg acknowledges code safety improvements (like null pointer checks and unused parameter warnings) but prefers to defer them to follow-up PRs to maintain focus on the primary refactoring objectives, avoiding scope creep.

Applied to files:

  • src/rpc/quorums.cpp
🧬 Code graph analysis (1)
src/rpc/quorums.cpp (1)
src/evo/core_write.cpp (2)
  • GetRpcResult (74-82)
  • GetRpcResult (74-74)
🪛 GitHub Actions: Clang Diff Format Check
src/rpc/quorums.cpp

[error] 1-1: Clang format differences found in src/rpc/quorums.cpp. Run the clang-format-diff.py tool (via the diff_output hook) to fix formatting issues. Command step: 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

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build container / Build container
🔇 Additional comments (4)
src/rpc/quorums.cpp (4)

249-267: LGTM: RPC schema documentation correctly implements reviewer feedback.

The RPCResult schema properly documents all fields returned by BuildQuorumInfo, uses GetRpcResult() helpers for reusable fields, includes the conditional note for previousConsecutiveDKGFailures, and documents the optional pubKeyShare field with corrected grammar.


317-317: LGTM: Consistent use of GetRpcResult() helper.

Using GetRpcResult("quorumIndex") maintains consistency across quorum RPC documentation.


330-330: LGTM: Documentation now matches code output.

The field name "minableCommitments" correctly matches the key used in the actual output at line 426, addressing the previously flagged typo.


448-448: LGTM: Helpful cross-reference to detailed documentation.

The updated help text appropriately directs users to quorum info for field details.

Comment on lines +249 to +267
{RPCResult::Type::NUM, "height", "Quorum Height"},
{RPCResult::Type::STR, "type", "Quorum type"},
GetRpcResult("quorumHash"),
GetRpcResult("quorumIndex"),
{RPCResult::Type::STR_HEX, "minedBlock", "Blockhash where the commitment was mined."},
{RPCResult::Type::NUM, "previousConsecutiveDKGFailures", "Number of previous consecutive DKG failures. Only present for rotation-enabled quorums."},
{RPCResult::Type::ARR, "members", "Members of quorum",
{
{RPCResult::Type::OBJ, "", "",
{
GetRpcResult("proTxHash"),
GetRpcResult("service"),
GetRpcResult("addresses"),
GetRpcResult("pubKeyOperator"),
{RPCResult::Type::BOOL, "valid", "True if member is valid for this DKG"},
{RPCResult::Type::STR_HEX, "pubKeyShare", /*optional=*/true, "Share of BLS public key of the member. Only present if member is valid."}
}},
},
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix clang-format violations to pass CI checks.

The CI pipeline reports clang-format differences in this file. Run the formatting tool to resolve this before merge.

#!/bin/bash
# Apply clang-format to fix formatting issues
git diff -U0 origin/develop -- src/rpc/quorums.cpp | ./contrib/devtools/clang-format-diff.py -p1 -i
🤖 Prompt for AI Agents
In src/rpc/quorums.cpp around lines 249 to 267 there are clang-format style
violations; run the repository's clang-format diff tool or clang-format directly
to reformat this file (for example run the provided script: git diff -U0
origin/develop -- src/rpc/quorums.cpp | ./contrib/devtools/clang-format-diff.py
-p1 -i or run clang-format with the project config), stage and commit the
resulting changes so CI no longer reports formatting differences.

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 449d7fa

@PastaPastaPasta PastaPastaPasta merged commit e12d2a7 into dashpay:develop Nov 13, 2025
55 of 61 checks passed
@knst knst deleted the bp-v24-p5 branch November 15, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants