Remove deprecated 'validation_seed' RPC command:

The 'validation_seed' RPC command was used to change the validation
key used by a validator at runtime.

Its implementation was commented out with commit fa796a2eb5
which has been included in the codebase since the 0.30.0 release
and there are no plans to reintroduce the functionality at this
point.

Validator operators should migrate to using validator manifests
instead.

This fixes #2748.
This commit is contained in:
Nik Bougalis
2018-10-22 20:58:52 -07:00
parent 1682fe3a39
commit 77462b8f72
8 changed files with 0 additions and 144 deletions

View File

@@ -1957,7 +1957,6 @@ else ()
src/ripple/rpc/handlers/UnlList.cpp
src/ripple/rpc/handlers/Unsubscribe.cpp
src/ripple/rpc/handlers/ValidationCreate.cpp
src/ripple/rpc/handlers/ValidationSeed.cpp
src/ripple/rpc/handlers/ValidatorListSites.cpp
src/ripple/rpc/handlers/Validators.cpp
src/ripple/rpc/handlers/WalletPropose.cpp

View File

@@ -162,7 +162,6 @@ void printHelp (const po::options_description& desc)
" submit_multisigned <tx_json>\n"
" tx <id>\n"
" validation_create [<seed>|<pass_phrase>|<key>]\n"
" validation_seed [<seed>|<pass_phrase>|<key>]\n"
" wallet_propose [<passphrase>]\n";
}

View File

@@ -993,20 +993,6 @@ private:
return jvRequest;
}
// validation_seed [<pass_phrase>|<seed>|<seed_key>]
//
// NOTE: It is poor security to specify secret information on the command line. This information might be saved in the command
// shell history file (e.g. .bash_history) and it may be leaked via the process status command (i.e. ps).
Json::Value parseValidationSeed (Json::Value const& jvParams)
{
Json::Value jvRequest{Json::objectValue};
if (jvParams.size ())
jvRequest[jss::secret] = jvParams[0u].asString ();
return jvRequest;
}
// wallet_propose [<passphrase>]
// <passphrase> is only for testing. Master seeds should only be generated randomly.
Json::Value parseWalletPropose (Json::Value const& jvParams)
@@ -1155,7 +1141,6 @@ public:
{ "tx_history", &RPCParser::parseTxHistory, 1, 1 },
{ "unl_list", &RPCParser::parseAsIs, 0, 0 },
{ "validation_create", &RPCParser::parseValidationCreate, 0, 1 },
{ "validation_seed", &RPCParser::parseValidationSeed, 0, 1 },
{ "version", &RPCParser::parseAsIs, 0, 0 },
{ "wallet_propose", &RPCParser::parseWalletPropose, 0, 1 },
{ "internal", &RPCParser::parseInternal, 1, -1 },

View File

@@ -80,7 +80,6 @@ Json::Value doTxHistory (RPC::Context&);
Json::Value doUnlList (RPC::Context&);
Json::Value doUnsubscribe (RPC::Context&);
Json::Value doValidationCreate (RPC::Context&);
Json::Value doValidationSeed (RPC::Context&);
Json::Value doWalletPropose (RPC::Context&);
Json::Value doValidators (RPC::Context&);
Json::Value doValidatorListSites (RPC::Context&);

View File

@@ -1,77 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012-2014 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <ripple/app/main/Application.h>
#include <ripple/core/Config.h>
#include <ripple/net/RPCErr.h>
#include <ripple/protocol/ErrorCodes.h>
#include <ripple/protocol/JsonFields.h>
#include <ripple/rpc/Context.h>
#include <ripple/basics/make_lock.h>
#include <iostream>
namespace ripple {
// {
// secret: <string>
// }
Json::Value doValidationSeed (RPC::Context& context)
{
// TODO: This feature is temporarily disabled since we
// cannot modify the config object. We should consider
// whether we want the ability to change the validator
// keys at runtime.
return rpcError (rpcNOT_IMPL);
// auto lock = make_lock(context.app.getMasterMutex());
// Json::Value obj (Json::objectValue);
// if (!context.params.isMember (jss::secret))
// {
// std::cerr << "Unset validation seed." << std::endl;
// context.app.config().VALIDATION_SEED.clear ();
// context.app.config().VALIDATION_PUB.clear ();
// context.app.config().VALIDATION_PRIV.clear ();
// }
// else if (!context.app.config().VALIDATION_SEED.setSeedGeneric (
// context.params[jss::secret].asString ()))
// {
// context.app.config().VALIDATION_PUB.clear ();
// context.app.config().VALIDATION_PRIV.clear ();
// return rpcError (rpcBAD_SEED);
// }
// else
// {
// auto& seed = context.app.config().VALIDATION_SEED;
// auto& pub = context.app.config().VALIDATION_PUB;
// pub = RippleAddress::createNodePublic (seed);
// context.app.config().VALIDATION_PRIV = RippleAddress::createNodePrivate (seed);
// obj[jss::validation_public_key] = pub.humanNodePublic ();
// obj[jss::validation_seed] = seed.humanSeed ();
// obj[jss::validation_key] = seed.humanSeed1751 ();
// }
// return obj;
}
} // ripple

View File

@@ -111,7 +111,6 @@ Handler const handlerArray[] {
{ "tx_history", byRef (&doTxHistory), Role::USER, NO_CONDITION },
{ "unl_list", byRef (&doUnlList), Role::ADMIN, NO_CONDITION },
{ "validation_create", byRef (&doValidationCreate), Role::ADMIN, NO_CONDITION },
{ "validation_seed", byRef (&doValidationSeed), Role::ADMIN, NO_CONDITION },
{ "validators", byRef (&doValidators), Role::ADMIN, NO_CONDITION },
{ "validator_list_sites", byRef (&doValidatorListSites), Role::ADMIN, NO_CONDITION },
{ "wallet_propose", byRef (&doWalletPropose), Role::ADMIN, NO_CONDITION },

View File

@@ -46,7 +46,6 @@
#include <ripple/rpc/handlers/UnlList.cpp>
#include <ripple/rpc/handlers/Unsubscribe.cpp>
#include <ripple/rpc/handlers/ValidationCreate.cpp>
#include <ripple/rpc/handlers/ValidationSeed.cpp>
#include <ripple/rpc/handlers/Validators.cpp>
#include <ripple/rpc/handlers/ValidatorListSites.cpp>
#include <ripple/rpc/handlers/WalletPropose.cpp>

View File

@@ -6638,53 +6638,6 @@ static RPCCallTestData const rpcCallTestArray [] =
})"
},
// validation_seed -------------------------------------------------------------
{
"validation_seed: minimal.", __LINE__,
{
"validation_seed",
},
RPCCallTestData::no_exception,
R"({
"method" : "validation_seed"
})"
},
{
"validation_seed: with secret.", __LINE__,
{
"validation_seed",
"the form of the secret is not validated"
},
RPCCallTestData::no_exception,
R"({
"method" : "validation_seed",
"params" : [
{
"secret" : "the form of the secret is not validated"
}
]
})"
},
{
"validation_seed: too many arguments.", __LINE__,
{
"validation_seed",
"the form of the secret is not validated",
"extra"
},
RPCCallTestData::no_exception,
R"({
"method" : "validation_seed",
"params" : [
{
"error" : "badSyntax",
"error_code" : 1,
"error_message" : "Syntax error."
}
]
})"
},
// version ---------------------------------------------------------------------
{
"version: minimal.", __LINE__,