From 4e374e8df09c0ecb158d543eb6704e7fa7a41380 Mon Sep 17 00:00:00 2001 From: Charlotte <69423184+tqpcharlie@users.noreply.github.com> Date: Sat, 27 Dec 2025 23:55:13 +0000 Subject: [PATCH] cmd, node, signer: remove legacy nousb flag --- cmd/clef/README.md | 2 +- cmd/clef/main.go | 8 ++++---- cmd/geth/main.go | 1 - cmd/utils/flags.go | 3 --- cmd/utils/flags_legacy.go | 8 -------- node/config.go | 4 ---- signer/core/api.go | 10 ++++------ 7 files changed, 9 insertions(+), 27 deletions(-) diff --git a/cmd/clef/README.md b/cmd/clef/README.md index a92dcb1d77..6a51795d22 100644 --- a/cmd/clef/README.md +++ b/cmd/clef/README.md @@ -31,7 +31,7 @@ GLOBAL OPTIONS: --configdir value Directory for Clef configuration (default: "$HOME/.clef") --chainid value Chain id to use for signing (1=mainnet, 17000=Holesky) (default: 1) --lightkdf Reduce key-derivation RAM & CPU usage at some expense of KDF strength - --nousb Disables monitoring for and managing USB hardware wallets + --usb USB enables hardware wallet monitoring and connectivity. --pcscdpath value Path to the smartcard daemon (pcscd) socket file (default: "/run/pcscd/pcscd.comm") --http.addr value HTTP-RPC server listening interface (default: "localhost") --http.vhosts value Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost") diff --git a/cmd/clef/main.go b/cmd/clef/main.go index dde4ae853f..9ea26bdb75 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -269,7 +269,7 @@ func init() { configdirFlag, chainIdFlag, utils.LightKDFFlag, - utils.NoUSBFlag, + utils.USBFlag, utils.SmartCardDaemonPathFlag, utils.HTTPListenAddrFlag, utils.HTTPVirtualHostsFlag, @@ -698,14 +698,14 @@ func signer(c *cli.Context) error { ksLoc = c.String(keystoreFlag.Name) lightKdf = c.Bool(utils.LightKDFFlag.Name) advanced = c.Bool(advancedMode.Name) - nousb = c.Bool(utils.NoUSBFlag.Name) + usb = c.Bool(utils.USBFlag.Name) scpath = c.String(utils.SmartCardDaemonPathFlag.Name) ) log.Info("Starting signer", "chainid", chainId, "keystore", ksLoc, "light-kdf", lightKdf, "advanced", advanced) - am := core.StartClefAccountManager(ksLoc, nousb, lightKdf, scpath) + am := core.StartClefAccountManager(ksLoc, usb, lightKdf, scpath) defer am.Close() - apiImpl := core.NewSignerAPI(am, chainId, nousb, ui, db, advanced, pwStorage) + apiImpl := core.NewSignerAPI(am, chainId, usb, ui, db, advanced, pwStorage) // Establish the bidirectional communication, by creating a new UI backend and registering // it with the UI. diff --git a/cmd/geth/main.go b/cmd/geth/main.go index b294ee593e..3139820289 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -59,7 +59,6 @@ var ( utils.MinFreeDiskSpaceFlag, utils.KeyStoreDirFlag, utils.ExternalSignerFlag, - utils.NoUSBFlag, // deprecated utils.USBFlag, utils.SmartCardDaemonPathFlag, utils.OverrideOsaka, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2b64761e00..8f1a47703c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1435,9 +1435,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) { if ctx.IsSet(LightKDFFlag.Name) { cfg.UseLightweightKDF = ctx.Bool(LightKDFFlag.Name) } - if ctx.IsSet(NoUSBFlag.Name) || cfg.NoUSB { - log.Warn("Option --nousb is deprecated and USB is deactivated by default. Use --usb to enable") - } if ctx.IsSet(USBFlag.Name) { cfg.USB = ctx.Bool(USBFlag.Name) } diff --git a/cmd/utils/flags_legacy.go b/cmd/utils/flags_legacy.go index 239be03ad6..22a6a96ba9 100644 --- a/cmd/utils/flags_legacy.go +++ b/cmd/utils/flags_legacy.go @@ -33,7 +33,6 @@ var ShowDeprecated = &cli.Command{ } var DeprecatedFlags = []cli.Flag{ - NoUSBFlag, LegacyWhitelistFlag, CacheTrieJournalFlag, CacheTrieRejournalFlag, @@ -51,13 +50,6 @@ var DeprecatedFlags = []cli.Flag{ } var ( - // Deprecated May 2020, shown in aliased flags section - NoUSBFlag = &cli.BoolFlag{ - Name: "nousb", - Hidden: true, - Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)", - Category: flags.DeprecatedCategory, - } // Deprecated March 2022 LegacyWhitelistFlag = &cli.StringFlag{ Name: "whitelist", diff --git a/node/config.go b/node/config.go index dc436876cc..3d652e0604 100644 --- a/node/config.go +++ b/node/config.go @@ -86,10 +86,6 @@ type Config struct { // InsecureUnlockAllowed is a deprecated option to allow users to accounts in unsafe http environment. InsecureUnlockAllowed bool `toml:",omitempty"` - // NoUSB disables hardware wallet monitoring and connectivity. - // Deprecated: USB monitoring is disabled by default and must be enabled explicitly. - NoUSB bool `toml:",omitempty"` - // USB enables hardware wallet monitoring and connectivity. USB bool `toml:",omitempty"` diff --git a/signer/core/api.go b/signer/core/api.go index 12acf925f0..e465426232 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -130,7 +130,7 @@ type Metadata struct { Origin string `json:"Origin"` } -func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath string) *accounts.Manager { +func StartClefAccountManager(ksLocation string, usb, lightKDF bool, scpath string) *accounts.Manager { var ( backends []accounts.Backend n, p = keystore.StandardScryptN, keystore.StandardScryptP @@ -142,7 +142,7 @@ func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath str if len(ksLocation) > 0 { backends = append(backends, keystore.NewKeyStore(ksLocation, n, p)) } - if !nousb { + if usb { // Start a USB hub for Ledger hardware wallets if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil { log.Warn(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err)) @@ -279,14 +279,12 @@ var ErrRequestDenied = errors.New("request denied") // NewSignerAPI creates a new API that can be used for Account management. // ksLocation specifies the directory where to store the password protected private // key that is generated when a new Account is created. -// noUSB disables USB support that is required to support hardware devices such as -// ledger and trezor. -func NewSignerAPI(am *accounts.Manager, chainID int64, noUSB bool, ui UIClientAPI, validator Validator, advancedMode bool, credentials storage.Storage) *SignerAPI { +func NewSignerAPI(am *accounts.Manager, chainID int64, usb bool, ui UIClientAPI, validator Validator, advancedMode bool, credentials storage.Storage) *SignerAPI { if advancedMode { log.Info("Clef is in advanced mode: will warn instead of reject") } signer := &SignerAPI{big.NewInt(chainID), am, ui, validator, !advancedMode, credentials} - if !noUSB { + if usb { signer.startUSBListener() } return signer