From e8ebea2020d9c57141b6a8b68fed91365fba3bbd Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 27 Dec 2021 17:18:59 -0800 Subject: [PATCH] config: add a Deprecation annotation to P2PConfig.Seeds. (#7496) (#7497) (cherry picked from commit 7cdf560173dee6773b80d1c574a06489d4c394fe) Co-authored-by: M. J. Fromberger --- cmd/tendermint/commands/run_node.go | 2 +- config/config.go | 8 +++++--- node/setup.go | 2 +- test/e2e/runner/setup.go | 8 ++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cmd/tendermint/commands/run_node.go b/cmd/tendermint/commands/run_node.go index 1e310f5eb..435ce9ea4 100644 --- a/cmd/tendermint/commands/run_node.go +++ b/cmd/tendermint/commands/run_node.go @@ -82,7 +82,7 @@ func AddNodeFlags(cmd *cobra.Command) { "p2p.laddr", config.P2P.ListenAddress, "node listen address. (0.0.0.0:0 means any interface, any port)") - cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "comma-delimited ID@host:port seed nodes") + cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "comma-delimited ID@host:port seed nodes") //nolint: staticcheck cmd.Flags().String("p2p.persistent-peers", config.P2P.PersistentPeers, "comma-delimited ID@host:port persistent peers") cmd.Flags().String("p2p.unconditional-peer-ids", config.P2P.UnconditionalPeerIDs, "comma-delimited IDs of unconditional peers") diff --git a/config/config.go b/config/config.go index 3fe001e47..73ffe49c8 100644 --- a/config/config.go +++ b/config/config.go @@ -671,9 +671,11 @@ type P2PConfig struct { //nolint: maligned // Comma separated list of seed nodes to connect to // We only use these if we can’t connect to peers in the addrbook - // NOTE: not used by the new PEX reactor. Please use BootstrapPeers instead. - // TODO: Remove once p2p refactor is complete - // ref: https://github.com/tendermint/tendermint/issues/5670 + // + // Deprecated: This value is not used by the new PEX reactor. Use + // BootstrapPeers instead. + // + // TODO(#5670): Remove once the p2p refactor is complete. Seeds string `mapstructure:"seeds"` // Comma separated list of peers to be added to the peer store diff --git a/node/setup.go b/node/setup.go index 50f28c19c..b99c2985e 100644 --- a/node/setup.go +++ b/node/setup.go @@ -636,7 +636,7 @@ func createPEXReactorAndAddToSwitch(addrBook pex.AddrBook, cfg *config.Config, sw *p2p.Switch, logger log.Logger) *pex.Reactor { reactorConfig := &pex.ReactorConfig{ - Seeds: tmstrings.SplitAndTrimEmpty(cfg.P2P.Seeds, ",", " "), + Seeds: tmstrings.SplitAndTrimEmpty(cfg.P2P.Seeds, ",", " "), //nolint: staticcheck SeedMode: cfg.Mode == config.ModeSeed, // See consensus/reactor.go: blocksToContributeToBecomeGoodPeer 10000 // blocks assuming 10s blocks ~ 28 hours. diff --git a/test/e2e/runner/setup.go b/test/e2e/runner/setup.go index 60a468345..9b62c5fce 100644 --- a/test/e2e/runner/setup.go +++ b/test/e2e/runner/setup.go @@ -323,12 +323,12 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) { } } - cfg.P2P.Seeds = "" + cfg.P2P.Seeds = "" //nolint: staticcheck for _, seed := range node.Seeds { - if len(cfg.P2P.Seeds) > 0 { - cfg.P2P.Seeds += "," + if len(cfg.P2P.Seeds) > 0 { //nolint: staticcheck + cfg.P2P.Seeds += "," //nolint: staticcheck } - cfg.P2P.Seeds += seed.AddressP2P(true) + cfg.P2P.Seeds += seed.AddressP2P(true) //nolint: staticcheck } cfg.P2P.PersistentPeers = ""