Skip to content

Commit

Permalink
cmd/geth: add field deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Aug 15, 2024
1 parent 0b1880e commit e68aed2
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ var tomlSettings = toml.Config{
},
MissingField: func(rt reflect.Type, field string) error {
id := fmt.Sprintf("%s.%s", rt.String(), field)
if deprecated(id) {
log.Warn("Config field is deprecated and won't have an effect", "name", id)
if deprecatedConfigFields[id] {
log.Warn(fmt.Sprintf("Config field '%s' is deprecated and won't have any effect.", id))
return nil
}
var link string
Expand All @@ -87,6 +87,19 @@ var tomlSettings = toml.Config{
},
}

var deprecatedConfigFields = map[string]bool{
"ethconfig.Config.EVMInterpreter": true,
"ethconfig.Config.EWASMInterpreter": true,
"ethconfig.Config.TrieCleanCacheJournal": true,
"ethconfig.Config.TrieCleanCacheRejournal": true,
"ethconfig.Config.LightServ": true,
"ethconfig.Config.LightIngress": true,
"ethconfig.Config.LightEgress": true,
"ethconfig.Config.LightPeers": true,
"ethconfig.Config.LightNoPrune": true,
"ethconfig.Config.LightNoSyncServe": true,
}

type ethstatsConfig struct {
URL string `toml:",omitempty"`
}
Expand Down Expand Up @@ -314,21 +327,6 @@ func applyMetricConfig(ctx *cli.Context, cfg *gethConfig) {
}
}

func deprecated(field string) bool {
switch field {
case "ethconfig.Config.EVMInterpreter":
return true
case "ethconfig.Config.EWASMInterpreter":
return true
case "ethconfig.Config.TrieCleanCacheJournal":
return true
case "ethconfig.Config.TrieCleanCacheRejournal":
return true
default:
return false
}
}

func setAccountManagerBackends(conf *node.Config, am *accounts.Manager, keydir string) error {
scryptN := keystore.StandardScryptN
scryptP := keystore.StandardScryptP
Expand Down

0 comments on commit e68aed2

Please sign in to comment.