未验证 提交 930e82d7 编写于 作者: M Marius van der Wijden 提交者: GitHub

params, cmd/utils: remove outdated discv5 bootnodes, deprecate flags (#20949)

* params: remove outdated discv5 bootnodes

* cmd/utils: deprecated bootnodesv4/v5 flags
上级 37877e86
...@@ -61,8 +61,8 @@ var ( ...@@ -61,8 +61,8 @@ var (
utils.UnlockedAccountFlag, utils.UnlockedAccountFlag,
utils.PasswordFileFlag, utils.PasswordFileFlag,
utils.BootnodesFlag, utils.BootnodesFlag,
utils.BootnodesV4Flag, utils.LegacyBootnodesV4Flag,
utils.BootnodesV5Flag, utils.LegacyBootnodesV5Flag,
utils.DataDirFlag, utils.DataDirFlag,
utils.AncientFlag, utils.AncientFlag,
utils.KeyStoreDirFlag, utils.KeyStoreDirFlag,
......
...@@ -183,8 +183,8 @@ var AppHelpFlagGroups = []flagGroup{ ...@@ -183,8 +183,8 @@ var AppHelpFlagGroups = []flagGroup{
Name: "NETWORKING", Name: "NETWORKING",
Flags: []cli.Flag{ Flags: []cli.Flag{
utils.BootnodesFlag, utils.BootnodesFlag,
utils.BootnodesV4Flag, utils.LegacyBootnodesV4Flag,
utils.BootnodesV5Flag, utils.LegacyBootnodesV5Flag,
utils.DNSDiscoveryFlag, utils.DNSDiscoveryFlag,
utils.ListenPortFlag, utils.ListenPortFlag,
utils.MaxPeersFlag, utils.MaxPeersFlag,
......
...@@ -595,17 +595,7 @@ var ( ...@@ -595,17 +595,7 @@ var (
} }
BootnodesFlag = cli.StringFlag{ BootnodesFlag = cli.StringFlag{
Name: "bootnodes", Name: "bootnodes",
Usage: "Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)", Usage: "Comma separated enode URLs for P2P discovery bootstrap",
Value: "",
}
BootnodesV4Flag = cli.StringFlag{
Name: "bootnodesv4",
Usage: "Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes)",
Value: "",
}
BootnodesV5Flag = cli.StringFlag{
Name: "bootnodesv5",
Usage: "Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes)",
Value: "", Value: "",
} }
NodeKeyFileFlag = cli.StringFlag{ NodeKeyFileFlag = cli.StringFlag{
...@@ -793,9 +783,9 @@ func setNodeUserIdent(ctx *cli.Context, cfg *node.Config) { ...@@ -793,9 +783,9 @@ func setNodeUserIdent(ctx *cli.Context, cfg *node.Config) {
func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls := params.MainnetBootnodes urls := params.MainnetBootnodes
switch { switch {
case ctx.GlobalIsSet(BootnodesFlag.Name) || ctx.GlobalIsSet(BootnodesV4Flag.Name): case ctx.GlobalIsSet(BootnodesFlag.Name) || ctx.GlobalIsSet(LegacyBootnodesV4Flag.Name):
if ctx.GlobalIsSet(BootnodesV4Flag.Name) { if ctx.GlobalIsSet(LegacyBootnodesV4Flag.Name) {
urls = splitAndTrim(ctx.GlobalString(BootnodesV4Flag.Name)) urls = splitAndTrim(ctx.GlobalString(LegacyBootnodesV4Flag.Name))
} else { } else {
urls = splitAndTrim(ctx.GlobalString(BootnodesFlag.Name)) urls = splitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
} }
...@@ -825,14 +815,16 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { ...@@ -825,14 +815,16 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
// setBootstrapNodesV5 creates a list of bootstrap nodes from the command line // setBootstrapNodesV5 creates a list of bootstrap nodes from the command line
// flags, reverting to pre-configured ones if none have been specified. // flags, reverting to pre-configured ones if none have been specified.
func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) { func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
urls := params.DiscoveryV5Bootnodes urls := params.MainnetBootnodes
switch { switch {
case ctx.GlobalIsSet(BootnodesFlag.Name) || ctx.GlobalIsSet(BootnodesV5Flag.Name): case ctx.GlobalIsSet(BootnodesFlag.Name) || ctx.GlobalIsSet(LegacyBootnodesV5Flag.Name):
if ctx.GlobalIsSet(BootnodesV5Flag.Name) { if ctx.GlobalIsSet(LegacyBootnodesV5Flag.Name) {
urls = splitAndTrim(ctx.GlobalString(BootnodesV5Flag.Name)) urls = splitAndTrim(ctx.GlobalString(LegacyBootnodesV5Flag.Name))
} else { } else {
urls = splitAndTrim(ctx.GlobalString(BootnodesFlag.Name)) urls = splitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
} }
case ctx.GlobalBool(RopstenFlag.Name):
urls = params.RopstenBootnodes
case ctx.GlobalBool(RinkebyFlag.Name): case ctx.GlobalBool(RinkebyFlag.Name):
urls = params.RinkebyBootnodes urls = params.RinkebyBootnodes
case ctx.GlobalBool(GoerliFlag.Name): case ctx.GlobalBool(GoerliFlag.Name):
......
...@@ -148,6 +148,16 @@ var ( ...@@ -148,6 +148,16 @@ var (
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices (deprecated, use --gpo.percentile)", Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices (deprecated, use --gpo.percentile)",
Value: eth.DefaultConfig.GPO.Percentile, Value: eth.DefaultConfig.GPO.Percentile,
} }
LegacyBootnodesV4Flag = cli.StringFlag{
Name: "bootnodesv4",
Usage: "Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes) (deprecated, use --bootnodes)",
Value: "",
}
LegacyBootnodesV5Flag = cli.StringFlag{
Name: "bootnodesv5",
Usage: "Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes) (deprecated, use --bootnodes)",
Value: "",
}
) )
// showDeprecated displays deprecated flags that will be soon removed from the codebase. // showDeprecated displays deprecated flags that will be soon removed from the codebase.
......
...@@ -62,8 +62,8 @@ func GoerliGenesis() string { ...@@ -62,8 +62,8 @@ func GoerliGenesis() string {
// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated // FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
// by the foundation running the V5 discovery protocol. // by the foundation running the V5 discovery protocol.
func FoundationBootnodes() *Enodes { func FoundationBootnodes() *Enodes {
nodes := &Enodes{nodes: make([]*discv5.Node, len(params.DiscoveryV5Bootnodes))} nodes := &Enodes{nodes: make([]*discv5.Node, len(params.MainnetBootnodes))}
for i, url := range params.DiscoveryV5Bootnodes { for i, url := range params.MainnetBootnodes {
nodes.nodes[i] = discv5.MustParseNode(url) nodes.nodes[i] = discv5.MustParseNode(url)
} }
return nodes return nodes
......
...@@ -63,15 +63,6 @@ var GoerliBootnodes = []string{ ...@@ -63,15 +63,6 @@ var GoerliBootnodes = []string{
"enode://a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91@3.11.147.67:30303", "enode://a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91@3.11.147.67:30303",
} }
// DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the
// experimental RLPx v5 topic-discovery network.
var DiscoveryV5Bootnodes = []string{
"enode://06051a5573c81934c9554ef2898eb13b33a34b94cf36b202b69fde139ca17a85051979867720d4bdae4323d4943ddf9aeeb6643633aa656e0be843659795007a@35.177.226.168:30303",
"enode://0cc5f5ffb5d9098c8b8c62325f3797f56509bff942704687b6530992ac706e2cb946b90a34f1f19548cd3c7baccbcaea354531e5983c7d1bc0dee16ce4b6440b@40.118.3.223:30304",
"enode://1c7a64d76c0334b0418c004af2f67c50e36a3be60b5e4790bdac0439d21603469a85fad36f2473c9a80eb043ae60936df905fa28f1ff614c3e5dc34f15dcd2dc@40.118.3.223:30306",
"enode://85c85d7143ae8bb96924f2b54f1b3e70d8c4d367af305325d30a61385a432f247d2c75c45c6b4a60335060d072d7f5b35dd1d4c45f76941f62a4f83b6e75daaf@40.118.3.223:30307",
}
const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"
// These DNS names provide bootstrap connectivity for public testnets and the mainnet. // These DNS names provide bootstrap connectivity for public testnets and the mainnet.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册