-
Notifications
You must be signed in to change notification settings - Fork 20.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/geth: don't fail on deprecated toml config fields #23118
Conversation
cmd/geth/config.go
Outdated
@@ -54,6 +55,9 @@ var ( | |||
} | |||
) | |||
|
|||
var empty = struct{}{} | |||
var deprecatedConfig map[string]struct{} = map[string]struct{}{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way where it doesn't just clutter the global scope would be to encapsulate in a function:
func deprecated(field string) bool{
switch(field){
case "foobar" , "bazonk": return true
}
return false
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks
0dc0c04
to
b6d2a54
Compare
cmd/geth/config.go
Outdated
return nil | ||
} else { | ||
link := "" | ||
fmt.Printf("hereee %v %s\n", rt.String(), field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is gone, I think we can merge this, and then update #23118 to actually make use of this feature, and get that one in aswell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops :) sorry will try to be more careful next time
b6d2a54
to
b27b85a
Compare
Co-authored-by: Martin Holst Swende <martin@swende.se>
332b282
to
5e76b19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This came up as part of #23111 where we want to remove some noop flags. However, removing their respective config fields causes all existing toml config files to break.
It introduces a way to gracefully deprecate config fields. The map
deprecatedConfig
should be populated by keys likeethconfig.Config.EVMInterpreter
.