cmd/utils, internal/debug: hide the deprecated flags (#32128)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run

Some of the flags were deprecated, so try to hide them in the help
message. And move the `--vmodule` and `--logjson` flags to the
DeprecatedCategory.
This commit is contained in:
Zhou 2025-07-03 02:23:00 -03:00 committed by GitHub
parent 34f00a42f8
commit 97645caf80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 6 deletions

View file

@ -1379,13 +1379,13 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
cfg.UseLightweightKDF = ctx.Bool(LightKDFFlag.Name) cfg.UseLightweightKDF = ctx.Bool(LightKDFFlag.Name)
} }
if ctx.IsSet(NoUSBFlag.Name) || cfg.NoUSB { if ctx.IsSet(NoUSBFlag.Name) || cfg.NoUSB {
log.Warn("Option nousb is deprecated and USB is deactivated by default. Use --usb to enable") log.Warn("Option --nousb is deprecated and USB is deactivated by default. Use --usb to enable")
} }
if ctx.IsSet(USBFlag.Name) { if ctx.IsSet(USBFlag.Name) {
cfg.USB = ctx.Bool(USBFlag.Name) cfg.USB = ctx.Bool(USBFlag.Name)
} }
if ctx.IsSet(InsecureUnlockAllowedFlag.Name) { if ctx.IsSet(InsecureUnlockAllowedFlag.Name) {
log.Warn(fmt.Sprintf("Option %q is deprecated and has no effect", InsecureUnlockAllowedFlag.Name)) log.Warn(fmt.Sprintf("Option --%s is deprecated and has no effect", InsecureUnlockAllowedFlag.Name))
} }
if ctx.IsSet(DBEngineFlag.Name) { if ctx.IsSet(DBEngineFlag.Name) {
dbEngine := ctx.String(DBEngineFlag.Name) dbEngine := ctx.String(DBEngineFlag.Name)
@ -1397,10 +1397,10 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
} }
// deprecation notice for log debug flags (TODO: find a more appropriate place to put these?) // deprecation notice for log debug flags (TODO: find a more appropriate place to put these?)
if ctx.IsSet(LogBacktraceAtFlag.Name) { if ctx.IsSet(LogBacktraceAtFlag.Name) {
log.Warn("log.backtrace flag is deprecated") log.Warn("Option --log.backtrace flag is deprecated")
} }
if ctx.IsSet(LogDebugFlag.Name) { if ctx.IsSet(LogDebugFlag.Name) {
log.Warn("log.debug flag is deprecated") log.Warn("Option --log.debug flag is deprecated")
} }
} }

View file

@ -50,28 +50,33 @@ var (
// Deprecated May 2020, shown in aliased flags section // Deprecated May 2020, shown in aliased flags section
NoUSBFlag = &cli.BoolFlag{ NoUSBFlag = &cli.BoolFlag{
Name: "nousb", Name: "nousb",
Hidden: true,
Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)", Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
// Deprecated March 2022 // Deprecated March 2022
LegacyWhitelistFlag = &cli.StringFlag{ LegacyWhitelistFlag = &cli.StringFlag{
Name: "whitelist", Name: "whitelist",
Hidden: true,
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)", Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
// Deprecated July 2023 // Deprecated July 2023
CacheTrieJournalFlag = &cli.StringFlag{ CacheTrieJournalFlag = &cli.StringFlag{
Name: "cache.trie.journal", Name: "cache.trie.journal",
Hidden: true,
Usage: "Disk journal directory for trie cache to survive node restarts", Usage: "Disk journal directory for trie cache to survive node restarts",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
CacheTrieRejournalFlag = &cli.DurationFlag{ CacheTrieRejournalFlag = &cli.DurationFlag{
Name: "cache.trie.rejournal", Name: "cache.trie.rejournal",
Hidden: true,
Usage: "Time interval to regenerate the trie cache journal", Usage: "Time interval to regenerate the trie cache journal",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
LegacyDiscoveryV5Flag = &cli.BoolFlag{ LegacyDiscoveryV5Flag = &cli.BoolFlag{
Name: "v5disc", Name: "v5disc",
Hidden: true,
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism (deprecated, use --discv5 instead)", Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism (deprecated, use --discv5 instead)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
@ -85,51 +90,60 @@ var (
// Deprecated November 2023 // Deprecated November 2023
LogBacktraceAtFlag = &cli.StringFlag{ LogBacktraceAtFlag = &cli.StringFlag{
Name: "log.backtrace", Name: "log.backtrace",
Hidden: true,
Usage: "Request a stack trace at a specific logging statement (deprecated)", Usage: "Request a stack trace at a specific logging statement (deprecated)",
Value: "", Value: "",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
LogDebugFlag = &cli.BoolFlag{ LogDebugFlag = &cli.BoolFlag{
Name: "log.debug", Name: "log.debug",
Hidden: true,
Usage: "Prepends log messages with call-site location (deprecated)", Usage: "Prepends log messages with call-site location (deprecated)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
// Deprecated February 2024 // Deprecated February 2024
MinerNewPayloadTimeoutFlag = &cli.DurationFlag{ MinerNewPayloadTimeoutFlag = &cli.DurationFlag{
Name: "miner.newpayload-timeout", Name: "miner.newpayload-timeout",
Hidden: true,
Usage: "Specify the maximum time allowance for creating a new payload (deprecated)", Usage: "Specify the maximum time allowance for creating a new payload (deprecated)",
Value: ethconfig.Defaults.Miner.Recommit, Value: ethconfig.Defaults.Miner.Recommit,
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
MinerEtherbaseFlag = &cli.StringFlag{ MinerEtherbaseFlag = &cli.StringFlag{
Name: "miner.etherbase", Name: "miner.etherbase",
Hidden: true,
Usage: "0x prefixed public address for block mining rewards (deprecated)", Usage: "0x prefixed public address for block mining rewards (deprecated)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
MiningEnabledFlag = &cli.BoolFlag{ MiningEnabledFlag = &cli.BoolFlag{
Name: "mine", Name: "mine",
Hidden: true,
Usage: "Enable mining (deprecated)", Usage: "Enable mining (deprecated)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
MetricsEnabledExpensiveFlag = &cli.BoolFlag{ MetricsEnabledExpensiveFlag = &cli.BoolFlag{
Name: "metrics.expensive", Name: "metrics.expensive",
Hidden: true,
Usage: "Enable expensive metrics collection and reporting (deprecated)", Usage: "Enable expensive metrics collection and reporting (deprecated)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
// Deprecated Oct 2024 // Deprecated Oct 2024
EnablePersonal = &cli.BoolFlag{ EnablePersonal = &cli.BoolFlag{
Name: "rpc.enabledeprecatedpersonal", Name: "rpc.enabledeprecatedpersonal",
Hidden: true,
Usage: "This used to enable the 'personal' namespace.", Usage: "This used to enable the 'personal' namespace.",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
UnlockedAccountFlag = &cli.StringFlag{ UnlockedAccountFlag = &cli.StringFlag{
Name: "unlock", Name: "unlock",
Hidden: true,
Usage: "Comma separated list of accounts to unlock (deprecated)", Usage: "Comma separated list of accounts to unlock (deprecated)",
Value: "", Value: "",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
InsecureUnlockAllowedFlag = &cli.BoolFlag{ InsecureUnlockAllowedFlag = &cli.BoolFlag{
Name: "allow-insecure-unlock", Name: "allow-insecure-unlock",
Hidden: true,
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http (deprecated)", Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http (deprecated)",
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }

View file

@ -55,13 +55,13 @@ var (
Usage: "Per-module verbosity: comma-separated list of <pattern>=<level> (e.g. eth/*=5,p2p=4)", Usage: "Per-module verbosity: comma-separated list of <pattern>=<level> (e.g. eth/*=5,p2p=4)",
Value: "", Value: "",
Hidden: true, Hidden: true,
Category: flags.LoggingCategory, Category: flags.DeprecatedCategory,
} }
logjsonFlag = &cli.BoolFlag{ logjsonFlag = &cli.BoolFlag{
Name: "log.json", Name: "log.json",
Usage: "Format logs with JSON", Usage: "Format logs with JSON",
Hidden: true, Hidden: true,
Category: flags.LoggingCategory, Category: flags.DeprecatedCategory,
} }
logFormatFlag = &cli.StringFlag{ logFormatFlag = &cli.StringFlag{
Name: "log.format", Name: "log.format",