-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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
inclusive terms: change whitelist terms #23290
inclusive terms: change whitelist terms #23290
Conversation
This PR breaks API compatibility, so it's a no go. |
@@ -101,7 +101,7 @@ var ( | |||
utils.UltraLightFractionFlag, | |||
utils.UltraLightOnlyAnnounceFlag, | |||
utils.LightNoSyncServeFlag, | |||
utils.WhitelistFlag, | |||
utils.AllowListFlag, |
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.
You disabled the whitelist flag.
|
@@ -77,7 +77,7 @@ var ( | |||
errAlreadyDialing = errors.New("already dialing") | |||
errAlreadyConnected = errors.New("already connected") | |||
errRecentlyDialed = errors.New("recently dialed") | |||
errNotWhitelisted = errors.New("not contained in netrestrict whitelist") | |||
errNotAllowListed = errors.New("not contained in netrestrict allowList") |
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.
This sounds like a mouthfull.
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.
The error name could be errNetRestrict
@@ -101,7 +101,7 @@ var ( | |||
utils.UltraLightFractionFlag, | |||
utils.UltraLightOnlyAnnounceFlag, | |||
utils.LightNoSyncServeFlag, | |||
utils.WhitelistFlag, | |||
utils.AllowListFlag, |
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.
utils.AllowListFlag, | |
utils.WhitelistFlag, | |
utils.AllowListFlag, |
should it work or should we use only Whitelist flag?
@@ -77,7 +77,7 @@ var ( | |||
errAlreadyDialing = errors.New("already dialing") | |||
errAlreadyConnected = errors.New("already connected") | |||
errRecentlyDialed = errors.New("recently dialed") | |||
errNotWhitelisted = errors.New("not contained in netrestrict whitelist") | |||
errNotAllowListed = errors.New("not contained in netrestrict allowList") |
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.
errNotAllowListed = errors.New("not contained in netrestrict allowList") | |
errNotAllowListed = errors.New("not contained in the netrestrict allowed list") |
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.
"not contained in netrestrict list"
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.
In general, I'm happy about the initiative to improve the terms, but unhappy about the PR changing unrelated components. I would much prefer if the changes were made individually.
// and then registers all of the APIs exposed by the services. | ||
func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error { | ||
func RegisterApisFromAllowList(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error { |
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.
For this function, both terms are not appropriate. The 'list' here really just a list of API names that should be registered, so we could simply call it RegisterAPIs
.
@@ -77,7 +77,7 @@ var ( | |||
errAlreadyDialing = errors.New("already dialing") | |||
errAlreadyConnected = errors.New("already connected") | |||
errRecentlyDialed = errors.New("recently dialed") | |||
errNotWhitelisted = errors.New("not contained in netrestrict whitelist") | |||
errNotAllowListed = errors.New("not contained in netrestrict allowList") |
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.
"not contained in netrestrict list"
@@ -93,7 +93,7 @@ type testMatcher struct { | |||
failpat []testFailure | |||
skiploadpat []*regexp.Regexp | |||
slowpat []*regexp.Regexp | |||
whitelistpat *regexp.Regexp | |||
allowlistpat *regexp.Regexp |
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.
Here, too, the term 'allowlist' doesn't capture the meaning in the same way that 'whitelist' did. Since we are not using this feature at all, we might as well just delete it completely.
// Whitelist of required block number -> hash values to accept | ||
Whitelist map[uint64]common.Hash `toml:"-"` | ||
// AllowList of required block number -> hash values to accept | ||
AllowList map[uint64]common.Hash `toml:"-"` |
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.
This change breaks compatibility with config files, so we cannot apply it without providing some kind of translator / deprecation mechanism.
You can check how to do this in https://github.com/ethereum/go-ethereum/blob/master/cmd/geth/config.go#L238
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.
When I've done it, seeing the tag "-"
I thought it was omitted, just here for reference not in the config file.
A team member gave me this reference https://github.com/BurntSushi/toml/blob/ebe1404fc680a89e43605f720106b16be2ba141c/encode.go#L561-L563
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.
Oh, I didn't notice that! That's OK then.
split of #23283 containing only the changes for the whitelist terms.
Thanks to @holiman for the prior review.