Skip to content

Commit

Permalink
Revert "config: add bootstrap peers (#9680)" (backport cometbft#1109) (
Browse files Browse the repository at this point in the history
…cometbft#1121)

* Revert "config: add bootstrap peers (#9680)" (cometbft#1109)

* Revert "config: add bootstrap peers (#9680)"

This reverts commit f12588a.

* docs/p2p: bootstrap_peers config flag removed

(cherry picked from commit 2d3ee28)

# Conflicts:
#	UPGRADING.md
#	config/toml.go
#	docs/core/configuration.md

* Solving merging conflicts when backporting cometbft#1109

---------

Co-authored-by: Daniel <[email protected]>
  • Loading branch information
mergify[bot] and cason authored Jul 14, 2023
1 parent f8f2331 commit d4bbdde
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 40 deletions.
4 changes: 0 additions & 4 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ coordinated upgrade.

### Config Changes

* A new config field, `BootstrapPeers` has been introduced as a means of adding
a list of addresses to the address book upon initializing a node. This is an
alternative to `PersistentPeers`. `PersistentPeers` should be only used for
nodes that you want to keep a constant connection with i.e. sentry nodes
* The field `Version` in the mempool section has been removed. The priority
mempool (what was called version `v1`) has been removed (see below), thus
there is only one implementation of the mempool available (what was called
Expand Down
1 change: 0 additions & 1 deletion cmd/cometbft/commands/run_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func AddNodeFlags(cmd *cobra.Command) {
cmd.Flags().String("p2p.external-address", config.P2P.ExternalAddress, "ip:port address to advertise to peers for them to dial")
cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "comma-delimited ID@host:port seed nodes")
cmd.Flags().String("p2p.persistent_peers", config.P2P.PersistentPeers, "comma-delimited ID@host:port persistent peers")
cmd.Flags().String("p2p.bootstrap_peers", config.P2P.BootstrapPeers, "comma-delimited ID@host:port peers to be added to the addressbook on startup")
cmd.Flags().String("p2p.unconditional_peer_ids",
config.P2P.UnconditionalPeerIDs, "comma-delimited IDs of unconditional peers")
cmd.Flags().Bool("p2p.upnp", config.P2P.UPNP, "enable/disable UPNP port forwarding")
Expand Down
5 changes: 0 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,6 @@ type P2PConfig struct { //nolint: maligned
// We only use these if we can’t connect to peers in the addrbook
Seeds string `mapstructure:"seeds"`

// Comma separated list of peers to be added to the peer store
// on startup. Either BootstrapPeers or PersistentPeers are
// needed for peer discovery
BootstrapPeers string `mapstructure:"bootstrap_peers"`

// Comma separated list of nodes to keep persistent connections to
PersistentPeers string `mapstructure:"persistent_peers"`

Expand Down
5 changes: 0 additions & 5 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ external_address = "{{ .P2P.ExternalAddress }}"
# Comma separated list of seed nodes to connect to
seeds = "{{ .P2P.Seeds }}"
# Comma separated list of peers to be added to the peer store
# on startup. Either BootstrapPeers or PersistentPeers are
# needed for peer discovery
bootstrap_peers = "{{ .P2P.BootstrapPeers }}"
# Comma separated list of nodes to keep persistent connections to
persistent_peers = "{{ .P2P.PersistentPeers }}"
Expand Down
7 changes: 1 addition & 6 deletions docs/core/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,6 @@ external_address = ""
# Comma separated list of seed nodes to connect to
seeds = ""

# Comma separated list of peers to be added to the peer store
# on startup. Either BootstrapPeers or PersistentPeers are
# needed for peer discovery
bootstrap_peers = ""

# Comma separated list of nodes to keep persistent connections to
persistent_peers = ""

Expand Down Expand Up @@ -311,7 +306,7 @@ broadcast = true

# WalPath (default: "") configures the location of the Write Ahead Log
# (WAL) for the mempool. The WAL is disabled by default. To enable, set
# WalPath to where you want the WAL to be written (e.g.
# wal_dir to where you want the WAL to be written (e.g.
# "data/mempool.wal").
wal_dir = ""

Expand Down
11 changes: 0 additions & 11 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,6 @@ func NewNodeWithContext(ctx context.Context,
return nil, fmt.Errorf("could not create addrbook: %w", err)
}

for _, addr := range splitAndTrimEmpty(config.P2P.BootstrapPeers, ",", " ") {
netAddrs, err := p2p.NewNetAddressString(addr)
if err != nil {
return nil, fmt.Errorf("invalid bootstrap peer address: %w", err)
}
err = addrBook.AddAddress(netAddrs, netAddrs)
if err != nil {
return nil, fmt.Errorf("adding bootstrap address to addressbook: %w", err)
}
}

// Optionally, start the pex reactor
//
// TODO:
Expand Down
8 changes: 0 additions & 8 deletions spec/p2p/legacy-docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ and upon incoming connection shares some peers and disconnects.
Dials these seeds when we need more peers. They should return a list of peers and then disconnect.
If we already have enough peers in the address book, we may never need to dial them.

## Bootstrap Peers

`--p2p.bootstrap_peers “[email protected]:26656,[email protected]:26656”`

A list of peers to be added to the addressbook upon startup to ensure that the node has some peers to initially dial.
Unlike persistent peers, these addresses don't have any extra privileges. The node may not necessarily connect on redial
these peers.

## Persistent Peers

`--p2p.persistent_peers “[email protected]:26656,[email protected]:26656”`
Expand Down

0 comments on commit d4bbdde

Please sign in to comment.