diff --git a/builder/files/config.toml b/builder/files/config.toml index 2de1aaead5..8d2279b330 100644 --- a/builder/files/config.toml +++ b/builder/files/config.toml @@ -37,6 +37,7 @@ syncmode = "full" # nodekey = "" # nodekeyhex = "" [p2p.discovery] + # v4disc = true # v5disc = false bootnodes = ["enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303", "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", "enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303"] # Uncomment below `bootnodes` field for Mumbai bootnode diff --git a/docs/cli/example_config.toml b/docs/cli/example_config.toml index 00a86e73cb..fb9def8e1f 100644 --- a/docs/cli/example_config.toml +++ b/docs/cli/example_config.toml @@ -41,6 +41,7 @@ devfakeauthor = false # Run miner without validator set authorization nodekeyhex = "" # P2P node key as hex txarrivalwait = "500ms" # Maximum duration to wait before requesting an announced transaction [p2p.discovery] + v4disc = true # Enables the V4 discovery mechanism v5disc = false # Enables the experimental RLPx V5 (Topic Discovery) mechanism bootnodes = [] # Comma separated enode URLs for P2P discovery bootstrap bootnodesv4 = [] # List of initial v4 bootnodes diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index bc7b4624d4..4a46ba0d1e 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -219,6 +219,9 @@ type P2PConfig struct { } type P2PDiscovery struct { + // DiscoveryV4 specifies whether V4 discovery should be started. + DiscoveryV4 bool `hcl:"v4disc,optional" toml:"v4disc,optional"` + // V5Enabled is used to enable disc v5 discovery mode V5Enabled bool `hcl:"v5disc,optional" toml:"v5disc,optional"` @@ -616,6 +619,7 @@ func DefaultConfig() *Config { NetRestrict: "", TxArrivalWait: 500 * time.Millisecond, Discovery: &P2PDiscovery{ + DiscoveryV4: true, V5Enabled: false, Bootnodes: []string{}, BootnodesV4: []string{}, @@ -1307,6 +1311,7 @@ func (c *Config) buildNode() (*node.Config, error) { MaxPeers: int(c.P2P.MaxPeers), MaxPendingPeers: int(c.P2P.MaxPendPeers), ListenAddr: c.P2P.Bind + ":" + strconv.Itoa(int(c.P2P.Port)), + DiscoveryV4: c.P2P.Discovery.DiscoveryV4, DiscoveryV5: c.P2P.Discovery.V5Enabled, TxArrivalWait: c.P2P.TxArrivalWait, }, diff --git a/internal/cli/server/flags.go b/internal/cli/server/flags.go index 16a75b27d8..48813fdfbe 100644 --- a/internal/cli/server/flags.go +++ b/internal/cli/server/flags.go @@ -765,6 +765,13 @@ func (c *Command) Flags(config *Config) *flagset.Flagset { Default: c.cliConfig.P2P.NoDiscover, Group: "P2P", }) + f.BoolFlag(&flagset.BoolFlag{ + Name: "v4disc", + Usage: "Enables the V4 discovery mechanism", + Value: &c.cliConfig.P2P.Discovery.DiscoveryV4, + Default: c.cliConfig.P2P.Discovery.DiscoveryV4, + Group: "P2P", + }) f.BoolFlag(&flagset.BoolFlag{ Name: "v5disc", Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism", diff --git a/packaging/templates/mainnet-v1/archive/config.toml b/packaging/templates/mainnet-v1/archive/config.toml index 213ea023cc..bdbe8edc8f 100644 --- a/packaging/templates/mainnet-v1/archive/config.toml +++ b/packaging/templates/mainnet-v1/archive/config.toml @@ -34,6 +34,7 @@ gcmode = "archive" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = ["enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303", "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", "enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303"] # bootnodesv4 = [] diff --git a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml index e87e287e46..af9cb26113 100644 --- a/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml @@ -34,6 +34,7 @@ syncmode = "full" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = [] # bootnodesv4 = [] diff --git a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml index cafdf08989..e01d1fb331 100644 --- a/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml +++ b/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml @@ -36,6 +36,7 @@ syncmode = "full" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = ["enode://76316d1cb93c8ed407d3332d595233401250d48f8fbb1d9c65bd18c0495eca1b43ec38ee0ea1c257c0abb7d1f25d649d359cdfe5a805842159cfe36c5f66b7e8@52.78.36.216:30303", "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", "enode://681ebac58d8dd2d8a6eef15329dfbad0ab960561524cf2dfde40ad646736fe5c244020f20b87e7c1520820bc625cfb487dd71d63a3a3bf0baea2dbb8ec7c79f1@34.240.245.39:30303"] # bootnodesv4 = [] diff --git a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml index 2c6a423812..87dfaf54f2 100644 --- a/packaging/templates/mainnet-v1/without-sentry/bor/config.toml +++ b/packaging/templates/mainnet-v1/without-sentry/bor/config.toml @@ -36,6 +36,7 @@ syncmode = "full" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = [] # bootnodesv4 = [] diff --git a/packaging/templates/testnet-v4/archive/config.toml b/packaging/templates/testnet-v4/archive/config.toml index d7690576b8..b581a687e2 100644 --- a/packaging/templates/testnet-v4/archive/config.toml +++ b/packaging/templates/testnet-v4/archive/config.toml @@ -34,6 +34,7 @@ gcmode = "archive" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = [] # bootnodesv4 = [] diff --git a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml index 9f5c58da44..0778310d8e 100644 --- a/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/sentry/bor/config.toml @@ -34,6 +34,7 @@ syncmode = "full" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = [] # bootnodesv4 = [] diff --git a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml index 56e8aec4a8..9c0133d7a5 100644 --- a/packaging/templates/testnet-v4/sentry/validator/bor/config.toml +++ b/packaging/templates/testnet-v4/sentry/validator/bor/config.toml @@ -36,6 +36,7 @@ syncmode = "full" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = [] # bootnodesv4 = [] diff --git a/packaging/templates/testnet-v4/without-sentry/bor/config.toml b/packaging/templates/testnet-v4/without-sentry/bor/config.toml index 539313ccb2..6bcb8c59fc 100644 --- a/packaging/templates/testnet-v4/without-sentry/bor/config.toml +++ b/packaging/templates/testnet-v4/without-sentry/bor/config.toml @@ -36,6 +36,7 @@ syncmode = "full" # nodekeyhex = "" # txarrivalwait = "500ms" # [p2p.discovery] + # v4disc = true # v5disc = false # bootnodes = [] # bootnodesv4 = []