Skip to content
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

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Jun 28, 2021

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 like ethconfig.Config.EVMInterpreter.

cmd/geth/config.go Outdated Show resolved Hide resolved
@@ -54,6 +55,9 @@ var (
}
)

var empty = struct{}{}
var deprecatedConfig map[string]struct{} = map[string]struct{}{}
Copy link
Contributor

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
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks

@s1na s1na force-pushed the config-ignore-deprecated branch from 0dc0c04 to b6d2a54 Compare June 28, 2021 14:57
return nil
} else {
link := ""
fmt.Printf("hereee %v %s\n", rt.String(), field)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Copy link
Contributor

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

Copy link
Contributor Author

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

@s1na s1na force-pushed the config-ignore-deprecated branch from b6d2a54 to b27b85a Compare June 30, 2021 09:18
cmd/geth/config.go Outdated Show resolved Hide resolved
Co-authored-by: Martin Holst Swende <martin@swende.se>
@s1na s1na force-pushed the config-ignore-deprecated branch from 332b282 to 5e76b19 Compare June 30, 2021 09:52
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman added this to the 1.10.5 milestone Jun 30, 2021
@holiman holiman merged commit ec88bd0 into ethereum:master Jun 30, 2021
@s1na s1na deleted the config-ignore-deprecated branch June 30, 2021 11:01
sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Jun 30, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants