added p2p v4 discovery flag wrt geth v1.12.2 merge

This commit is contained in:
Pratik Patil 2023-11-08 17:44:35 +05:30
parent 6aed36d9d1
commit 368ae246fd
No known key found for this signature in database
GPG key ID: D883140B4FA928F6
12 changed files with 22 additions and 0 deletions

View file

@ -37,6 +37,7 @@ syncmode = "full"
# nodekey = "" # nodekey = ""
# nodekeyhex = "" # nodekeyhex = ""
[p2p.discovery] [p2p.discovery]
# v4disc = true
# v5disc = false # 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"] 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 # Uncomment below `bootnodes` field for Mumbai bootnode

View file

@ -41,6 +41,7 @@ devfakeauthor = false # Run miner without validator set authorization
nodekeyhex = "" # P2P node key as hex nodekeyhex = "" # P2P node key as hex
txarrivalwait = "500ms" # Maximum duration to wait before requesting an announced transaction txarrivalwait = "500ms" # Maximum duration to wait before requesting an announced transaction
[p2p.discovery] [p2p.discovery]
v4disc = true # Enables the V4 discovery mechanism
v5disc = false # Enables the experimental RLPx V5 (Topic Discovery) mechanism v5disc = false # Enables the experimental RLPx V5 (Topic Discovery) mechanism
bootnodes = [] # Comma separated enode URLs for P2P discovery bootstrap bootnodes = [] # Comma separated enode URLs for P2P discovery bootstrap
bootnodesv4 = [] # List of initial v4 bootnodes bootnodesv4 = [] # List of initial v4 bootnodes

View file

@ -219,6 +219,9 @@ type P2PConfig struct {
} }
type P2PDiscovery 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 is used to enable disc v5 discovery mode
V5Enabled bool `hcl:"v5disc,optional" toml:"v5disc,optional"` V5Enabled bool `hcl:"v5disc,optional" toml:"v5disc,optional"`
@ -616,6 +619,7 @@ func DefaultConfig() *Config {
NetRestrict: "", NetRestrict: "",
TxArrivalWait: 500 * time.Millisecond, TxArrivalWait: 500 * time.Millisecond,
Discovery: &P2PDiscovery{ Discovery: &P2PDiscovery{
DiscoveryV4: true,
V5Enabled: false, V5Enabled: false,
Bootnodes: []string{}, Bootnodes: []string{},
BootnodesV4: []string{}, BootnodesV4: []string{},
@ -1307,6 +1311,7 @@ func (c *Config) buildNode() (*node.Config, error) {
MaxPeers: int(c.P2P.MaxPeers), MaxPeers: int(c.P2P.MaxPeers),
MaxPendingPeers: int(c.P2P.MaxPendPeers), MaxPendingPeers: int(c.P2P.MaxPendPeers),
ListenAddr: c.P2P.Bind + ":" + strconv.Itoa(int(c.P2P.Port)), ListenAddr: c.P2P.Bind + ":" + strconv.Itoa(int(c.P2P.Port)),
DiscoveryV4: c.P2P.Discovery.DiscoveryV4,
DiscoveryV5: c.P2P.Discovery.V5Enabled, DiscoveryV5: c.P2P.Discovery.V5Enabled,
TxArrivalWait: c.P2P.TxArrivalWait, TxArrivalWait: c.P2P.TxArrivalWait,
}, },

View file

@ -765,6 +765,13 @@ func (c *Command) Flags(config *Config) *flagset.Flagset {
Default: c.cliConfig.P2P.NoDiscover, Default: c.cliConfig.P2P.NoDiscover,
Group: "P2P", 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{ f.BoolFlag(&flagset.BoolFlag{
Name: "v5disc", Name: "v5disc",
Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism", Usage: "Enables the experimental RLPx V5 (Topic Discovery) mechanism",

View file

@ -34,6 +34,7 @@ gcmode = "archive"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # 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"] # 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 = [] # bootnodesv4 = []

View file

@ -34,6 +34,7 @@ syncmode = "full"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # v5disc = false
# bootnodes = [] # bootnodes = []
# bootnodesv4 = [] # bootnodesv4 = []

View file

@ -36,6 +36,7 @@ syncmode = "full"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # 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"] # 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 = [] # bootnodesv4 = []

View file

@ -36,6 +36,7 @@ syncmode = "full"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # v5disc = false
# bootnodes = [] # bootnodes = []
# bootnodesv4 = [] # bootnodesv4 = []

View file

@ -34,6 +34,7 @@ gcmode = "archive"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # v5disc = false
# bootnodes = [] # bootnodes = []
# bootnodesv4 = [] # bootnodesv4 = []

View file

@ -34,6 +34,7 @@ syncmode = "full"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # v5disc = false
# bootnodes = [] # bootnodes = []
# bootnodesv4 = [] # bootnodesv4 = []

View file

@ -36,6 +36,7 @@ syncmode = "full"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # v5disc = false
# bootnodes = [] # bootnodes = []
# bootnodesv4 = [] # bootnodesv4 = []

View file

@ -36,6 +36,7 @@ syncmode = "full"
# nodekeyhex = "" # nodekeyhex = ""
# txarrivalwait = "500ms" # txarrivalwait = "500ms"
# [p2p.discovery] # [p2p.discovery]
# v4disc = true
# v5disc = false # v5disc = false
# bootnodes = [] # bootnodes = []
# bootnodesv4 = [] # bootnodesv4 = []