-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
should it work or should we use only Whitelist flag? |
||||||||
utils.BloomFilterSizeFlag, | ||||||||
utils.CacheFlag, | ||||||||
utils.CacheDatabaseFlag, | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,8 +137,8 @@ type Config struct { | |
|
||
TxLookupLimit uint64 `toml:",omitempty"` // The maximum number of blocks from head whose tx indices are reserved. | ||
|
||
// 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. When I've done it, seeing the tag There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I didn't notice that! That's OK then. |
||
|
||
// Light client options | ||
LightServ int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,7 +280,7 @@ func (h *httpServer) enableRPC(apis []rpc.API, config httpConfig) error { | |
|
||
// Create RPC server and handler. | ||
srv := rpc.NewServer() | ||
if err := RegisterApisFromWhitelist(apis, config.Modules, srv, false); err != nil { | ||
if err := RegisterApisFromAllowList(apis, config.Modules, srv, false); err != nil { | ||
return err | ||
} | ||
h.httpConfig = config | ||
|
@@ -312,7 +312,7 @@ func (h *httpServer) enableWS(apis []rpc.API, config wsConfig) error { | |
|
||
// Create RPC server and handler. | ||
srv := rpc.NewServer() | ||
if err := RegisterApisFromWhitelist(apis, config.Modules, srv, false); err != nil { | ||
if err := RegisterApisFromAllowList(apis, config.Modules, srv, false); err != nil { | ||
return err | ||
} | ||
h.wsConfig = config | ||
|
@@ -515,20 +515,20 @@ func (is *ipcServer) stop() error { | |
return err | ||
} | ||
|
||
// RegisterApisFromWhitelist checks the given modules' availability, generates a whitelist based on the allowed modules, | ||
// 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. Choose a reason for hiding this commentThe 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 |
||
if bad, available := checkModuleAvailability(modules, apis); len(bad) > 0 { | ||
log.Error("Unavailable modules in HTTP API list", "unavailable", bad, "available", available) | ||
} | ||
// Generate the whitelist based on the allowed modules | ||
whitelist := make(map[string]bool) | ||
// Generate the allow list based on the allowed modules | ||
allowList := make(map[string]bool) | ||
for _, module := range modules { | ||
whitelist[module] = true | ||
allowList[module] = true | ||
} | ||
// Register all the APIs exposed by the services | ||
for _, api := range apis { | ||
if exposeAll || whitelist[api.Namespace] || (len(whitelist) == 0 && api.Public) { | ||
if exposeAll || allowList[api.Namespace] || (len(allowList) == 0 && api.Public) { | ||
if err := srv.RegisterName(api.Namespace, api.Service); err != nil { | ||
return err | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The error name could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "not contained in netrestrict list" |
||||||
errNoPort = errors.New("node does not provide TCP port") | ||||||
) | ||||||
|
||||||
|
@@ -133,7 +133,7 @@ type dialConfig struct { | |||||
self enode.ID // our own ID | ||||||
maxDialPeers int // maximum number of dialed peers | ||||||
maxActiveDials int // maximum number of active dials | ||||||
netRestrict *netutil.Netlist // IP whitelist, disabled if nil | ||||||
netRestrict *netutil.Netlist // IP allowlist, disabled if nil | ||||||
resolver nodeResolver | ||||||
dialer NodeDialer | ||||||
log log.Logger | ||||||
|
@@ -402,7 +402,7 @@ func (d *dialScheduler) checkDial(n *enode.Node) error { | |||||
return errAlreadyConnected | ||||||
} | ||||||
if d.netRestrict != nil && !d.netRestrict.Contains(n.IP()) { | ||||||
return errNotWhitelisted | ||||||
return errNotAllowListed | ||||||
} | ||||||
if d.history.contains(string(n.ID().Bytes())) { | ||||||
return errRecentlyDialed | ||||||
|
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.