mirror of https://github.com/zcash/zcash.git
Deprecate old hash fields of `getblocktemplate`
This commit is contained in:
parent
09cd65327b
commit
0ff86213ce
|
@ -37,6 +37,7 @@ the node, or if an `allowdeprecated=none` line is added to `zcash.conf`.
|
|||
|
||||
| `feature` | Deprecated | Feature details
|
||||
|-----------------------|------------|----------------
|
||||
| `gbt_oldhashes` | 5.4.0 | The `finalsaplingroothash`, `lightclientroothash`, and `blockcommitmentshash` fields in the output of `getblocktemplate`, which are replaced by the `defaultroots` field.
|
||||
|
||||
Stage 2
|
||||
-------
|
||||
|
|
|
@ -17,6 +17,15 @@ RPC Changes
|
|||
[Deprecations](https://zcash.github.io/zcash/user/deprecation.html)
|
||||
--------------
|
||||
|
||||
The following features have been deprecated, but remain available by default.
|
||||
These features may be disabled by setting `-allowdeprecated=none`. 18 weeks
|
||||
after this release, these features will be disabled by default and the following
|
||||
flags to `-allowdeprecated` will be required to permit their continued use:
|
||||
|
||||
- `gbt_oldhashes`: the `finalsaplingroothash`, `lightclientroothash`, and
|
||||
`blockcommitmentshash` fields in the output of `getblocktemplate` have been
|
||||
replaced by the `defaultroots` field.
|
||||
|
||||
The following previously-deprecated features have been disabled by default, and
|
||||
will be removed in 18 weeks:
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@ Options:
|
|||
-allowdeprecated=<feature>
|
||||
Explicitly allow the use of the specified deprecated feature. Multiple
|
||||
instances of this parameter are permitted; values for <feature> must be
|
||||
selected from among {"none", "addrtype", "getnewaddress",
|
||||
"getrawchangeaddress", "legacy_privacy", "wallettxvjoinsplit",
|
||||
"z_getbalance", "z_getnewaddress", "z_gettotalbalance",
|
||||
"z_listaddresses"}
|
||||
selected from among {"none", "gbt_oldhashes", "addrtype",
|
||||
"getnewaddress", "getrawchangeaddress", "legacy_privacy",
|
||||
"wallettxvjoinsplit", "z_getbalance", "z_getnewaddress",
|
||||
"z_gettotalbalance", "z_listaddresses"}
|
||||
|
||||
-blocknotify=<cmd>
|
||||
Execute command when the best block changes (%s in cmd is replaced by
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "chainparams.h"
|
||||
|
||||
// Flags that enable deprecated functionality.
|
||||
bool fEnableGbtOldHashes = true;
|
||||
#ifdef ENABLE_WALLET
|
||||
bool fEnableGetNewAddress = true;
|
||||
bool fEnableGetRawChangeAddress = true;
|
||||
|
@ -91,6 +92,7 @@ std::optional<std::string> SetAllowedDeprecatedFeaturesFromCLIArgs() {
|
|||
unrecMsg, GetAllowableDeprecatedFeatures());
|
||||
}
|
||||
|
||||
fEnableGbtOldHashes = allowdeprecated.count("gbt_oldhashes") > 0;
|
||||
#ifdef ENABLE_WALLET
|
||||
fEnableLegacyPrivacyStrategy = allowdeprecated.count("legacy_privacy") > 0;
|
||||
fEnableGetNewAddress = allowdeprecated.count("getnewaddress") > 0;
|
||||
|
|
|
@ -23,6 +23,7 @@ static const int DEPRECATION_WARN_LIMIT = 14 * 24 * EXPECTED_BLOCKS_PER_HOUR;
|
|||
//! Defaults for -allowdeprecated
|
||||
static const std::set<std::string> DEFAULT_ALLOW_DEPRECATED{{
|
||||
// Node-level features
|
||||
"gbt_oldhashes"
|
||||
|
||||
// Wallet-level features
|
||||
#ifdef ENABLE_WALLET
|
||||
|
@ -46,6 +47,7 @@ static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
|
|||
}};
|
||||
|
||||
// Flags that enable deprecated functionality.
|
||||
extern bool fEnableGbtOldHashes;
|
||||
#ifdef ENABLE_WALLET
|
||||
extern bool fEnableGetNewAddress;
|
||||
extern bool fEnableGetRawChangeAddress;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#ifdef ENABLE_MINING
|
||||
#include "crypto/equihash.h"
|
||||
#endif
|
||||
#include "deprecation.h"
|
||||
#include "init.h"
|
||||
#include "key_io.h"
|
||||
#include "main.h"
|
||||
|
@ -782,9 +783,11 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
|||
result.pushKV("version", pblock->nVersion);
|
||||
result.pushKV("previousblockhash", pblock->hashPrevBlock.GetHex());
|
||||
// The following 3 are deprecated; remove in a future release.
|
||||
result.pushKV("blockcommitmentshash", pblock->hashBlockCommitments.GetHex());
|
||||
result.pushKV("lightclientroothash", pblock->hashBlockCommitments.GetHex());
|
||||
result.pushKV("finalsaplingroothash", pblock->hashBlockCommitments.GetHex());
|
||||
if (fEnableGbtOldHashes) {
|
||||
result.pushKV("blockcommitmentshash", pblock->hashBlockCommitments.GetHex());
|
||||
result.pushKV("lightclientroothash", pblock->hashBlockCommitments.GetHex());
|
||||
result.pushKV("finalsaplingroothash", pblock->hashBlockCommitments.GetHex());
|
||||
}
|
||||
{
|
||||
// These are items in the result object that are valid only if the
|
||||
// block template returned by this RPC is used unmodified. Otherwise,
|
||||
|
|
Loading…
Reference in New Issue