mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-04 20:23:59 +00:00
Add spec doc about unconditional_peer, persistent_peers_max_dial of ADR-050 (#68)
* Add spec doc about unconditional_peer_ids, persistent_peers_max_dial_period of ADR-050 * Add indefinitely dialing condition
This commit is contained in:
@@ -26,6 +26,10 @@ These are intended to be trusted persistent peers that can help
|
||||
anchor us in the p2p network. The auto-redial uses exponential
|
||||
backoff and will give up after a day of trying to connect.
|
||||
|
||||
But If `persistent_peers_max_dial_period` is set greater than zero,
|
||||
pause between each dial to each persistent peer will not exceed `persistent_peers_max_dial_period`
|
||||
during exponential backoff and we keep trying again without giving up
|
||||
|
||||
**Note:** If `seeds` and `persistent_peers` intersect,
|
||||
the user will be warned that seeds may auto-close connections
|
||||
and that the node may not be able to keep the connection persistent.
|
||||
@@ -36,3 +40,11 @@ and that the node may not be able to keep the connection persistent.
|
||||
|
||||
These are IDs of the peers that we do not add to the address book or gossip to
|
||||
other peers. They stay private to us.
|
||||
|
||||
|
||||
## Unconditional Peers
|
||||
|
||||
`--p2p.unconditional_peer_ids “id100000000000000000000000000000000,id200000000000000000000000000000000”`
|
||||
|
||||
These are IDs of the peers which are allowed to be connected by both inbound or outbound regardless of
|
||||
`max_num_inbound_peers` or `max_num_outbound_peers` of user's node reached or not.
|
||||
|
||||
@@ -31,7 +31,12 @@ On startup, we will also immediately dial the given list of `persistent_peers`,
|
||||
and will attempt to maintain persistent connections with them. If the
|
||||
connections die, or we fail to dial, we will redial every 5s for a few minutes,
|
||||
then switch to an exponential backoff schedule, and after about a day of
|
||||
trying, stop dialing the peer.
|
||||
trying, stop dialing the peer. This behavior is when `persistent_peers_max_dial_period` is configured to zero.
|
||||
|
||||
But If `persistent_peers_max_dial_period` is set greater than zero, terms between each dial to each persistent peer
|
||||
will not exceed `persistent_peers_max_dial_period` during exponential backoff.
|
||||
Therefore, `dial_period` = min(`persistent_peers_max_dial_period`, `exponential_backoff_dial_period`)
|
||||
and we keep trying again regardless of `maxAttemptsToDial`
|
||||
|
||||
As long as we have less than `MaxNumOutboundPeers`, we periodically request
|
||||
additional peers from each of our own and try seeds.
|
||||
@@ -93,7 +98,8 @@ the selection process happens every `ensurePeersPeriod`, we might not end up
|
||||
dialing a peer for much longer than the backoff duration.
|
||||
|
||||
If we fail to connect to the peer after 16 tries (with exponential backoff), we
|
||||
remove from address book completely.
|
||||
remove from address book completely. But for persistent peers, we indefinitely try to
|
||||
dial all persistent peers unless `persistent_peers_max_dial_period` is configured to zero
|
||||
|
||||
## Select Peers to Exchange
|
||||
|
||||
|
||||
Reference in New Issue
Block a user