diff --git a/configure.ac b/configure.ac index d216ffd04eba..a1915299946b 100644 --- a/configure.ac +++ b/configure.ac @@ -375,6 +375,7 @@ if test "$enable_debug" = "yes"; then AX_CHECK_PREPROC_FLAG([-DDEBUG_CORE], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_CORE"], [], [$CXXFLAG_WERROR]) AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"], [], [$CXXFLAG_WERROR]) AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKCONTENTION], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKCONTENTION"], [], [$CXXFLAG_WERROR]) + AX_CHECK_PREPROC_FLAG([-DRPC_DOC_CHECK], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DRPC_DOC_CHECK"], [], [$CXXFLAG_WERROR]) AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR]) AX_CHECK_COMPILE_FLAG([-ftrapv], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"], [], [$CXXFLAG_WERROR]) else diff --git a/src/evo/core_write.cpp b/src/evo/core_write.cpp index 4e83e8bc4630..0779abe51893 100644 --- a/src/evo/core_write.cpp +++ b/src/evo/core_write.cpp @@ -58,6 +58,7 @@ const std::map RPCRESULT_MAP{{ RESULT_MAP_ENTRY("PoSeRevivedHeight", RPCResult::Type::NUM, "Height masternode recovered from Proof of Service violations"), RESULT_MAP_ENTRY("proTxHash", RPCResult::Type::STR_HEX, "Hash of the masternode's initial ProRegTx"), RESULT_MAP_ENTRY("pubKeyOperator", RPCResult::Type::STR, "BLS public key used for operator signing"), + RESULT_MAP_ENTRY("quorumIndex", RPCResult::Type::NUM, "Quorum index. Relevant for rotation quorums only, 0 for non-rotating quorums"), RESULT_MAP_ENTRY("quorumHash", RPCResult::Type::STR_HEX, "Hash of the quorum"), RESULT_MAP_ENTRY("quorumSig", RPCResult::Type::STR_HEX, "BLS recovered threshold signature of quorum"), RESULT_MAP_ENTRY("registeredHeight", RPCResult::Type::NUM, "Height masternode was registered"), diff --git a/src/init.cpp b/src/init.cpp index 18d1cafe92c8..cb7eda0f5d3d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -775,6 +775,7 @@ void SetupServerArgs(ArgsManager& argsman) argsman.AddArg("-rpcallowip=", "Allow JSON-RPC connections from specified source. Valid values for are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0), a network/CIDR (e.g. 1.2.3.4/24), all ipv4 (0.0.0.0/0), or all ipv6 (::/0). This option can be specified multiple times", ArgsManager::ALLOW_ANY, OptionsCategory::RPC); argsman.AddArg("-rpcauth=", "Username and HMAC-SHA-256 hashed password for JSON-RPC connections. The field comes in the format: :$. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=/rpcpassword= pair of arguments. This option can be specified multiple times", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC); argsman.AddArg("-rpcbind=[:port]", "Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC); + argsman.AddArg("-rpcdoccheck", strprintf("Throw a non-fatal error at runtime if the documentation for an RPC is incorrect (default: %u)", DEFAULT_RPC_DOC_CHECK), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC); argsman.AddArg("-rpccookiefile=", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC); argsman.AddArg("-rpcexternaluser=", "List of comma-separated usernames for JSON-RPC external connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC); argsman.AddArg("-rpcexternalworkqueue=", strprintf("Set the depth of the work queue to service external RPC calls (default: %d)", DEFAULT_HTTP_WORKQUEUE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC); diff --git a/src/rpc/quorums.cpp b/src/rpc/quorums.cpp index be9eb66a3d7f..de50c24b570e 100644 --- a/src/rpc/quorums.cpp +++ b/src/rpc/quorums.cpp @@ -246,7 +246,25 @@ static RPCHelpMan quorum_info() RPCResult{ RPCResult::Type::OBJ, "", "", { - {RPCResult::Type::ELISION, "", ""} + {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."} + }}, + }, + }, }, }, RPCExamples{""}, @@ -296,7 +314,7 @@ static RPCHelpMan quorum_dkgstatus() {RPCResult::Type::OBJ, "", "", { {RPCResult::Type::NUM, "llmqType", "Name of quorum"}, - {RPCResult::Type::NUM, "quorumIndex", "Relevant for rotation quorums only, 0 for non-rotating quorums"}, + GetRpcResult("quorumIndex"), {RPCResult::Type::OBJ, "status", "", { // TODO: list fields of output for RPC help instead ELISION @@ -309,7 +327,7 @@ static RPCHelpMan quorum_dkgstatus() // TODO: list fields of output for RPC help instead ELISION {{RPCResult::Type::ELISION, "", ""}}, }, - {RPCResult::Type::ARR, "mineableCommitments", "", + {RPCResult::Type::ARR, "minableCommitments", "", // TODO: list fields of output for RPC help instead ELISION {{RPCResult::Type::ELISION, "", ""}}, }, @@ -427,7 +445,7 @@ static RPCHelpMan quorum_memberof() { {RPCResult::Type::OBJ, "", "Quorum Info", { - {RPCResult::Type::ELISION, "", "See for details help for `quorum info`"}, + {RPCResult::Type::ELISION, "", "See `help quorum info` for details"}, {RPCResult::Type::BOOL, "isValidMember", ""}, {RPCResult::Type::NUM, "memberIndex", ""}, }}, diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 60d7ddd10104..da552c410f5f 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -12,9 +12,9 @@ #include