legacy prefix and moved some more legacy flags to legacy file

This commit is contained in:
renaynay 2020-04-21 14:35:23 +02:00
parent 6ff6bca5da
commit 2f4386a0da
No known key found for this signature in database
GPG key ID: 6557F5413D663EDB
5 changed files with 145 additions and 142 deletions

View file

@ -94,11 +94,11 @@ var (
utils.GCModeFlag, utils.GCModeFlag,
utils.SnapshotFlag, utils.SnapshotFlag,
utils.LightServeFlag, utils.LightServeFlag,
utils.LightLegacyServFlag, utils.LegacyLightServFlag,
utils.LightIngressFlag, utils.LightIngressFlag,
utils.LightEgressFlag, utils.LightEgressFlag,
utils.LightMaxPeersFlag, utils.LightMaxPeersFlag,
utils.LightLegacyPeersFlag, utils.LegacyLightPeersFlag,
utils.LightKDFFlag, utils.LightKDFFlag,
utils.UltraLightServersFlag, utils.UltraLightServersFlag,
utils.UltraLightFractionFlag, utils.UltraLightFractionFlag,
@ -115,17 +115,17 @@ var (
utils.MaxPendingPeersFlag, utils.MaxPendingPeersFlag,
utils.MiningEnabledFlag, utils.MiningEnabledFlag,
utils.MinerThreadsFlag, utils.MinerThreadsFlag,
utils.MinerLegacyThreadsFlag, utils.LegacyMinerThreadsFlag,
utils.MinerNotifyFlag, utils.MinerNotifyFlag,
utils.MinerGasTargetFlag, utils.MinerGasTargetFlag,
utils.MinerLegacyGasTargetFlag, utils.LegacyMinerGasTargetFlag,
utils.MinerGasLimitFlag, utils.MinerGasLimitFlag,
utils.MinerGasPriceFlag, utils.MinerGasPriceFlag,
utils.MinerLegacyGasPriceFlag, utils.LegacyMinerGasPriceFlag,
utils.MinerEtherbaseFlag, utils.MinerEtherbaseFlag,
utils.MinerLegacyEtherbaseFlag, utils.LegacyMinerEtherbaseFlag,
utils.MinerExtraDataFlag, utils.MinerExtraDataFlag,
utils.MinerLegacyExtraDataFlag, utils.LegacyMinerExtraDataFlag,
utils.MinerRecommitIntervalFlag, utils.MinerRecommitIntervalFlag,
utils.MinerNoVerfiyFlag, utils.MinerNoVerfiyFlag,
utils.NATFlag, utils.NATFlag,
@ -147,9 +147,9 @@ var (
utils.FakePoWFlag, utils.FakePoWFlag,
utils.NoCompactionFlag, utils.NoCompactionFlag,
utils.GpoBlocksFlag, utils.GpoBlocksFlag,
utils.GpoLegacyBlocksFlag, utils.LegacyGpoBlocksFlag,
utils.GpoPercentileFlag, utils.GpoPercentileFlag,
utils.GpoLegacyPercentileFlag, utils.LegacyGpoPercentileFlag,
utils.EWASMInterpreterFlag, utils.EWASMInterpreterFlag,
utils.EVMInterpreterFlag, utils.EVMInterpreterFlag,
configFileFlag, configFileFlag,
@ -161,27 +161,27 @@ var (
utils.HTTPPortFlag, utils.HTTPPortFlag,
utils.HTTPCORSDomainFlag, utils.HTTPCORSDomainFlag,
utils.HTTPVirtualHostsFlag, utils.HTTPVirtualHostsFlag,
utils.RPCLegacyEnabledFlag, utils.LegacyRPCEnabledFlag,
utils.RPCLegacyListenAddrFlag, utils.LegacyRPCListenAddrFlag,
utils.RPCLegacyPortFlag, utils.LegacyRPCPortFlag,
utils.RPCLegacyCORSDomainFlag, utils.LegacyRPCCORSDomainFlag,
utils.RPCLegacyVirtualHostsFlag, utils.LegacyRPCVirtualHostsFlag,
utils.GraphQLEnabledFlag, utils.GraphQLEnabledFlag,
utils.GraphQLListenAddrFlag, utils.GraphQLListenAddrFlag,
utils.GraphQLPortFlag, utils.GraphQLPortFlag,
utils.GraphQLCORSDomainFlag, utils.GraphQLCORSDomainFlag,
utils.GraphQLVirtualHostsFlag, utils.GraphQLVirtualHostsFlag,
utils.HTTPApiFlag, utils.HTTPApiFlag,
utils.RPCLegacyApiFlag, utils.LegacyRPCApiFlag,
utils.WSEnabledFlag, utils.WSEnabledFlag,
utils.WSListenAddrFlag, utils.WSListenAddrFlag,
utils.WSLegacyListenAddrFlag, utils.LegacyWSListenAddrFlag,
utils.WSPortFlag, utils.WSPortFlag,
utils.WSLegacyPortFlag, utils.LegacyWSPortFlag,
utils.WSApiFlag, utils.WSApiFlag,
utils.WSLegacyApiFlag, utils.LegacyWSApiFlag,
utils.WSAllowedOriginsFlag, utils.WSAllowedOriginsFlag,
utils.WSLegacyAllowedOriginsFlag, utils.LegacyWSAllowedOriginsFlag,
utils.IPCDisabledFlag, utils.IPCDisabledFlag,
utils.IPCPathFlag, utils.IPCPathFlag,
utils.InsecureUnlockAllowedFlag, utils.InsecureUnlockAllowedFlag,
@ -374,7 +374,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
// Set contract backend for ethereum service if local node // Set contract backend for ethereum service if local node
// is serving LES requests. // is serving LES requests.
if ctx.GlobalInt(utils.LightLegacyServFlag.Name) > 0 || ctx.GlobalInt(utils.LightServeFlag.Name) > 0 { if ctx.GlobalInt(utils.LegacyLightServFlag.Name) > 0 || ctx.GlobalInt(utils.LightServeFlag.Name) > 0 {
var ethService *eth.Ethereum var ethService *eth.Ethereum
if err := stack.Service(&ethService); err != nil { if err := stack.Service(&ethService); err != nil {
utils.Fatalf("Failed to retrieve ethereum service: %v", err) utils.Fatalf("Failed to retrieve ethereum service: %v", err)
@ -460,16 +460,16 @@ func startNode(ctx *cli.Context, stack *node.Node) {
} }
// Set the gas price to the limits from the CLI and start mining // Set the gas price to the limits from the CLI and start mining
var gasprice *big.Int var gasprice *big.Int
if ctx.IsSet(utils.MinerLegacyGasPriceFlag.Name) { if ctx.IsSet(utils.LegacyMinerGasPriceFlag.Name) {
gasprice = utils.GlobalBig(ctx, utils.MinerLegacyGasPriceFlag.Name) gasprice = utils.GlobalBig(ctx, utils.LegacyMinerGasPriceFlag.Name)
log.Warn("The flag --gasprice is deprecated and will be removed in the future, please use --miner.gasprice") log.Warn("The flag --gasprice is deprecated and will be removed in the future, please use --miner.gasprice")
} }
gasprice = utils.GlobalBig(ctx, utils.MinerGasPriceFlag.Name) gasprice = utils.GlobalBig(ctx, utils.MinerGasPriceFlag.Name)
ethereum.TxPool().SetGasPrice(gasprice) ethereum.TxPool().SetGasPrice(gasprice)
var threads int var threads int
if ctx.GlobalIsSet(utils.MinerLegacyThreadsFlag.Name) { if ctx.GlobalIsSet(utils.LegacyMinerThreadsFlag.Name) {
threads = ctx.GlobalInt(utils.MinerLegacyThreadsFlag.Name) threads = ctx.GlobalInt(utils.LegacyMinerThreadsFlag.Name)
log.Warn("The flag --minerthreads is deprecated and will be removed in the future, please use --miner.threads") log.Warn("The flag --minerthreads is deprecated and will be removed in the future, please use --miner.threads")
} }
threads = ctx.GlobalInt(utils.MinerThreadsFlag.Name) threads = ctx.GlobalInt(utils.MinerThreadsFlag.Name)

View file

@ -244,20 +244,25 @@ var AppHelpFlagGroups = []flagGroup{
}, },
{ {
Name: "ALIASED (deprecated)", Name: "ALIASED (deprecated)",
Flags: append([]cli.Flag{ Flags: []cli.Flag{
utils.RPCLegacyEnabledFlag, utils.LegacyRPCEnabledFlag,
utils.RPCLegacyListenAddrFlag, utils.LegacyRPCListenAddrFlag,
utils.RPCLegacyPortFlag, utils.LegacyRPCPortFlag,
utils.RPCLegacyCORSDomainFlag, utils.LegacyRPCCORSDomainFlag,
utils.RPCLegacyVirtualHostsFlag, utils.LegacyRPCVirtualHostsFlag,
utils.RPCLegacyApiFlag, utils.LegacyRPCApiFlag,
utils.WSLegacyListenAddrFlag, utils.LegacyWSListenAddrFlag,
utils.WSLegacyPortFlag, utils.LegacyWSPortFlag,
utils.WSLegacyAllowedOriginsFlag, utils.LegacyWSAllowedOriginsFlag,
utils.WSLegacyApiFlag, utils.LegacyWSApiFlag,
utils.GpoLegacyBlocksFlag, utils.LegacyGpoBlocksFlag,
utils.GpoLegacyPercentileFlag, utils.LegacyGpoPercentileFlag,
}, debug.DeprecatedFlags...), utils.LegacyPprofAddrFlag,
utils.LegacyPprofPortFlag,
utils.LegacyMemprofilerateFlag,
utils.LegacyBlockprofilerateFlag,
utils.LegacyCpuprofileFlag,
},
}, },
{ {
Name: "MISC", Name: "MISC",

View file

@ -886,10 +886,10 @@ func splitAndTrim(input string) []string {
// setHTTP creates the HTTP RPC listener interface string from the set // setHTTP creates the HTTP RPC listener interface string from the set
// command line flags, returning empty if the HTTP endpoint is disabled. // command line flags, returning empty if the HTTP endpoint is disabled.
func setHTTP(ctx *cli.Context, cfg *node.Config) { func setHTTP(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalBool(RPCLegacyEnabledFlag.Name) && cfg.HTTPHost == "" { if ctx.GlobalBool(LegacyRPCEnabledFlag.Name) && cfg.HTTPHost == "" {
cfg.HTTPHost = "127.0.0.1" cfg.HTTPHost = "127.0.0.1"
if ctx.GlobalIsSet(RPCLegacyListenAddrFlag.Name) { if ctx.GlobalIsSet(LegacyRPCListenAddrFlag.Name) {
cfg.HTTPHost = ctx.GlobalString(RPCLegacyListenAddrFlag.Name) cfg.HTTPHost = ctx.GlobalString(LegacyRPCListenAddrFlag.Name)
log.Warn("The flag --rpcaddr is deprecated and will be removed in the future, please use --http.addr") log.Warn("The flag --rpcaddr is deprecated and will be removed in the future, please use --http.addr")
} }
} }
@ -900,32 +900,32 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
} }
} }
if ctx.GlobalIsSet(RPCLegacyPortFlag.Name) { if ctx.GlobalIsSet(LegacyRPCPortFlag.Name) {
cfg.HTTPPort = ctx.GlobalInt(RPCLegacyPortFlag.Name) cfg.HTTPPort = ctx.GlobalInt(LegacyRPCPortFlag.Name)
log.Warn("The flag --rpcport is deprecated and will be removed in the future, please use --http.port") log.Warn("The flag --rpcport is deprecated and will be removed in the future, please use --http.port")
} }
if ctx.GlobalIsSet(HTTPPortFlag.Name) { if ctx.GlobalIsSet(HTTPPortFlag.Name) {
cfg.HTTPPort = ctx.GlobalInt(HTTPPortFlag.Name) cfg.HTTPPort = ctx.GlobalInt(HTTPPortFlag.Name)
} }
if ctx.GlobalIsSet(RPCLegacyCORSDomainFlag.Name) { if ctx.GlobalIsSet(LegacyRPCCORSDomainFlag.Name) {
cfg.HTTPCors = splitAndTrim(ctx.GlobalString(RPCLegacyCORSDomainFlag.Name)) cfg.HTTPCors = splitAndTrim(ctx.GlobalString(LegacyRPCCORSDomainFlag.Name))
log.Warn("The flag --rpccorsdomain is deprecated and will be removed in the future, please use --http.corsdomain") log.Warn("The flag --rpccorsdomain is deprecated and will be removed in the future, please use --http.corsdomain")
} }
if ctx.GlobalIsSet(HTTPCORSDomainFlag.Name) { if ctx.GlobalIsSet(HTTPCORSDomainFlag.Name) {
cfg.HTTPCors = splitAndTrim(ctx.GlobalString(HTTPCORSDomainFlag.Name)) cfg.HTTPCors = splitAndTrim(ctx.GlobalString(HTTPCORSDomainFlag.Name))
} }
if ctx.GlobalIsSet(RPCLegacyApiFlag.Name) { if ctx.GlobalIsSet(LegacyRPCApiFlag.Name) {
cfg.HTTPModules = splitAndTrim(ctx.GlobalString(RPCLegacyApiFlag.Name)) cfg.HTTPModules = splitAndTrim(ctx.GlobalString(LegacyRPCApiFlag.Name))
log.Warn("The flag --rpcapi is deprecated and will be removed in the future, please use --http.api") log.Warn("The flag --rpcapi is deprecated and will be removed in the future, please use --http.api")
} }
if ctx.GlobalIsSet(HTTPApiFlag.Name) { if ctx.GlobalIsSet(HTTPApiFlag.Name) {
cfg.HTTPModules = splitAndTrim(ctx.GlobalString(HTTPApiFlag.Name)) cfg.HTTPModules = splitAndTrim(ctx.GlobalString(HTTPApiFlag.Name))
} }
if ctx.GlobalIsSet(RPCLegacyVirtualHostsFlag.Name) { if ctx.GlobalIsSet(LegacyRPCVirtualHostsFlag.Name) {
cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(RPCLegacyVirtualHostsFlag.Name)) cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(LegacyRPCVirtualHostsFlag.Name))
log.Warn("The flag --rpcvhosts is deprecated and will be removed in the future, please use --http.vhosts") log.Warn("The flag --rpcvhosts is deprecated and will be removed in the future, please use --http.vhosts")
} }
if ctx.GlobalIsSet(HTTPVirtualHostsFlag.Name) { if ctx.GlobalIsSet(HTTPVirtualHostsFlag.Name) {
@ -956,32 +956,32 @@ func setGraphQL(ctx *cli.Context, cfg *node.Config) {
func setWS(ctx *cli.Context, cfg *node.Config) { func setWS(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalBool(WSEnabledFlag.Name) && cfg.WSHost == "" { if ctx.GlobalBool(WSEnabledFlag.Name) && cfg.WSHost == "" {
cfg.WSHost = "127.0.0.1" cfg.WSHost = "127.0.0.1"
if ctx.GlobalIsSet(WSLegacyListenAddrFlag.Name) { if ctx.GlobalIsSet(LegacyWSListenAddrFlag.Name) {
cfg.WSHost = ctx.GlobalString(WSLegacyListenAddrFlag.Name) cfg.WSHost = ctx.GlobalString(LegacyWSListenAddrFlag.Name)
log.Warn("The flag --wsaddr is deprecated and will be removed in the future, please use --ws.addr") log.Warn("The flag --wsaddr is deprecated and will be removed in the future, please use --ws.addr")
} }
if ctx.GlobalIsSet(WSListenAddrFlag.Name) { if ctx.GlobalIsSet(WSListenAddrFlag.Name) {
cfg.WSHost = ctx.GlobalString(WSListenAddrFlag.Name) cfg.WSHost = ctx.GlobalString(WSListenAddrFlag.Name)
} }
} }
if ctx.GlobalIsSet(WSLegacyPortFlag.Name) { if ctx.GlobalIsSet(LegacyWSPortFlag.Name) {
cfg.WSPort = ctx.GlobalInt(WSLegacyPortFlag.Name) cfg.WSPort = ctx.GlobalInt(LegacyWSPortFlag.Name)
log.Warn("The flag --wsport is deprecated and will be removed in the future, please use --ws.port") log.Warn("The flag --wsport is deprecated and will be removed in the future, please use --ws.port")
} }
if ctx.GlobalIsSet(WSPortFlag.Name) { if ctx.GlobalIsSet(WSPortFlag.Name) {
cfg.WSPort = ctx.GlobalInt(WSPortFlag.Name) cfg.WSPort = ctx.GlobalInt(WSPortFlag.Name)
} }
if ctx.GlobalIsSet(WSLegacyAllowedOriginsFlag.Name) { if ctx.GlobalIsSet(LegacyWSAllowedOriginsFlag.Name) {
cfg.WSOrigins = splitAndTrim(ctx.GlobalString(WSLegacyAllowedOriginsFlag.Name)) cfg.WSOrigins = splitAndTrim(ctx.GlobalString(LegacyWSAllowedOriginsFlag.Name))
log.Warn("The flag --wsorigins is deprecated and will be removed in the future, please use --ws.origins") log.Warn("The flag --wsorigins is deprecated and will be removed in the future, please use --ws.origins")
} }
if ctx.GlobalIsSet(WSAllowedOriginsFlag.Name) { if ctx.GlobalIsSet(WSAllowedOriginsFlag.Name) {
cfg.WSOrigins = splitAndTrim(ctx.GlobalString(WSAllowedOriginsFlag.Name)) cfg.WSOrigins = splitAndTrim(ctx.GlobalString(WSAllowedOriginsFlag.Name))
} }
if ctx.GlobalIsSet(WSLegacyApiFlag.Name) { if ctx.GlobalIsSet(LegacyWSApiFlag.Name) {
cfg.WSModules = splitAndTrim(ctx.GlobalString(WSLegacyApiFlag.Name)) cfg.WSModules = splitAndTrim(ctx.GlobalString(LegacyWSApiFlag.Name))
log.Warn("The flag --wsapi is deprecated and will be removed in the future, please use --ws.api") log.Warn("The flag --wsapi is deprecated and will be removed in the future, please use --ws.api")
} }
if ctx.GlobalIsSet(WSApiFlag.Name) { if ctx.GlobalIsSet(WSApiFlag.Name) {
@ -1003,8 +1003,8 @@ func setIPC(ctx *cli.Context, cfg *node.Config) {
// setLes configures the les server and ultra light client settings from the command line flags. // setLes configures the les server and ultra light client settings from the command line flags.
func setLes(ctx *cli.Context, cfg *eth.Config) { func setLes(ctx *cli.Context, cfg *eth.Config) {
if ctx.GlobalIsSet(LightLegacyServFlag.Name) { if ctx.GlobalIsSet(LegacyLightServFlag.Name) {
cfg.LightServ = ctx.GlobalInt(LightLegacyServFlag.Name) cfg.LightServ = ctx.GlobalInt(LegacyLightServFlag.Name)
log.Warn("The flag --lightserv is deprecated and will be removed in the future, please use --light.serve") log.Warn("The flag --lightserv is deprecated and will be removed in the future, please use --light.serve")
} }
if ctx.GlobalIsSet(LightServeFlag.Name) { if ctx.GlobalIsSet(LightServeFlag.Name) {
@ -1016,8 +1016,8 @@ func setLes(ctx *cli.Context, cfg *eth.Config) {
if ctx.GlobalIsSet(LightEgressFlag.Name) { if ctx.GlobalIsSet(LightEgressFlag.Name) {
cfg.LightEgress = ctx.GlobalInt(LightEgressFlag.Name) cfg.LightEgress = ctx.GlobalInt(LightEgressFlag.Name)
} }
if ctx.GlobalIsSet(LightLegacyPeersFlag.Name) { if ctx.GlobalIsSet(LegacyLightPeersFlag.Name) {
cfg.LightPeers = ctx.GlobalInt(LightLegacyPeersFlag.Name) cfg.LightPeers = ctx.GlobalInt(LegacyLightPeersFlag.Name)
log.Warn("The flag --lightpeers is deprecated and will be removed in the future, please use --light.maxpeers") log.Warn("The flag --lightpeers is deprecated and will be removed in the future, please use --light.maxpeers")
} }
if ctx.GlobalIsSet(LightMaxPeersFlag.Name) { if ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
@ -1082,8 +1082,8 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error
func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) { func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) {
// Extract the current etherbase, new flag overriding legacy one // Extract the current etherbase, new flag overriding legacy one
var etherbase string var etherbase string
if ctx.GlobalIsSet(MinerLegacyEtherbaseFlag.Name) { if ctx.GlobalIsSet(LegacyMinerEtherbaseFlag.Name) {
etherbase = ctx.GlobalString(MinerLegacyEtherbaseFlag.Name) etherbase = ctx.GlobalString(LegacyMinerEtherbaseFlag.Name)
log.Warn("The flag --etherbase is deprecated and will be removed in the future, please use --miner.etherbase") log.Warn("The flag --etherbase is deprecated and will be removed in the future, please use --miner.etherbase")
} }
@ -1130,27 +1130,27 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
setBootstrapNodesV5(ctx, cfg) setBootstrapNodesV5(ctx, cfg)
lightClient := ctx.GlobalString(SyncModeFlag.Name) == "light" lightClient := ctx.GlobalString(SyncModeFlag.Name) == "light"
lightServer := (ctx.GlobalInt(LightLegacyServFlag.Name) != 0 || ctx.GlobalInt(LightServeFlag.Name) != 0) lightServer := (ctx.GlobalInt(LegacyLightServFlag.Name) != 0 || ctx.GlobalInt(LightServeFlag.Name) != 0)
lightPeers := ctx.GlobalInt(LightLegacyPeersFlag.Name) lightPeers := ctx.GlobalInt(LegacyLightPeersFlag.Name)
if ctx.GlobalIsSet(LightMaxPeersFlag.Name) { if ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
lightPeers = ctx.GlobalInt(LightMaxPeersFlag.Name) lightPeers = ctx.GlobalInt(LightMaxPeersFlag.Name)
} }
if lightClient && !ctx.GlobalIsSet(LightLegacyPeersFlag.Name) && !ctx.GlobalIsSet(LightMaxPeersFlag.Name) { if lightClient && !ctx.GlobalIsSet(LegacyLightPeersFlag.Name) && !ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
// dynamic default - for clients we use 1/10th of the default for servers // dynamic default - for clients we use 1/10th of the default for servers
lightPeers /= 10 lightPeers /= 10
} }
if ctx.GlobalIsSet(MaxPeersFlag.Name) { if ctx.GlobalIsSet(MaxPeersFlag.Name) {
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name) cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name)
if lightServer && !ctx.GlobalIsSet(LightLegacyPeersFlag.Name) && !ctx.GlobalIsSet(LightMaxPeersFlag.Name) { if lightServer && !ctx.GlobalIsSet(LegacyLightPeersFlag.Name) && !ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
cfg.MaxPeers += lightPeers cfg.MaxPeers += lightPeers
} }
} else { } else {
if lightServer { if lightServer {
cfg.MaxPeers += lightPeers cfg.MaxPeers += lightPeers
} }
if lightClient && (ctx.GlobalIsSet(LightLegacyPeersFlag.Name) || ctx.GlobalIsSet(LightMaxPeersFlag.Name)) && cfg.MaxPeers < lightPeers { if lightClient && (ctx.GlobalIsSet(LegacyLightPeersFlag.Name) || ctx.GlobalIsSet(LightMaxPeersFlag.Name)) && cfg.MaxPeers < lightPeers {
cfg.MaxPeers = lightPeers cfg.MaxPeers = lightPeers
} }
} }
@ -1270,16 +1270,16 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
} }
func setGPO(ctx *cli.Context, cfg *gasprice.Config) { func setGPO(ctx *cli.Context, cfg *gasprice.Config) {
if ctx.GlobalIsSet(GpoLegacyBlocksFlag.Name) { if ctx.GlobalIsSet(LegacyGpoBlocksFlag.Name) {
cfg.Blocks = ctx.GlobalInt(GpoLegacyBlocksFlag.Name) cfg.Blocks = ctx.GlobalInt(LegacyGpoBlocksFlag.Name)
log.Warn("The flag --gpoblocks is deprecated and will be removed in the future, please use --gpo.blocks") log.Warn("The flag --gpoblocks is deprecated and will be removed in the future, please use --gpo.blocks")
} }
if ctx.GlobalIsSet(GpoBlocksFlag.Name) { if ctx.GlobalIsSet(GpoBlocksFlag.Name) {
cfg.Blocks = ctx.GlobalInt(GpoBlocksFlag.Name) cfg.Blocks = ctx.GlobalInt(GpoBlocksFlag.Name)
} }
if ctx.GlobalIsSet(GpoLegacyPercentileFlag.Name) { if ctx.GlobalIsSet(LegacyGpoPercentileFlag.Name) {
cfg.Percentile = ctx.GlobalInt(GpoLegacyPercentileFlag.Name) cfg.Percentile = ctx.GlobalInt(LegacyGpoPercentileFlag.Name)
log.Warn("The flag --gpopercentile is deprecated and will be removed in the future, please use --gpo.percentile") log.Warn("The flag --gpopercentile is deprecated and will be removed in the future, please use --gpo.percentile")
} }
if ctx.GlobalIsSet(GpoPercentileFlag.Name) { if ctx.GlobalIsSet(GpoPercentileFlag.Name) {
@ -1361,15 +1361,15 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
if ctx.GlobalIsSet(MinerNotifyFlag.Name) { if ctx.GlobalIsSet(MinerNotifyFlag.Name) {
cfg.Notify = strings.Split(ctx.GlobalString(MinerNotifyFlag.Name), ",") cfg.Notify = strings.Split(ctx.GlobalString(MinerNotifyFlag.Name), ",")
} }
if ctx.GlobalIsSet(MinerLegacyExtraDataFlag.Name) { if ctx.GlobalIsSet(LegacyMinerExtraDataFlag.Name) {
cfg.ExtraData = []byte(ctx.GlobalString(MinerLegacyExtraDataFlag.Name)) cfg.ExtraData = []byte(ctx.GlobalString(LegacyMinerExtraDataFlag.Name))
log.Warn("The flag --extradata is deprecated and will be removed in the future, please use --miner.extradata") log.Warn("The flag --extradata is deprecated and will be removed in the future, please use --miner.extradata")
} }
if ctx.GlobalIsSet(MinerExtraDataFlag.Name) { if ctx.GlobalIsSet(MinerExtraDataFlag.Name) {
cfg.ExtraData = []byte(ctx.GlobalString(MinerExtraDataFlag.Name)) cfg.ExtraData = []byte(ctx.GlobalString(MinerExtraDataFlag.Name))
} }
if ctx.GlobalIsSet(MinerLegacyGasTargetFlag.Name) { if ctx.GlobalIsSet(LegacyMinerGasTargetFlag.Name) {
cfg.GasFloor = ctx.GlobalUint64(MinerLegacyGasTargetFlag.Name) cfg.GasFloor = ctx.GlobalUint64(LegacyMinerGasTargetFlag.Name)
log.Warn("The flag --targetgaslimit is deprecated and will be removed in the future, please use --miner.gastarget") log.Warn("The flag --targetgaslimit is deprecated and will be removed in the future, please use --miner.gastarget")
} }
if ctx.GlobalIsSet(MinerGasTargetFlag.Name) { if ctx.GlobalIsSet(MinerGasTargetFlag.Name) {
@ -1378,8 +1378,8 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
if ctx.GlobalIsSet(MinerGasLimitFlag.Name) { if ctx.GlobalIsSet(MinerGasLimitFlag.Name) {
cfg.GasCeil = ctx.GlobalUint64(MinerGasLimitFlag.Name) cfg.GasCeil = ctx.GlobalUint64(MinerGasLimitFlag.Name)
} }
if ctx.GlobalIsSet(MinerLegacyGasPriceFlag.Name) { if ctx.GlobalIsSet(LegacyMinerGasPriceFlag.Name) {
cfg.GasPrice = GlobalBig(ctx, MinerLegacyGasPriceFlag.Name) cfg.GasPrice = GlobalBig(ctx, LegacyMinerGasPriceFlag.Name)
log.Warn("The flag --gasprice is deprecated and will be removed in the future, please use --miner.gasprice") log.Warn("The flag --gasprice is deprecated and will be removed in the future, please use --miner.gasprice")
} }
if ctx.GlobalIsSet(MinerGasPriceFlag.Name) { if ctx.GlobalIsSet(MinerGasPriceFlag.Name) {
@ -1474,7 +1474,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// Avoid conflicting network flags // Avoid conflicting network flags
CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag) CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag)
CheckExclusive(ctx, LightLegacyServFlag, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, LegacyLightServFlag, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
var ks *keystore.KeyStore var ks *keystore.KeyStore
@ -1594,7 +1594,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
log.Info("Using developer account", "address", developer.Address) log.Info("Using developer account", "address", developer.Address)
cfg.Genesis = core.DeveloperGenesisBlock(uint64(ctx.GlobalInt(DeveloperPeriodFlag.Name)), developer.Address) cfg.Genesis = core.DeveloperGenesisBlock(uint64(ctx.GlobalInt(DeveloperPeriodFlag.Name)), developer.Address)
if !ctx.GlobalIsSet(MinerGasPriceFlag.Name) && !ctx.GlobalIsSet(MinerLegacyGasPriceFlag.Name) { if !ctx.GlobalIsSet(MinerGasPriceFlag.Name) && !ctx.GlobalIsSet(LegacyMinerGasPriceFlag.Name) {
cfg.Miner.GasPrice = big.NewInt(1) cfg.Miner.GasPrice = big.NewInt(1)
} }
default: default:

View file

@ -21,6 +21,7 @@ import (
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/node"
"gopkg.in/urfave/cli.v1" "gopkg.in/urfave/cli.v1"
"runtime"
"strings" "strings"
) )
@ -31,13 +32,13 @@ var (
Usage: "Show flags that have been deprecated", Usage: "Show flags that have been deprecated",
Flags: []cli.Flag{ Flags: []cli.Flag{
LegacyTestnetFlag, LegacyTestnetFlag,
LightLegacyServFlag, LegacyLightServFlag,
LightLegacyPeersFlag, LegacyLightPeersFlag,
MinerLegacyThreadsFlag, LegacyMinerThreadsFlag,
MinerLegacyGasTargetFlag, LegacyMinerGasTargetFlag,
MinerLegacyGasPriceFlag, LegacyMinerGasPriceFlag,
MinerLegacyEtherbaseFlag, LegacyMinerEtherbaseFlag,
MinerLegacyExtraDataFlag, LegacyMinerExtraDataFlag,
}, },
Description: "Show flags that have been deprecated and will soon be removed", Description: "Show flags that have been deprecated and will soon be removed",
} }
@ -45,99 +46,122 @@ var (
Name: "testnet", Name: "testnet",
Usage: "Pre-configured test network (Deprecated: Please choose one of --goerli, --rinkeby, or --ropsten.)", Usage: "Pre-configured test network (Deprecated: Please choose one of --goerli, --rinkeby, or --ropsten.)",
} }
LightLegacyServFlag = cli.IntFlag{ // Deprecated in favor of light.serve, remove in 2021 LegacyLightServFlag = cli.IntFlag{ // Deprecated in favor of light.serve, remove in 2021
Name: "lightserv", Name: "lightserv",
Usage: "Maximum percentage of time allowed for serving LES requests (deprecated, use --light.serve)", Usage: "Maximum percentage of time allowed for serving LES requests (deprecated, use --light.serve)",
Value: eth.DefaultConfig.LightServ, Value: eth.DefaultConfig.LightServ,
} }
LightLegacyPeersFlag = cli.IntFlag{ // Deprecated in favor of light.maxpeers, remove in 2021 LegacyLightPeersFlag = cli.IntFlag{ // Deprecated in favor of light.maxpeers, remove in 2021
Name: "lightpeers", Name: "lightpeers",
Usage: "Maximum number of light clients to serve, or light servers to attach to (deprecated, use --light.maxpeers)", Usage: "Maximum number of light clients to serve, or light servers to attach to (deprecated, use --light.maxpeers)",
Value: eth.DefaultConfig.LightPeers, Value: eth.DefaultConfig.LightPeers,
} }
MinerLegacyThreadsFlag = cli.IntFlag{ LegacyMinerThreadsFlag = cli.IntFlag{
Name: "minerthreads", Name: "minerthreads",
Usage: "Number of CPU threads to use for mining (deprecated, use --miner.threads)", Usage: "Number of CPU threads to use for mining (deprecated, use --miner.threads)",
Value: 0, Value: 0,
} }
MinerLegacyGasTargetFlag = cli.Uint64Flag{ LegacyMinerGasTargetFlag = cli.Uint64Flag{
Name: "targetgaslimit", Name: "targetgaslimit",
Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)", Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)",
Value: eth.DefaultConfig.Miner.GasFloor, Value: eth.DefaultConfig.Miner.GasFloor,
} }
MinerLegacyGasPriceFlag = BigFlag{ LegacyMinerGasPriceFlag = BigFlag{
Name: "gasprice", Name: "gasprice",
Usage: "Minimum gas price for mining a transaction (deprecated, use --miner.gasprice)", Usage: "Minimum gas price for mining a transaction (deprecated, use --miner.gasprice)",
Value: eth.DefaultConfig.Miner.GasPrice, Value: eth.DefaultConfig.Miner.GasPrice,
} }
MinerLegacyEtherbaseFlag = cli.StringFlag{ LegacyMinerEtherbaseFlag = cli.StringFlag{
Name: "etherbase", Name: "etherbase",
Usage: "Public address for block mining rewards (default = first account, deprecated, use --miner.etherbase)", Usage: "Public address for block mining rewards (default = first account, deprecated, use --miner.etherbase)",
Value: "0", Value: "0",
} }
MinerLegacyExtraDataFlag = cli.StringFlag{ LegacyMinerExtraDataFlag = cli.StringFlag{
Name: "extradata", Name: "extradata",
Usage: "Block extra data set by the miner (default = client version, deprecated, use --miner.extradata)", Usage: "Block extra data set by the miner (default = client version, deprecated, use --miner.extradata)",
} }
RPCLegacyEnabledFlag = cli.BoolFlag{ LegacyRPCEnabledFlag = cli.BoolFlag{
Name: "rpc", Name: "rpc",
Usage: "Enable the HTTP-RPC server (deprecated, use --http)", Usage: "Enable the HTTP-RPC server (deprecated, use --http)",
} }
RPCLegacyListenAddrFlag = cli.StringFlag{ LegacyRPCListenAddrFlag = cli.StringFlag{
Name: "rpcaddr", Name: "rpcaddr",
Usage: "HTTP-RPC server listening interface (deprecated, use --http.addr)", Usage: "HTTP-RPC server listening interface (deprecated, use --http.addr)",
Value: node.DefaultHTTPHost, Value: node.DefaultHTTPHost,
} }
RPCLegacyPortFlag = cli.IntFlag{ LegacyRPCPortFlag = cli.IntFlag{
Name: "rpcport", Name: "rpcport",
Usage: "HTTP-RPC server listening port (deprecated, use --http.port)", Usage: "HTTP-RPC server listening port (deprecated, use --http.port)",
Value: node.DefaultHTTPPort, Value: node.DefaultHTTPPort,
} }
RPCLegacyCORSDomainFlag = cli.StringFlag{ LegacyRPCCORSDomainFlag = cli.StringFlag{
Name: "rpccorsdomain", Name: "rpccorsdomain",
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced) (deprecated, use --http.corsdomain)", Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced) (deprecated, use --http.corsdomain)",
Value: "", Value: "",
} }
RPCLegacyVirtualHostsFlag = cli.StringFlag{ LegacyRPCVirtualHostsFlag = cli.StringFlag{
Name: "rpcvhosts", Name: "rpcvhosts",
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (deprecated, use --http.vhosts)", Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (deprecated, use --http.vhosts)",
Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","), Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
} }
RPCLegacyApiFlag = cli.StringFlag{ LegacyRPCApiFlag = cli.StringFlag{
Name: "rpcapi", Name: "rpcapi",
Usage: "API's offered over the HTTP-RPC interface (deprecated, use --http.api)", Usage: "API's offered over the HTTP-RPC interface (deprecated, use --http.api)",
Value: "", Value: "",
} }
WSLegacyListenAddrFlag = cli.StringFlag{ LegacyWSListenAddrFlag = cli.StringFlag{
Name: "wsaddr", Name: "wsaddr",
Usage: "WS-RPC server listening interface (deprecated, use --ws.addr)", Usage: "WS-RPC server listening interface (deprecated, use --ws.addr)",
Value: node.DefaultWSHost, Value: node.DefaultWSHost,
} }
WSLegacyPortFlag = cli.IntFlag{ LegacyWSPortFlag = cli.IntFlag{
Name: "wsport", Name: "wsport",
Usage: "WS-RPC server listening port (deprecated, use --ws.port)", Usage: "WS-RPC server listening port (deprecated, use --ws.port)",
Value: node.DefaultWSPort, Value: node.DefaultWSPort,
} }
WSLegacyApiFlag = cli.StringFlag{ LegacyWSApiFlag = cli.StringFlag{
Name: "wsapi", Name: "wsapi",
Usage: "API's offered over the WS-RPC interface (deprecated, use --ws.api)", Usage: "API's offered over the WS-RPC interface (deprecated, use --ws.api)",
Value: "", Value: "",
} }
WSLegacyAllowedOriginsFlag = cli.StringFlag{ LegacyWSAllowedOriginsFlag = cli.StringFlag{
Name: "wsorigins", Name: "wsorigins",
Usage: "Origins from which to accept websockets requests (deprecated, use --ws.origins)", Usage: "Origins from which to accept websockets requests (deprecated, use --ws.origins)",
Value: "", Value: "",
} }
GpoLegacyBlocksFlag = cli.IntFlag{ LegacyGpoBlocksFlag = cli.IntFlag{
Name: "gpoblocks", Name: "gpoblocks",
Usage: "Number of recent blocks to check for gas prices (deprecated, use --gpo.blocks)", Usage: "Number of recent blocks to check for gas prices (deprecated, use --gpo.blocks)",
Value: eth.DefaultConfig.GPO.Blocks, Value: eth.DefaultConfig.GPO.Blocks,
} }
GpoLegacyPercentileFlag = cli.IntFlag{ LegacyGpoPercentileFlag = cli.IntFlag{
Name: "gpopercentile", Name: "gpopercentile",
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices (deprecated, use --gpo.percentile)", Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices (deprecated, use --gpo.percentile)",
Value: eth.DefaultConfig.GPO.Percentile, Value: eth.DefaultConfig.GPO.Percentile,
} }
LegacyPprofPortFlag = cli.IntFlag{
Name: "pprofport",
Usage: "pprof HTTP server listening port (deprecated, use --pprof.port)",
Value: 6060,
}
LegacyPprofAddrFlag = cli.StringFlag{
Name: "pprofaddr",
Usage: "pprof HTTP server listening interface (deprecated, use --pprof.addr)",
Value: "127.0.0.1",
}
LegacyMemprofilerateFlag = cli.IntFlag{
Name: "memprofilerate",
Usage: "Turn on memory profiling with the given rate (deprecated, use --pprof.memprofilerate)",
Value: runtime.MemProfileRate,
}
LegacyBlockprofilerateFlag = cli.IntFlag{
Name: "blockprofilerate",
Usage: "Turn on block profiling with the given rate (deprecated, use --pprof.blockprofilerate)",
}
LegacyCpuprofileFlag = cli.StringFlag{
Name: "cpuprofile",
Usage: "Write CPU profile to the given file (deprecated, use --pprof.cpuprofile)",
}
) )
func showDeprecated(c *cli.Context) { func showDeprecated(c *cli.Context) {

View file

@ -18,6 +18,7 @@ package debug
import ( import (
"fmt" "fmt"
"github.com/ethereum/go-ethereum/cmd/utils"
"io" "io"
"net/http" "net/http"
_ "net/http/pprof" _ "net/http/pprof"
@ -64,47 +65,24 @@ var (
Usage: "pprof HTTP server listening port", Usage: "pprof HTTP server listening port",
Value: 6060, Value: 6060,
} }
pprofLegacyPortFlag = cli.IntFlag{
Name: "pprofport",
Usage: "pprof HTTP server listening port (deprecated, use --pprof.port)",
Value: 6060,
}
pprofAddrFlag = cli.StringFlag{ pprofAddrFlag = cli.StringFlag{
Name: "pprof.addr", Name: "pprof.addr",
Usage: "pprof HTTP server listening interface", Usage: "pprof HTTP server listening interface",
Value: "127.0.0.1", Value: "127.0.0.1",
} }
pprofLegacyAddrFlag = cli.StringFlag{
Name: "pprofaddr",
Usage: "pprof HTTP server listening interface (deprecated, use --pprof.addr)",
Value: "127.0.0.1",
}
memprofilerateFlag = cli.IntFlag{ memprofilerateFlag = cli.IntFlag{
Name: "pprof.memprofilerate", Name: "pprof.memprofilerate",
Usage: "Turn on memory profiling with the given rate", Usage: "Turn on memory profiling with the given rate",
Value: runtime.MemProfileRate, Value: runtime.MemProfileRate,
} }
memprofilerateLegacyFlag = cli.IntFlag{
Name: "memprofilerate",
Usage: "Turn on memory profiling with the given rate (deprecated, use --pprof.memprofilerate)",
Value: runtime.MemProfileRate,
}
blockprofilerateFlag = cli.IntFlag{ blockprofilerateFlag = cli.IntFlag{
Name: "pprof.blockprofilerate", Name: "pprof.blockprofilerate",
Usage: "Turn on block profiling with the given rate", Usage: "Turn on block profiling with the given rate",
} }
blockprofilerateLegacyFlag = cli.IntFlag{
Name: "blockprofilerate",
Usage: "Turn on block profiling with the given rate (deprecated, use --pprof.blockprofilerate)",
}
cpuprofileFlag = cli.StringFlag{ cpuprofileFlag = cli.StringFlag{
Name: "pprof.cpuprofile", Name: "pprof.cpuprofile",
Usage: "Write CPU profile to the given file", Usage: "Write CPU profile to the given file",
} }
cpuprofileLegacyFlag = cli.StringFlag{
Name: "cpuprofile",
Usage: "Write CPU profile to the given file (deprecated, use --pprof.cpuprofile)",
}
traceFlag = cli.StringFlag{ traceFlag = cli.StringFlag{
Name: "trace", Name: "trace",
Usage: "Write execution trace to the given file", Usage: "Write execution trace to the given file",
@ -117,10 +95,6 @@ var Flags = []cli.Flag{
pprofFlag, pprofAddrFlag, pprofPortFlag, memprofilerateFlag, pprofFlag, pprofAddrFlag, pprofPortFlag, memprofilerateFlag,
blockprofilerateFlag, cpuprofileFlag, traceFlag, blockprofilerateFlag, cpuprofileFlag, traceFlag,
} }
var DeprecatedFlags = []cli.Flag{
pprofLegacyAddrFlag, pprofLegacyPortFlag, memprofilerateLegacyFlag,
blockprofilerateLegacyFlag, cpuprofileLegacyFlag,
}
var ( var (
ostream log.Handler ostream log.Handler
@ -148,14 +122,14 @@ func Setup(ctx *cli.Context) error {
log.Root().SetHandler(glogger) log.Root().SetHandler(glogger)
// profiling, tracing // profiling, tracing
if ctx.GlobalIsSet(memprofilerateLegacyFlag.Name) { if ctx.GlobalIsSet(utils.LegacyMemprofilerateFlag.Name) {
runtime.MemProfileRate = ctx.GlobalInt(memprofilerateLegacyFlag.Name) runtime.MemProfileRate = ctx.GlobalInt(utils.LegacyMemprofilerateFlag.Name)
log.Warn("The flag --memprofilerate is deprecated and will be removed in the future, please use --pprof.memprofilerate") log.Warn("The flag --memprofilerate is deprecated and will be removed in the future, please use --pprof.memprofilerate")
} }
runtime.MemProfileRate = ctx.GlobalInt(memprofilerateFlag.Name) runtime.MemProfileRate = ctx.GlobalInt(memprofilerateFlag.Name)
if ctx.GlobalIsSet(blockprofilerateLegacyFlag.Name) { if ctx.GlobalIsSet(utils.LegacyBlockprofilerateFlag.Name) {
Handler.SetBlockProfileRate(ctx.GlobalInt(blockprofilerateLegacyFlag.Name)) Handler.SetBlockProfileRate(ctx.GlobalInt(utils.LegacyBlockprofilerateFlag.Name))
log.Warn("The flag --blockprofilerate is deprecated and will be removed in the future, please use --pprof.blockprofilerate") log.Warn("The flag --blockprofilerate is deprecated and will be removed in the future, please use --pprof.blockprofilerate")
} }
Handler.SetBlockProfileRate(ctx.GlobalInt(blockprofilerateFlag.Name)) Handler.SetBlockProfileRate(ctx.GlobalInt(blockprofilerateFlag.Name))
@ -171,7 +145,7 @@ func Setup(ctx *cli.Context) error {
return err return err
} }
} }
if cpuFile := ctx.GlobalString(cpuprofileLegacyFlag.Name); cpuFile != "" { if cpuFile := ctx.GlobalString(utils.LegacyCpuprofileFlag.Name); cpuFile != "" {
log.Warn("The flag --cpuprofile is deprecated and will be removed in the future, please use --pprof.cpuprofile") log.Warn("The flag --cpuprofile is deprecated and will be removed in the future, please use --pprof.cpuprofile")
if err := Handler.StartCPUProfile(cpuFile); err != nil { if err := Handler.StartCPUProfile(cpuFile); err != nil {
return err return err
@ -181,14 +155,14 @@ func Setup(ctx *cli.Context) error {
// pprof server // pprof server
if ctx.GlobalBool(pprofFlag.Name) { if ctx.GlobalBool(pprofFlag.Name) {
listenHost := ctx.GlobalString(pprofAddrFlag.Name) listenHost := ctx.GlobalString(pprofAddrFlag.Name)
if ctx.GlobalIsSet(pprofLegacyAddrFlag.Name) && !ctx.GlobalIsSet(pprofAddrFlag.Name) { if ctx.GlobalIsSet(utils.LegacyPprofAddrFlag.Name) && !ctx.GlobalIsSet(pprofAddrFlag.Name) {
listenHost = ctx.GlobalString(pprofLegacyAddrFlag.Name) listenHost = ctx.GlobalString(utils.LegacyPprofAddrFlag.Name)
log.Warn("The flag --pprofaddr is deprecated and will be removed in the future, please use --pprof.addr") log.Warn("The flag --pprofaddr is deprecated and will be removed in the future, please use --pprof.addr")
} }
port := ctx.GlobalInt(pprofPortFlag.Name) port := ctx.GlobalInt(pprofPortFlag.Name)
if ctx.GlobalIsSet(pprofLegacyPortFlag.Name) && !ctx.GlobalIsSet(pprofPortFlag.Name) { if ctx.GlobalIsSet(utils.LegacyPprofPortFlag.Name) && !ctx.GlobalIsSet(pprofPortFlag.Name) {
port = ctx.GlobalInt(pprofLegacyPortFlag.Name) port = ctx.GlobalInt(utils.LegacyPprofPortFlag.Name)
log.Warn("The flag --pprofport is deprecated and will be removed in the future, please use --pprof.port") log.Warn("The flag --pprofport is deprecated and will be removed in the future, please use --pprof.port")
} }