Skip to content

inclusive terms: change whitelist terms#23290

Closed
baptiste-b-pegasys wants to merge 1 commit intoethereum:masterfrom
baptiste-b-pegasys:inclusivelanguage/whitelist
Closed

inclusive terms: change whitelist terms#23290
baptiste-b-pegasys wants to merge 1 commit intoethereum:masterfrom
baptiste-b-pegasys:inclusivelanguage/whitelist

Conversation

@baptiste-b-pegasys
Copy link
Copy Markdown
Contributor

@baptiste-b-pegasys baptiste-b-pegasys commented Jul 29, 2021

split of #23283 containing only the changes for the whitelist terms.

Thanks to @holiman for the prior review.

@karalabe
Copy link
Copy Markdown
Member

This PR breaks API compatibility, so it's a no go.

Comment thread cmd/geth/main.go
utils.UltraLightOnlyAnnounceFlag,
utils.LightNoSyncServeFlag,
utils.WhitelistFlag,
utils.AllowListFlag,
Copy link
Copy Markdown
Member

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.

@karalabe
Copy link
Copy Markdown
Member

Allow list is not a good enough change. The block whitelist enforces the specified hashes to be present at the remote side. It's not merely a suggestion, rather a requirement.

Comment thread p2p/dial.go
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")
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor

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

Comment thread cmd/geth/main.go
utils.UltraLightOnlyAnnounceFlag,
utils.LightNoSyncServeFlag,
utils.WhitelistFlag,
utils.AllowListFlag,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
utils.AllowListFlag,
utils.WhitelistFlag,
utils.AllowListFlag,

should it work or should we use only Whitelist flag?

Comment thread p2p/dial.go
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")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
errNotAllowListed = errors.New("not contained in netrestrict allowList")
errNotAllowListed = errors.New("not contained in the netrestrict allowed list")

Copy link
Copy Markdown
Contributor

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"

Copy link
Copy Markdown
Contributor

@fjl fjl left a 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.

Comment thread node/rpcstack.go
// 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 {
Copy link
Copy Markdown
Contributor

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.

Comment thread p2p/dial.go
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")
Copy link
Copy Markdown
Contributor

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"

Comment thread tests/init_test.go
skiploadpat []*regexp.Regexp
slowpat []*regexp.Regexp
whitelistpat *regexp.Regexp
allowlistpat *regexp.Regexp
Copy link
Copy Markdown
Contributor

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.

Comment thread eth/ethconfig/config.go
// 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:"-"`
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

@baptiste-b-pegasys baptiste-b-pegasys Jul 29, 2021

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

Copy link
Copy Markdown
Contributor

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.

@baptiste-b-pegasys
Copy link
Copy Markdown
Contributor Author

thank you @karalabe and @fjl for the review, I will split this PR by feature, with the requested changes

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.

3 participants