Skip to content

Commit 3a27f30

Browse files
Merge dashpay#6811: docs(rpc): revert gating of service/address behind -deprecatedrpc=service, mark platform{P2P,HTTP}Port as deprecated
ed3db7c docs: mark `platformP2PPort` and `platformHTTPPort` as deprecated (Kittywhiskers Van Gogh) ac77d42 docs: clarify that deprecation extends to `address` in `masternodelist` (Kittywhiskers Van Gogh) bbcd9d5 rpc: remove `-deprecatedrpc=service` gating for `service` (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * dashpay#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 - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK ed3db7c Tree-SHA512: 44c524f01b829c3890c88ada19dd5da547a7b0df28f70b750196aabfc61cb0b5598359df649b78147a05fba41bfae474b4411aeae0632b701dde1004576a5396
2 parents 181b0ba + ed3db7c commit 3a27f30

File tree

11 files changed

+30
-91
lines changed

11 files changed

+30
-91
lines changed

doc/release-notes-6665.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Updated RPCs
66

77
* The key `service` has been deprecated for some RPCs (`decoderawtransaction`, `decodepsbt`, `getblock`, `getrawtransaction`,
88
`gettransaction`, `masternode status` (only for the `dmnState` key), `protx diff`, `protx listdiff`) and has been replaced
9-
with the field `addresses`.
10-
* The deprecated field can be re-enabled using `-deprecatedrpc=service` but is liable to be removed in future versions
9+
with the key `addresses`.
10+
* This deprecation also extends to the functionally identical key, `address` in `masternode list` (and its alias, `masternodelist`)
11+
* The deprecated key is still available without additional runtime arguments but is liable to be removed in future versions
1112
of Dash Core.
1213
* This change does not affect `masternode status` (except for the `dmnState` key) as `service` does not represent a payload
1314
value but the external address advertised by the active masternode.

doc/release-notes-6811.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Updated RPCs
2+
------------
3+
4+
* The keys `platformP2PPort` and `platformHTTPPort` have been deprecated for the following RPCs, `decoderawtransaction`,
5+
`decodepsbt`, `getblock`, `getrawtransaction`, `gettransaction`, `masternode status` (only the `dmnState` key),
6+
`protx diff`, `protx listdiff` and has been replaced with the key `addresses`.
7+
* The deprecated key is still available without additional runtime arguments but is liable to be removed in future versions
8+
of Dash Core.

src/coinjoin/client.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,9 +1873,7 @@ void CCoinJoinClientSession::GetJsonInfo(UniValue& obj) const
18731873
assert(mixingMasternode->pdmnState);
18741874
obj.pushKV("protxhash", mixingMasternode->proTxHash.ToString());
18751875
obj.pushKV("outpoint", mixingMasternode->collateralOutpoint.ToStringShort());
1876-
if (m_wallet->chain().rpcEnableDeprecated("service")) {
1877-
obj.pushKV("service", mixingMasternode->pdmnState->netInfo->GetPrimary().ToStringAddrPort());
1878-
}
1876+
obj.pushKV("service", mixingMasternode->pdmnState->netInfo->GetPrimary().ToStringAddrPort());
18791877
obj.pushKV("addrs_core_p2p", mixingMasternode->pdmnState->netInfo->ToJson(NetInfoPurpose::CORE_P2P));
18801878
}
18811879
obj.pushKV("denomination", ValueFromAmount(CoinJoin::DenominationToAmount(nSessionDenom)));

src/evo/core_write.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@
7272
ret.pushKV("type", ToUnderlying(nType));
7373
ret.pushKV("collateralHash", collateralOutpoint.hash.ToString());
7474
ret.pushKV("collateralIndex", collateralOutpoint.n);
75-
if (IsServiceDeprecatedRPCEnabled()) {
76-
ret.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
77-
}
75+
ret.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
7876
ret.pushKV("addresses", GetNetInfoWithLegacyFields(*this, nType));
7977
ret.pushKV("ownerAddress", EncodeDestination(PKHash(keyIDOwner)));
8078
ret.pushKV("votingAddress", EncodeDestination(PKHash(keyIDVoting)));
@@ -122,9 +120,7 @@
122120
ret.pushKV("version", nVersion);
123121
ret.pushKV("type", ToUnderlying(nType));
124122
ret.pushKV("proTxHash", proTxHash.ToString());
125-
if (IsServiceDeprecatedRPCEnabled()) {
126-
ret.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
127-
}
123+
ret.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
128124
ret.pushKV("addresses", GetNetInfoWithLegacyFields(*this, nType));
129125
if (CTxDestination dest; ExtractDestination(scriptOperatorPayout, dest)) {
130126
ret.pushKV("operatorPayoutAddress", EncodeDestination(dest));
@@ -162,9 +158,7 @@
162158
obj.pushKV("nType", ToUnderlying(nType));
163159
obj.pushKV("proRegTxHash", proRegTxHash.ToString());
164160
obj.pushKV("confirmedHash", confirmedHash.ToString());
165-
if (IsServiceDeprecatedRPCEnabled()) {
166-
obj.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
167-
}
161+
obj.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
168162
obj.pushKV("addresses", GetNetInfoWithLegacyFields(*this, nType));
169163
obj.pushKV("pubKeyOperator", pubKeyOperator.ToString());
170164
obj.pushKV("votingAddress", EncodeDestination(PKHash(keyIDVoting)));

src/evo/dmnstate.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ UniValue CDeterministicMNState::ToJson(MnType nType) const
3636
{
3737
UniValue obj(UniValue::VOBJ);
3838
obj.pushKV("version", nVersion);
39-
if (IsServiceDeprecatedRPCEnabled()) {
40-
obj.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
41-
}
39+
obj.pushKV("service", netInfo->GetPrimary().ToStringAddrPort());
4240
obj.pushKV("addresses", GetNetInfoWithLegacyFields(*this, nType));
4341
obj.pushKV("registeredHeight", nRegisteredHeight);
4442
obj.pushKV("lastPaidHeight", nLastPaidHeight);
@@ -73,9 +71,7 @@ UniValue CDeterministicMNStateDiff::ToJson(MnType nType) const
7371
obj.pushKV("version", state.nVersion);
7472
}
7573
if (fields & Field_netInfo) {
76-
if (IsServiceDeprecatedRPCEnabled()) {
77-
obj.pushKV("service", state.netInfo->GetPrimary().ToStringAddrPort());
78-
}
74+
obj.pushKV("service", state.netInfo->GetPrimary().ToStringAddrPort());
7975
}
8076
if (fields & Field_nRegisteredHeight) {
8177
obj.pushKV("registeredHeight", state.nRegisteredHeight);

src/evo/netinfo.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ UniValue ArrFromService(const CService& addr)
4242
return obj;
4343
}
4444

45-
bool IsServiceDeprecatedRPCEnabled()
46-
{
47-
const auto args = gArgs.GetArgs("-deprecatedrpc");
48-
return std::find(args.begin(), args.end(), "service") != args.end();
49-
}
50-
5145
bool NetInfoEntry::operator==(const NetInfoEntry& rhs) const
5246
{
5347
if (m_type != rhs.m_type) return false;

src/evo/netinfo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ constexpr std::string_view PurposeToString(const NetInfoPurpose purpose)
100100
/** Will return true if node is running on mainnet */
101101
bool IsNodeOnMainnet();
102102

103-
/** Identical to IsDeprecatedRPCEnabled("service"). For use outside of RPC code */
104-
bool IsServiceDeprecatedRPCEnabled();
105-
106103
/** Creates a one-element array using CService::ToStringPortAddr() output */
107104
UniValue ArrFromService(const CService& addr);
108105

src/rpc/coinjoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static RPCHelpMan getcoinjoininfo()
433433
{
434434
{RPCResult::Type::STR_HEX, "protxhash", "The ProTxHash of the masternode"},
435435
{RPCResult::Type::STR_HEX, "outpoint", "The outpoint of the masternode"},
436-
{RPCResult::Type::STR, "service", "The IP address and port of the masternode (DEPRECATED, returned only if config option -deprecatedrpc=service is passed)"},
436+
{RPCResult::Type::STR, "service", "(DEPRECATED) The IP address and port of the masternode"},
437437
{RPCResult::Type::ARR, "addrs_core_p2p", "Network addresses of the masternode used for protocol P2P",
438438
{
439439
{RPCResult::Type::STR, "address", ""},

src/rpc/masternode.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,7 @@ static RPCHelpMan masternodelist_helper(bool is_composite)
614614
strOutpoint.find(strFilter) == std::string::npos) return;
615615
UniValue objMN(UniValue::VOBJ);
616616
objMN.pushKV("proTxHash", dmn.proTxHash.ToString());
617-
if (IsDeprecatedRPCEnabled("service")) {
618-
objMN.pushKV("address", dmn.pdmnState->netInfo->GetPrimary().ToStringAddrPort());
619-
}
617+
objMN.pushKV("address", dmn.pdmnState->netInfo->GetPrimary().ToStringAddrPort());
620618
objMN.pushKV("addresses", GetNetInfoWithLegacyFields(*dmn.pdmnState, dmn.nType));
621619
objMN.pushKV("payee", payeeStr);
622620
objMN.pushKV("status", dmnToStatus(dmn));

src/rpc/quorums.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ static UniValue BuildQuorumInfo(const llmq::CQuorumBlockProcessor& quorum_block_
206206
const auto& dmn = quorum->members[i];
207207
UniValue mo(UniValue::VOBJ);
208208
mo.pushKV("proTxHash", dmn->proTxHash.ToString());
209-
if (IsDeprecatedRPCEnabled("service")) {
210-
mo.pushKV("service", dmn->pdmnState->netInfo->GetPrimary().ToStringAddrPort());
211-
}
209+
mo.pushKV("service", dmn->pdmnState->netInfo->GetPrimary().ToStringAddrPort());
212210
mo.pushKV("addresses", GetNetInfoWithLegacyFields(*dmn->pdmnState, dmn->nType));
213211
mo.pushKV("pubKeyOperator", dmn->pdmnState->pubKeyOperator.ToString());
214212
mo.pushKV("valid", static_cast<bool>(quorum->qc->validMembers[i]));

0 commit comments

Comments
 (0)