Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions sei-tendermint/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,13 @@ type P2PConfig struct {
// UPNP port forwarding. UNUSED
UPNP bool `mapstructure:"upnp"`

// MaxConnections defines the maximum number of connected peers (inbound and
// outbound).
MaxConnections uint16 `mapstructure:"max-connections"`
// MaxConnections limits the number of connected peers (inbound and outbound).
MaxConnections uint `mapstructure:"max-connections"`

// MaxOutboundConnections limits the number of outbound connections to regular (non-persistent) peers.
// It should be significantly lower than MaxConnections, unless
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we should give a guideline how much lower this should be compared to MaxConnections

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I don't know that yet :). I estimate 10 outbound, 50 total, but this is tbd.

// the node is supposed to have a small number of connections altogether.
MaxOutboundConnections uint

// MaxIncomingConnectionAttempts rate limits the number of incoming connection
// attempts per IP address.
Expand Down Expand Up @@ -693,17 +697,21 @@ type P2PConfig struct {
// with the default being "priority".
QueueType string `mapstructure:"queue-type"`

// List of node IDs, to which a connection will be (re)established, dropping an existing peer if any existing limit has been reached
// List of node IDs, from which a connection will be accepted regardless of the connection limits.
UnconditionalPeerIDs string `mapstructure:"unconditional-peer-ids"`
}

// DefaultP2PConfig returns a default configuration for the peer-to-peer layer
func DefaultP2PConfig() *P2PConfig {
return &P2PConfig{
ListenAddress: "tcp://127.0.0.1:26656",
ExternalAddress: "",
UPNP: false,
MaxConnections: 100,
ListenAddress: "tcp://127.0.0.1:26656",
ExternalAddress: "",
UPNP: false,
MaxConnections: 100,
// TODO(gprusak): decrease to 10, once PEX is improved to:
// * exchange both inbound and outbound connections information
// * exchange information on handshake as well.
MaxOutboundConnections: 100,
MaxIncomingConnectionAttempts: 100,
FlushThrottleTimeout: 100 * time.Millisecond,
MaxPacketMsgPayloadSize: 1000000,
Expand Down
Loading
Loading