cmd: remove deprecated flags --fast and --light

This commit is contained in:
Daniel Liu 2025-02-21 11:11:32 +08:00
parent a9f4b91fb8
commit 92bc30bc37
4 changed files with 9 additions and 31 deletions

View file

@ -44,7 +44,6 @@ var (
Flags: []cli.Flag{
utils.DataDirFlag,
utils.XDCXDataDirFlag,
utils.LightModeFlag,
utils.MainnetFlag,
utils.TestnetFlag,
utils.DevnetFlag,
@ -65,7 +64,7 @@ It expects the genesis file or the network name [ mainnet | testnet | devnet ] a
utils.DataDirFlag,
utils.XDCXDataDirFlag,
utils.CacheFlag,
utils.LightModeFlag,
utils.SyncModeFlag,
utils.GCModeFlag,
utils.CacheDatabaseFlag,
utils.CacheGCFlag,
@ -98,7 +97,7 @@ processing will proceed even if an individual RLP-file import failure occurs.`,
utils.DataDirFlag,
utils.XDCXDataDirFlag,
utils.CacheFlag,
utils.LightModeFlag,
utils.SyncModeFlag,
},
Description: `
Requires a first argument of the file to write to.
@ -115,7 +114,7 @@ if already existing.`,
utils.DataDirFlag,
utils.XDCXDataDirFlag,
utils.CacheFlag,
utils.LightModeFlag,
utils.SyncModeFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
@ -130,7 +129,7 @@ if already existing.`,
utils.DataDirFlag,
utils.XDCXDataDirFlag,
utils.CacheFlag,
utils.LightModeFlag,
utils.SyncModeFlag,
},
Description: `
The export-preimages command export hash preimages to an RLP encoded stream`,
@ -144,7 +143,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.DataDirFlag,
utils.XDCXDataDirFlag,
utils.CacheFlag,
utils.LightModeFlag,
utils.SyncModeFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `

View file

@ -87,8 +87,6 @@ var (
utils.TxPoolAccountQueueFlag,
utils.TxPoolGlobalQueueFlag,
utils.TxPoolLifetimeFlag,
utils.FastSyncFlag,
utils.LightModeFlag,
utils.SyncModeFlag,
utils.GCModeFlag,
//utils.LightServFlag,
@ -331,7 +329,7 @@ func startNode(ctx *cli.Context, stack *node.Node, cfg XDCConfig) {
// Start auxiliary services if enabled
// Mining only makes sense if a full Ethereum node is running
if ctx.Bool(utils.LightModeFlag.Name) || ctx.String(utils.SyncModeFlag.Name) == "light" {
if ctx.String(utils.SyncModeFlag.Name) == "light" {
utils.Fatalf("Light clients do not support staking")
}

View file

@ -1124,7 +1124,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
setBootstrapNodes(ctx, cfg)
// setBootstrapNodesV5(ctx, cfg)
lightClient := ctx.Bool(LightModeFlag.Name) || ctx.String(SyncModeFlag.Name) == "light"
lightClient := ctx.String(SyncModeFlag.Name) == "light"
lightServer := ctx.Int(LightServFlag.Name) != 0
lightPeers := ctx.Int(LightPeersFlag.Name)
@ -1395,8 +1395,6 @@ func SetXDCXConfig(ctx *cli.Context, cfg *XDCx.Config, XDCDataDir string) {
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// Avoid conflicting network flags
CheckExclusive(ctx, MainnetFlag, TestnetFlag, DevnetFlag, DeveloperFlag)
CheckExclusive(ctx, FastSyncFlag, LightModeFlag, SyncModeFlag)
CheckExclusive(ctx, LightServFlag, LightModeFlag)
CheckExclusive(ctx, LightServFlag, SyncModeFlag, "light")
ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
@ -1425,15 +1423,10 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
log.Debug("Sanitizing Go's GC trigger", "percent", int(gogc))
godebug.SetGCPercent(int(gogc))
switch {
case ctx.IsSet(SyncModeFlag.Name):
if ctx.IsSet(SyncModeFlag.Name) {
if err = cfg.SyncMode.UnmarshalText([]byte(ctx.String(SyncModeFlag.Name))); err != nil {
Fatalf("invalid --syncmode flag: %v", err)
}
case ctx.Bool(FastSyncFlag.Name):
cfg.SyncMode = downloader.FastSync
case ctx.Bool(LightModeFlag.Name):
cfg.SyncMode = downloader.LightSync
}
if ctx.IsSet(LightServFlag.Name) {
cfg.LightServ = ctx.Int(LightServFlag.Name)
@ -1618,7 +1611,7 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
handles = MakeDatabaseHandles(ctx.Int(FDLimitFlag.Name))
)
name := "chaindata"
if ctx.Bool(LightModeFlag.Name) {
if ctx.String(SyncModeFlag.Name) == "light" {
name = "lightchaindata"
}
chainDb, err := stack.OpenDatabase(name, cache, handles, "", readonly)

View file

@ -32,8 +32,6 @@ var ShowDeprecated = &cli.Command{
}
var DeprecatedFlags = []cli.Flag{
FastSyncFlag,
LightModeFlag,
NoUSBFlag,
LogBacktraceAtFlag,
LogDebugFlag,
@ -42,16 +40,6 @@ var DeprecatedFlags = []cli.Flag{
}
var (
FastSyncFlag = &cli.BoolFlag{
Name: "fast",
Usage: "Enable fast syncing through state downloads",
Category: flags.DeprecatedCategory,
}
LightModeFlag = &cli.BoolFlag{
Name: "light",
Usage: "Enable light client mode",
Category: flags.DeprecatedCategory,
}
// Deprecated May 2020, shown in aliased flags section
NoUSBFlag = &cli.BoolFlag{
Name: "nousb",