inclusive terms: change whitelist terms#23290
inclusive terms: change whitelist terms#23290baptiste-b-pegasys wants to merge 1 commit intoethereum:masterfrom
Conversation
|
This PR breaks API compatibility, so it's a no go. |
| utils.UltraLightOnlyAnnounceFlag, | ||
| utils.LightNoSyncServeFlag, | ||
| utils.WhitelistFlag, | ||
| utils.AllowListFlag, |
There was a problem hiding this comment.
You disabled the whitelist flag.
|
|
| 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.
The error name could be errNetRestrict
| utils.UltraLightOnlyAnnounceFlag, | ||
| utils.LightNoSyncServeFlag, | ||
| utils.WhitelistFlag, | ||
| utils.AllowListFlag, |
There was a problem hiding this comment.
| utils.AllowListFlag, | |
| utils.WhitelistFlag, | |
| utils.AllowListFlag, |
should it work or should we use only Whitelist flag?
| 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.
| 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.
"not contained in netrestrict list"
fjl
left a comment
There was a problem hiding this comment.
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.
| // RegisterApisFromAllowList checks the given modules' availability, generates an allowlist based on the allowed modules, | ||
| // 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.
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.
| 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.
"not contained in netrestrict list"
| skiploadpat []*regexp.Regexp | ||
| slowpat []*regexp.Regexp | ||
| whitelistpat *regexp.Regexp | ||
| allowlistpat *regexp.Regexp |
There was a problem hiding this comment.
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.
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.
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.
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.