This commit is contained in:
Guillaume Ballet 2026-05-22 06:36:55 +02:00 committed by GitHub
commit d6e4522076
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 35 additions and 231 deletions

View file

@ -269,7 +269,6 @@ func init() {
configdirFlag, configdirFlag,
chainIdFlag, chainIdFlag,
utils.LightKDFFlag, utils.LightKDFFlag,
utils.NoUSBFlag,
utils.SmartCardDaemonPathFlag, utils.SmartCardDaemonPathFlag,
utils.HTTPListenAddrFlag, utils.HTTPListenAddrFlag,
utils.HTTPVirtualHostsFlag, utils.HTTPVirtualHostsFlag,
@ -408,8 +407,8 @@ func initInternalApi(c *cli.Context) (*core.UIServerAPI, core.UIClientAPI, error
ksLoc = c.String(keystoreFlag.Name) ksLoc = c.String(keystoreFlag.Name)
lightKdf = c.Bool(utils.LightKDFFlag.Name) lightKdf = c.Bool(utils.LightKDFFlag.Name)
) )
am := core.StartClefAccountManager(ksLoc, true, lightKdf, "") am := core.StartClefAccountManager(ksLoc, lightKdf, "")
api := core.NewSignerAPI(am, 0, true, ui, nil, false, pwStorage) api := core.NewSignerAPI(am, 0, ui, nil, false, pwStorage)
internalApi := core.NewUIServerAPI(api) internalApi := core.NewUIServerAPI(api)
return internalApi, ui, nil return internalApi, ui, nil
} }
@ -698,14 +697,13 @@ func signer(c *cli.Context) error {
ksLoc = c.String(keystoreFlag.Name) ksLoc = c.String(keystoreFlag.Name)
lightKdf = c.Bool(utils.LightKDFFlag.Name) lightKdf = c.Bool(utils.LightKDFFlag.Name)
advanced = c.Bool(advancedMode.Name) advanced = c.Bool(advancedMode.Name)
nousb = c.Bool(utils.NoUSBFlag.Name)
scpath = c.String(utils.SmartCardDaemonPathFlag.Name) scpath = c.String(utils.SmartCardDaemonPathFlag.Name)
) )
log.Info("Starting signer", "chainid", chainId, "keystore", ksLoc, log.Info("Starting signer", "chainid", chainId, "keystore", ksLoc,
"light-kdf", lightKdf, "advanced", advanced) "light-kdf", lightKdf, "advanced", advanced)
am := core.StartClefAccountManager(ksLoc, nousb, lightKdf, scpath) am := core.StartClefAccountManager(ksLoc, lightKdf, scpath)
defer am.Close() defer am.Close()
apiImpl := core.NewSignerAPI(am, chainId, nousb, ui, db, advanced, pwStorage) apiImpl := core.NewSignerAPI(am, chainId, ui, db, advanced, pwStorage)
// Establish the bidirectional communication, by creating a new UI backend and registering // Establish the bidirectional communication, by creating a new UI backend and registering
// it with the UI. // it with the UI.

View file

@ -101,7 +101,6 @@ if one is set. Otherwise it prints the genesis from the datadir.`,
utils.NoCompactionFlag, utils.NoCompactionFlag,
utils.LogSlowBlockFlag, utils.LogSlowBlockFlag,
utils.MetricsEnabledFlag, utils.MetricsEnabledFlag,
utils.MetricsEnabledExpensiveFlag,
utils.MetricsHTTPFlag, utils.MetricsHTTPFlag,
utils.MetricsPortFlag, utils.MetricsPortFlag,
utils.MetricsEnableInfluxDBFlag, utils.MetricsEnableInfluxDBFlag,
@ -116,7 +115,6 @@ if one is set. Otherwise it prints the genesis from the datadir.`,
utils.MetricsInfluxDBBucketFlag, utils.MetricsInfluxDBBucketFlag,
utils.MetricsInfluxDBOrganizationFlag, utils.MetricsInfluxDBOrganizationFlag,
utils.StateSizeTrackingFlag, utils.StateSizeTrackingFlag,
utils.TxLookupLimitFlag,
utils.VMTraceFlag, utils.VMTraceFlag,
utils.VMTraceJsonConfigFlag, utils.VMTraceJsonConfigFlag,
utils.TransactionHistoryFlag, utils.TransactionHistoryFlag,
@ -157,7 +155,7 @@ be gzipped.`,
Name: "import-history", Name: "import-history",
Usage: "Import an Era archive", Usage: "Import an Era archive",
ArgsUsage: "<dir>", ArgsUsage: "<dir>",
Flags: slices.Concat([]cli.Flag{utils.TxLookupLimitFlag, utils.TransactionHistoryFlag, utils.EraFormatFlag}, utils.DatabaseFlags, utils.NetworkFlags), Flags: slices.Concat([]cli.Flag{utils.TransactionHistoryFlag, utils.EraFormatFlag}, utils.DatabaseFlags, utils.NetworkFlags),
Description: ` Description: `
The import-history command will import blocks and their corresponding receipts The import-history command will import blocks and their corresponding receipts
from Era archives. from Era archives.

View file

@ -354,9 +354,6 @@ func applyMetricConfig(ctx *cli.Context, cfg *gethConfig) {
if ctx.IsSet(utils.MetricsEnabledFlag.Name) { if ctx.IsSet(utils.MetricsEnabledFlag.Name) {
cfg.Metrics.Enabled = ctx.Bool(utils.MetricsEnabledFlag.Name) cfg.Metrics.Enabled = ctx.Bool(utils.MetricsEnabledFlag.Name)
} }
if ctx.IsSet(utils.MetricsEnabledExpensiveFlag.Name) {
log.Warn("Expensive metrics are collected by default, please remove this flag", "flag", utils.MetricsEnabledExpensiveFlag.Name)
}
if ctx.IsSet(utils.MetricsHTTPFlag.Name) { if ctx.IsSet(utils.MetricsHTTPFlag.Name) {
cfg.Metrics.HTTP = ctx.String(utils.MetricsHTTPFlag.Name) cfg.Metrics.HTTP = ctx.String(utils.MetricsHTTPFlag.Name)
} }

View file

@ -51,10 +51,9 @@ func runMinimalGeth(t *testing.T, args ...string) *testgeth {
// then terminated by closing the input stream. // then terminated by closing the input stream.
func TestConsoleWelcome(t *testing.T) { func TestConsoleWelcome(t *testing.T) {
t.Parallel() t.Parallel()
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
// Start a geth console, make sure it's cleaned up and terminate the console // Start a geth console, make sure it's cleaned up and terminate the console
geth := runMinimalGeth(t, "--miner.etherbase", coinbase, "console") geth := runMinimalGeth(t, "console")
// Gather all the infos the welcome message needs to contain // Gather all the infos the welcome message needs to contain
geth.SetTemplateFunc("goos", func() string { return runtime.GOOS }) geth.SetTemplateFunc("goos", func() string { return runtime.GOOS })
@ -98,7 +97,7 @@ func TestAttachWelcome(t *testing.T) {
p := trulyRandInt(1024, 65533) // Yeah, sometimes this will fail, sorry :P p := trulyRandInt(1024, 65533) // Yeah, sometimes this will fail, sorry :P
httpPort = strconv.Itoa(p) httpPort = strconv.Itoa(p)
wsPort = strconv.Itoa(p + 1) wsPort = strconv.Itoa(p + 1)
geth := runMinimalGeth(t, "--miner.etherbase", "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182", geth := runMinimalGeth(t,
"--ipcpath", ipc, "--ipcpath", ipc,
"--http", "--http.port", httpPort, "--http", "--http.port", httpPort,
"--ws", "--ws.port", wsPort) "--ws", "--ws.port", wsPort)

View file

@ -49,13 +49,11 @@ var (
// flags that configure the node // flags that configure the node
nodeFlags = slices.Concat([]cli.Flag{ nodeFlags = slices.Concat([]cli.Flag{
utils.IdentityFlag, utils.IdentityFlag,
utils.UnlockedAccountFlag,
utils.PasswordFileFlag, utils.PasswordFileFlag,
utils.BootnodesFlag, utils.BootnodesFlag,
utils.MinFreeDiskSpaceFlag, utils.MinFreeDiskSpaceFlag,
utils.KeyStoreDirFlag, utils.KeyStoreDirFlag,
utils.ExternalSignerFlag, utils.ExternalSignerFlag,
utils.NoUSBFlag, // deprecated
utils.USBFlag, utils.USBFlag,
utils.SmartCardDaemonPathFlag, utils.SmartCardDaemonPathFlag,
utils.OverrideOsaka, utils.OverrideOsaka,
@ -63,7 +61,6 @@ var (
utils.OverrideBPO2, utils.OverrideBPO2,
utils.OverrideUBT, utils.OverrideUBT,
utils.OverrideGenesisFlag, utils.OverrideGenesisFlag,
utils.EnablePersonal, // deprecated
utils.TxPoolLocalsFlag, utils.TxPoolLocalsFlag,
utils.TxPoolNoLocalsFlag, utils.TxPoolNoLocalsFlag,
utils.TxPoolJournalFlag, utils.TxPoolJournalFlag,
@ -83,7 +80,6 @@ var (
utils.ExitWhenSyncedFlag, utils.ExitWhenSyncedFlag,
utils.GCModeFlag, utils.GCModeFlag,
utils.SnapshotFlag, utils.SnapshotFlag,
utils.TxLookupLimitFlag, // deprecated
utils.TransactionHistoryFlag, utils.TransactionHistoryFlag,
utils.ChainHistoryFlag, utils.ChainHistoryFlag,
utils.LogHistoryFlag, utils.LogHistoryFlag,
@ -95,12 +91,9 @@ var (
utils.BinTrieGroupDepthFlag, utils.BinTrieGroupDepthFlag,
utils.LightKDFFlag, utils.LightKDFFlag,
utils.EthRequiredBlocksFlag, utils.EthRequiredBlocksFlag,
utils.LegacyWhitelistFlag, // deprecated
utils.CacheFlag, utils.CacheFlag,
utils.CacheDatabaseFlag, utils.CacheDatabaseFlag,
utils.CacheTrieFlag, utils.CacheTrieFlag,
utils.CacheTrieJournalFlag, // deprecated
utils.CacheTrieRejournalFlag, // deprecated
utils.CacheGCFlag, utils.CacheGCFlag,
utils.CacheSnapshotFlag, utils.CacheSnapshotFlag,
utils.CacheNoPrefetchFlag, utils.CacheNoPrefetchFlag,
@ -112,20 +105,16 @@ var (
utils.DiscoveryPortFlag, utils.DiscoveryPortFlag,
utils.MaxPeersFlag, utils.MaxPeersFlag,
utils.MaxPendingPeersFlag, utils.MaxPendingPeersFlag,
utils.MiningEnabledFlag, // deprecated
utils.MinerGasLimitFlag, utils.MinerGasLimitFlag,
utils.MinerGasPriceFlag, utils.MinerGasPriceFlag,
utils.MinerEtherbaseFlag, // deprecated
utils.MinerExtraDataFlag, utils.MinerExtraDataFlag,
utils.MinerMaxBlobsFlag, utils.MinerMaxBlobsFlag,
utils.MinerRecommitIntervalFlag, utils.MinerRecommitIntervalFlag,
utils.MinerPendingFeeRecipientFlag, utils.MinerPendingFeeRecipientFlag,
utils.MinerNewPayloadTimeoutFlag, // deprecated
utils.NATFlag, utils.NATFlag,
utils.NoDiscoverFlag, utils.NoDiscoverFlag,
utils.DiscoveryV4Flag, utils.DiscoveryV4Flag,
utils.DiscoveryV5Flag, utils.DiscoveryV5Flag,
utils.LegacyDiscoveryV5Flag, // deprecated
utils.NetrestrictFlag, utils.NetrestrictFlag,
utils.NodeKeyFileFlag, utils.NodeKeyFileFlag,
utils.NodeKeyHexFlag, utils.NodeKeyHexFlag,
@ -145,8 +134,6 @@ var (
utils.GpoMaxGasPriceFlag, utils.GpoMaxGasPriceFlag,
utils.GpoIgnoreGasPriceFlag, utils.GpoIgnoreGasPriceFlag,
configFileFlag, configFileFlag,
utils.LogDebugFlag,
utils.LogBacktraceAtFlag,
utils.BeaconApiFlag, utils.BeaconApiFlag,
utils.BeaconApiHeaderFlag, utils.BeaconApiHeaderFlag,
utils.BeaconThresholdFlag, utils.BeaconThresholdFlag,
@ -182,7 +169,6 @@ var (
utils.WSPathPrefixFlag, utils.WSPathPrefixFlag,
utils.IPCDisabledFlag, utils.IPCDisabledFlag,
utils.IPCPathFlag, utils.IPCPathFlag,
utils.InsecureUnlockAllowedFlag,
utils.RPCGlobalGasCapFlag, utils.RPCGlobalGasCapFlag,
utils.RPCGlobalEVMTimeoutFlag, utils.RPCGlobalEVMTimeoutFlag,
utils.RPCGlobalTxFeeCapFlag, utils.RPCGlobalTxFeeCapFlag,
@ -204,7 +190,6 @@ var (
metricsFlags = []cli.Flag{ metricsFlags = []cli.Flag{
utils.MetricsEnabledFlag, utils.MetricsEnabledFlag,
utils.MetricsEnabledExpensiveFlag,
utils.MetricsHTTPFlag, utils.MetricsHTTPFlag,
utils.MetricsPortFlag, utils.MetricsPortFlag,
utils.MetricsEnableInfluxDBFlag, utils.MetricsEnableInfluxDBFlag,
@ -340,10 +325,6 @@ func startNode(ctx *cli.Context, stack *node.Node, isConsole bool) {
// Start up the node itself // Start up the node itself
utils.StartNode(ctx, stack, isConsole) utils.StartNode(ctx, stack, isConsole)
if ctx.IsSet(utils.UnlockedAccountFlag.Name) {
log.Warn(`The "unlock" flag has been deprecated and has no effect`)
}
// Register wallet event handlers to open and auto-derive wallets // Register wallet event handlers to open and auto-derive wallets
events := make(chan accounts.WalletEvent, 16) events := make(chan accounts.WalletEvent, 16)
stack.AccountManager().Subscribe(events) stack.AccountManager().Subscribe(events)

View file

@ -32,8 +32,7 @@ type testgeth struct {
*cmdtest.TestCmd *cmdtest.TestCmd
// template variables for expect // template variables for expect
Datadir string Datadir string
Etherbase string
} }
func init() { func init() {
@ -75,10 +74,6 @@ func runGeth(t *testing.T, args ...string) *testgeth {
if i < len(args)-1 { if i < len(args)-1 {
tt.Datadir = args[i+1] tt.Datadir = args[i+1]
} }
case "--miner.etherbase":
if i < len(args)-1 {
tt.Etherbase = args[i+1]
}
} }
} }
if tt.Datadir == "" { if tt.Datadir == "" {

View file

@ -1432,9 +1432,6 @@ func MakeDatabaseHandles(max int) int {
// setEtherbase retrieves the etherbase from the directly specified command line flags. // setEtherbase retrieves the etherbase from the directly specified command line flags.
func setEtherbase(ctx *cli.Context, cfg *ethconfig.Config) { func setEtherbase(ctx *cli.Context, cfg *ethconfig.Config) {
if ctx.IsSet(MinerEtherbaseFlag.Name) {
log.Warn("Option --miner.etherbase is deprecated as the etherbase is set by the consensus client post-merge")
}
if !ctx.IsSet(MinerPendingFeeRecipientFlag.Name) { if !ctx.IsSet(MinerPendingFeeRecipientFlag.Name) {
return return
} }
@ -1507,9 +1504,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
if ctx.IsSet(JWTSecretFlag.Name) { if ctx.IsSet(JWTSecretFlag.Name) {
cfg.JWTSecret = ctx.String(JWTSecretFlag.Name) cfg.JWTSecret = ctx.String(JWTSecretFlag.Name)
} }
if ctx.IsSet(EnablePersonal.Name) {
log.Warn(fmt.Sprintf("Option --%s is deprecated. The 'personal' RPC namespace has been removed.", EnablePersonal.Name))
}
if ctx.IsSet(ExternalSignerFlag.Name) { if ctx.IsSet(ExternalSignerFlag.Name) {
cfg.ExternalSigner = ctx.String(ExternalSignerFlag.Name) cfg.ExternalSigner = ctx.String(ExternalSignerFlag.Name)
@ -1524,15 +1518,9 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
if ctx.IsSet(LightKDFFlag.Name) { if ctx.IsSet(LightKDFFlag.Name) {
cfg.UseLightweightKDF = ctx.Bool(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) { if ctx.IsSet(USBFlag.Name) {
cfg.USB = ctx.Bool(USBFlag.Name) cfg.USB = ctx.Bool(USBFlag.Name)
} }
if ctx.IsSet(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)
if dbEngine != "leveldb" && dbEngine != "pebble" { if dbEngine != "leveldb" && dbEngine != "pebble" {
@ -1541,13 +1529,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
log.Info(fmt.Sprintf("Using %s as db engine", dbEngine)) log.Info(fmt.Sprintf("Using %s as db engine", dbEngine))
cfg.DBEngine = dbEngine cfg.DBEngine = dbEngine
} }
// deprecation notice for log debug flags (TODO: find a more appropriate place to put these?)
if ctx.IsSet(LogBacktraceAtFlag.Name) {
log.Warn("Option --log.backtrace flag is deprecated")
}
if ctx.IsSet(LogDebugFlag.Name) {
log.Warn("Option --log.debug flag is deprecated")
}
} }
func setSmartCard(ctx *cli.Context, cfg *node.Config) { func setSmartCard(ctx *cli.Context, cfg *node.Config) {
@ -1685,9 +1666,6 @@ func setBlobPool(ctx *cli.Context, cfg *blobpool.Config) {
} }
func setMiner(ctx *cli.Context, cfg *miner.Config) { func setMiner(ctx *cli.Context, cfg *miner.Config) {
if ctx.Bool(MiningEnabledFlag.Name) {
log.Warn("The flag --mine is deprecated and will be removed")
}
if ctx.IsSet(MinerExtraDataFlag.Name) { if ctx.IsSet(MinerExtraDataFlag.Name) {
cfg.ExtraData = []byte(ctx.String(MinerExtraDataFlag.Name)) cfg.ExtraData = []byte(ctx.String(MinerExtraDataFlag.Name))
} }
@ -1700,10 +1678,6 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
if ctx.IsSet(MinerRecommitIntervalFlag.Name) { if ctx.IsSet(MinerRecommitIntervalFlag.Name) {
cfg.Recommit = ctx.Duration(MinerRecommitIntervalFlag.Name) cfg.Recommit = ctx.Duration(MinerRecommitIntervalFlag.Name)
} }
if ctx.IsSet(MinerNewPayloadTimeoutFlag.Name) {
log.Warn("The flag --miner.newpayload-timeout is deprecated and will be removed, please use --miner.recommit")
cfg.Recommit = ctx.Duration(MinerNewPayloadTimeoutFlag.Name)
}
if ctx.IsSet(MinerMaxBlobsFlag.Name) { if ctx.IsSet(MinerMaxBlobsFlag.Name) {
cfg.MaxBlobsPerBlock = ctx.Int(MinerMaxBlobsFlag.Name) cfg.MaxBlobsPerBlock = ctx.Int(MinerMaxBlobsFlag.Name)
} }
@ -1712,12 +1686,7 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) { func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) {
requiredBlocks := ctx.String(EthRequiredBlocksFlag.Name) requiredBlocks := ctx.String(EthRequiredBlocksFlag.Name)
if requiredBlocks == "" { if requiredBlocks == "" {
if ctx.IsSet(LegacyWhitelistFlag.Name) { return
log.Warn("The flag --whitelist is deprecated and will be removed, please use --eth.requiredblocks")
requiredBlocks = ctx.String(LegacyWhitelistFlag.Name)
} else {
return
}
} }
cfg.RequiredBlocks = make(map[uint64]common.Hash) cfg.RequiredBlocks = make(map[uint64]common.Hash)
for _, entry := range strings.Split(requiredBlocks, ",") { for _, entry := range strings.Split(requiredBlocks, ",") {
@ -1837,9 +1806,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
} }
if ctx.IsSet(TransactionHistoryFlag.Name) { if ctx.IsSet(TransactionHistoryFlag.Name) {
cfg.TransactionHistory = ctx.Uint64(TransactionHistoryFlag.Name) cfg.TransactionHistory = ctx.Uint64(TransactionHistoryFlag.Name)
} else if ctx.IsSet(TxLookupLimitFlag.Name) {
log.Warn("The flag --txlookuplimit is deprecated and will be removed, please use --history.transactions")
cfg.TransactionHistory = ctx.Uint64(TxLookupLimitFlag.Name)
} }
if ctx.String(GCModeFlag.Name) == "archive" { if ctx.String(GCModeFlag.Name) == "archive" {
if cfg.TransactionHistory != 0 { if cfg.TransactionHistory != 0 {

View file

@ -19,8 +19,6 @@ package utils
import ( import (
"fmt" "fmt"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/internal/flags"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
@ -32,127 +30,7 @@ var ShowDeprecated = &cli.Command{
Description: "Show flags that have been deprecated and will soon be removed", Description: "Show flags that have been deprecated and will soon be removed",
} }
var DeprecatedFlags = []cli.Flag{ var DeprecatedFlags = []cli.Flag{}
NoUSBFlag,
LegacyWhitelistFlag,
CacheTrieJournalFlag,
CacheTrieRejournalFlag,
LegacyDiscoveryV5Flag,
TxLookupLimitFlag,
LogBacktraceAtFlag,
LogDebugFlag,
MinerNewPayloadTimeoutFlag,
MinerEtherbaseFlag,
MiningEnabledFlag,
MetricsEnabledExpensiveFlag,
EnablePersonal,
UnlockedAccountFlag,
InsecureUnlockAllowedFlag,
}
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",
Hidden: true,
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>) (deprecated in favor of --eth.requiredblocks)",
Category: flags.DeprecatedCategory,
}
// Deprecated July 2023
CacheTrieJournalFlag = &cli.StringFlag{
Name: "cache.trie.journal",
Hidden: true,
Usage: "Disk journal directory for trie cache to survive node restarts",
Category: flags.DeprecatedCategory,
}
CacheTrieRejournalFlag = &cli.DurationFlag{
Name: "cache.trie.rejournal",
Hidden: true,
Usage: "Time interval to regenerate the trie cache journal",
Category: flags.DeprecatedCategory,
}
LegacyDiscoveryV5Flag = &cli.BoolFlag{
Name: "v5disc",
Hidden: true,
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism (deprecated, use --discv5 instead)",
Category: flags.DeprecatedCategory,
}
// Deprecated August 2023
TxLookupLimitFlag = &cli.Uint64Flag{
Name: "txlookuplimit",
Hidden: true,
Usage: "Number of recent blocks to maintain transactions index for (default = about one year, 0 = entire chain) (deprecated, use history.transactions instead)",
Value: ethconfig.Defaults.TransactionHistory,
Category: flags.DeprecatedCategory,
}
// Deprecated November 2023
LogBacktraceAtFlag = &cli.StringFlag{
Name: "log.backtrace",
Hidden: true,
Usage: "Request a stack trace at a specific logging statement (deprecated)",
Value: "",
Category: flags.DeprecatedCategory,
}
LogDebugFlag = &cli.BoolFlag{
Name: "log.debug",
Hidden: true,
Usage: "Prepends log messages with call-site location (deprecated)",
Category: flags.DeprecatedCategory,
}
// Deprecated February 2024
MinerNewPayloadTimeoutFlag = &cli.DurationFlag{
Name: "miner.newpayload-timeout",
Hidden: true,
Usage: "Specify the maximum time allowance for creating a new payload (deprecated)",
Value: ethconfig.Defaults.Miner.Recommit,
Category: flags.DeprecatedCategory,
}
MinerEtherbaseFlag = &cli.StringFlag{
Name: "miner.etherbase",
Hidden: true,
Usage: "0x prefixed public address for block mining rewards (deprecated)",
Category: flags.DeprecatedCategory,
}
MiningEnabledFlag = &cli.BoolFlag{
Name: "mine",
Hidden: true,
Usage: "Enable mining (deprecated)",
Category: flags.DeprecatedCategory,
}
MetricsEnabledExpensiveFlag = &cli.BoolFlag{
Name: "metrics.expensive",
Hidden: true,
Usage: "Enable expensive metrics collection and reporting (deprecated)",
Category: flags.DeprecatedCategory,
}
// Deprecated Oct 2024
EnablePersonal = &cli.BoolFlag{
Name: "rpc.enabledeprecatedpersonal",
Hidden: true,
Usage: "This used to enable the 'personal' namespace.",
Category: flags.DeprecatedCategory,
}
UnlockedAccountFlag = &cli.StringFlag{
Name: "unlock",
Hidden: true,
Usage: "Comma separated list of accounts to unlock (deprecated)",
Value: "",
Category: flags.DeprecatedCategory,
}
InsecureUnlockAllowedFlag = &cli.BoolFlag{
Name: "allow-insecure-unlock",
Hidden: true,
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http (deprecated)",
Category: flags.DeprecatedCategory,
}
)
// showDeprecated displays deprecated flags that will be soon removed from the codebase. // showDeprecated displays deprecated flags that will be soon removed from the codebase.
func showDeprecated(*cli.Context) error { func showDeprecated(*cli.Context) error {

View file

@ -86,10 +86,6 @@ type Config struct {
// InsecureUnlockAllowed is a deprecated option to allow users to accounts in unsafe http environment. // InsecureUnlockAllowed is a deprecated option to allow users to accounts in unsafe http environment.
InsecureUnlockAllowed bool `toml:",omitempty"` 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 enables hardware wallet monitoring and connectivity.
USB bool `toml:",omitempty"` USB bool `toml:",omitempty"`

View file

@ -130,7 +130,7 @@ type Metadata struct {
Origin string `json:"Origin"` Origin string `json:"Origin"`
} }
func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath string) *accounts.Manager { func StartClefAccountManager(ksLocation string, lightKDF bool, scpath string) *accounts.Manager {
var ( var (
backends []accounts.Backend backends []accounts.Backend
n, p = keystore.StandardScryptN, keystore.StandardScryptP n, p = keystore.StandardScryptN, keystore.StandardScryptP
@ -142,28 +142,26 @@ func StartClefAccountManager(ksLocation string, nousb, lightKDF bool, scpath str
if len(ksLocation) > 0 { if len(ksLocation) > 0 {
backends = append(backends, keystore.NewKeyStore(ksLocation, n, p)) backends = append(backends, keystore.NewKeyStore(ksLocation, n, p))
} }
if !nousb { // Start a USB hub for Ledger hardware wallets
// Start a USB hub for Ledger hardware wallets if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil {
if ledgerhub, err := usbwallet.NewLedgerHub(); err != nil { log.Warn(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err))
log.Warn(fmt.Sprintf("Failed to start Ledger hub, disabling: %v", err)) } else {
} else { backends = append(backends, ledgerhub)
backends = append(backends, ledgerhub) log.Debug("Ledger support enabled")
log.Debug("Ledger support enabled") }
} // Start a USB hub for Trezor hardware wallets (HID version)
// Start a USB hub for Trezor hardware wallets (HID version) if trezorhub, err := usbwallet.NewTrezorHubWithHID(); err != nil {
if trezorhub, err := usbwallet.NewTrezorHubWithHID(); err != nil { log.Warn(fmt.Sprintf("Failed to start HID Trezor hub, disabling: %v", err))
log.Warn(fmt.Sprintf("Failed to start HID Trezor hub, disabling: %v", err)) } else {
} else { backends = append(backends, trezorhub)
backends = append(backends, trezorhub) log.Debug("Trezor support enabled via HID")
log.Debug("Trezor support enabled via HID") }
} // Start a USB hub for Trezor hardware wallets (WebUSB version)
// Start a USB hub for Trezor hardware wallets (WebUSB version) if trezorhub, err := usbwallet.NewTrezorHubWithWebUSB(); err != nil {
if trezorhub, err := usbwallet.NewTrezorHubWithWebUSB(); err != nil { log.Warn(fmt.Sprintf("Failed to start WebUSB Trezor hub, disabling: %v", err))
log.Warn(fmt.Sprintf("Failed to start WebUSB Trezor hub, disabling: %v", err)) } else {
} else { backends = append(backends, trezorhub)
backends = append(backends, trezorhub) log.Debug("Trezor support enabled via WebUSB")
log.Debug("Trezor support enabled via WebUSB")
}
} }
// Start a smart card hub // Start a smart card hub
@ -282,14 +280,12 @@ var ErrRequestDenied = errors.New("request denied")
// key that is generated when a new Account is created. // key that is generated when a new Account is created.
// noUSB disables USB support that is required to support hardware devices such as // noUSB disables USB support that is required to support hardware devices such as
// ledger and trezor. // 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, ui UIClientAPI, validator Validator, advancedMode bool, credentials storage.Storage) *SignerAPI {
if advancedMode { if advancedMode {
log.Info("Clef is in advanced mode: will warn instead of reject") log.Info("Clef is in advanced mode: will warn instead of reject")
} }
signer := &SignerAPI{big.NewInt(chainID), am, ui, validator, !advancedMode, credentials} signer := &SignerAPI{big.NewInt(chainID), am, ui, validator, !advancedMode, credentials}
if !noUSB { signer.startUSBListener()
signer.startUSBListener()
}
return signer return signer
} }
func (api *SignerAPI) openTrezor(url accounts.URL) { func (api *SignerAPI) openTrezor(url accounts.URL) {

View file

@ -120,8 +120,8 @@ func setup(t *testing.T) (*core.SignerAPI, *headlessUi) {
t.Fatal(err.Error()) t.Fatal(err.Error())
} }
ui := &headlessUi{make(chan string, 20), make(chan string, 20)} ui := &headlessUi{make(chan string, 20), make(chan string, 20)}
am := core.StartClefAccountManager(tmpDirName(t), true, true, "") am := core.StartClefAccountManager(tmpDirName(t), true, "")
api := core.NewSignerAPI(am, 1337, true, ui, db, true, &storage.NoStorage{}) api := core.NewSignerAPI(am, 1337, ui, db, true, &storage.NoStorage{})
return api, ui return api, ui
} }
func createAccount(ui *headlessUi, api *core.SignerAPI, t *testing.T) { func createAccount(ui *headlessUi, api *core.SignerAPI, t *testing.T) {