Remove deprecated parameters (#5249)

This commit is contained in:
Jim McDonald
2020-04-01 19:39:32 +01:00
committed by GitHub
parent d9fad8461f
commit 7d17c9ac34
6 changed files with 4 additions and 60 deletions

View File

@@ -2,10 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"flags.go",
"interop.go",
],
srcs = ["flags.go"],
importpath = "github.com/prysmaticlabs/prysm/validator/flags",
visibility = ["//validator:__subpackages__"],
deps = ["@in_gopkg_urfave_cli_v2//:go_default_library"],

View File

@@ -21,13 +21,6 @@ var (
Name: "tls-cert",
Usage: "Certificate for secure gRPC. Pass this and the tls-key flag in order to use gRPC securely.",
}
// UnencryptedKeysFlag specifies a file path of a JSON file of unencrypted validator keys; this should only
// be used for test networks.
UnencryptedKeysFlag = &cli.StringFlag{
Name: "unencrypted-keys",
Usage: "Filepath to a JSON file of unencrypted validator keys for launching the validator client on test networks",
Value: "",
}
// KeyManager specifies the key manager to use.
KeyManager = &cli.StringFlag{
Name: "keymanager",

View File

@@ -1,21 +0,0 @@
package flags
import (
"gopkg.in/urfave/cli.v2"
)
// Flags defined for interoperability testing.
var (
InteropStartIndex = &cli.Uint64Flag{
Name: "interop-start-index",
Usage: "The start index to deterministically generate validator keys when used in combination with " +
"--interop-num-validators. Example: --interop-start-index=5 --interop-num-validators=3 would generate " +
"keys from index 5 to 7.",
}
InteropNumValidators = &cli.Uint64Flag{
Name: "interop-num-validators",
Usage: "The number of validators to deterministically generate when used in combination with " +
"--interop-num-validators. Example: --interop-start-index=5 --interop-num-validators=3 would generate " +
"keys from index 5 to 7.",
}
)

View File

@@ -38,9 +38,6 @@ var appFlags = []cli.Flag{
flags.CertFlag,
flags.GraffitiFlag,
flags.DisablePenaltyRewardLogFlag,
flags.UnencryptedKeysFlag,
flags.InteropStartIndex,
flags.InteropNumValidators,
flags.GrpcMaxCallRecvMsgSizeFlag,
flags.GrpcRetriesFlag,
flags.GrpcHeadersFlag,

View File

@@ -198,6 +198,9 @@ func (s *ValidatorClient) registerClientService(ctx *cli.Context, keyManager key
// selectKeyManager selects the key manager depending on the options provided by the user.
func selectKeyManager(ctx *cli.Context) (keymanager.KeyManager, error) {
manager := strings.ToLower(ctx.String(flags.KeyManager.Name))
if manager == "" {
return nil, fmt.Errorf("please supply a keymanager with --keymanager")
}
opts := ctx.String(flags.KeyManagerOpts.Name)
if opts == "" {
opts = "{}"
@@ -209,23 +212,6 @@ func selectKeyManager(ctx *cli.Context) (keymanager.KeyManager, error) {
opts = string(fileopts)
}
if manager == "" {
// Attempt to work out keymanager from deprecated vars.
if unencryptedKeys := ctx.String(flags.UnencryptedKeysFlag.Name); unencryptedKeys != "" {
manager = "unencrypted"
opts = fmt.Sprintf(`{"path":%q}`, unencryptedKeys)
log.Warn(fmt.Sprintf("--unencrypted-keys flag is deprecated. Please use --keymanager=unencrypted --keymanageropts='%s'", opts))
} else if numValidatorKeys := ctx.Uint64(flags.InteropNumValidators.Name); numValidatorKeys > 0 {
manager = "interop"
opts = fmt.Sprintf(`{"keys":%d,"offset":%d}`, numValidatorKeys, ctx.Uint64(flags.InteropStartIndex.Name))
log.Warn(fmt.Sprintf("--interop-num-validators and --interop-start-index flags are deprecated. Please use --keymanager=interop --keymanageropts='%s'", opts))
}
}
if manager == "" {
return nil, fmt.Errorf("please supply a keymanager with --keymanager")
}
var km keymanager.KeyManager
var help string
var err error

View File

@@ -78,7 +78,6 @@ var appHelpFlagGroups = []flagGroup{
flags.KeyManager,
flags.KeyManagerOpts,
flags.DisablePenaltyRewardLogFlag,
flags.UnencryptedKeysFlag,
flags.GraffitiFlag,
flags.GrpcMaxCallRecvMsgSizeFlag,
flags.GrpcRetriesFlag,
@@ -90,13 +89,6 @@ var appHelpFlagGroups = []flagGroup{
Name: "features",
Flags: featureconfig.ActiveFlags(featureconfig.ValidatorFlags),
},
{
Name: "interop",
Flags: []cli.Flag{
flags.InteropNumValidators,
flags.InteropStartIndex,
},
},
}
func init() {