You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.4 KiB

  1. # ADR 50: Improved Trusted Peering
  2. ## Changelog
  3. * 22-10-2019: Initial draft
  4. * 05-11-2019: Modify `maximum-dial-period` to `persistent-peers-max-dial-period`
  5. ## Context
  6. When `max-num-inbound-peers` or `max-num-outbound-peers` of a node is reached, the node cannot spare more slots to any peer
  7. by inbound or outbound. Therefore, after a certain period of disconnection, any important peering can be lost indefinitely
  8. because all slots are consumed by other peers, and the node stops trying to dial the peer anymore.
  9. This is happening because of two reasons, exponential backoff and absence of unconditional peering feature for trusted peers.
  10. ## Decision
  11. We would like to suggest solving this problem by introducing two parameters in `config.toml`, `unconditional-peer-ids` and
  12. `persistent-peers-max-dial-period`.
  13. 1) `unconditional-peer-ids`
  14. A node operator inputs list of ids of peers which are allowed to be connected by both inbound or outbound regardless of
  15. `max-num-inbound-peers` or `max-num-outbound-peers` of user's node reached or not.
  16. 2) `persistent-peers-max-dial-period`
  17. Terms between each dial to each persistent peer will not exceed `persistent-peers-max-dial-period` during exponential backoff.
  18. Therefore, `dial-period` = min(`persistent-peers-max-dial-period`, `exponential-backoff-dial-period`)
  19. Alternative approach
  20. Persistent-peers is only for outbound, therefore it is not enough to cover the full utility of `unconditional-peer-ids`.
  21. @creamers158(https://github.com/Creamers158) suggested putting id-only items into persistent-peers to be handled as
  22. `unconditional-peer-ids`, but it needs very complicated struct exception for different structure of items in persistent-peers.
  23. Therefore we decided to have `unconditional-peer-ids` to independently cover this use-case.
  24. ## Status
  25. Proposed
  26. ## Consequences
  27. ### Positive
  28. A node operator can configure two new parameters in `config.toml` so that he/she can assure that tendermint will allow connections
  29. from/to peers in `unconditional-peer-ids`. Also he/she can assure that every persistent peer will be dialed at least once in every
  30. `persistent-peers-max-dial-period` term. It achieves more stable and persistent peering for trusted peers.
  31. ### Negative
  32. The new feature introduces two new parameters in `config.toml` which needs explanation for node operators.
  33. ### Neutral
  34. ## References
  35. * two p2p feature enhancement proposal(https://github.com/tendermint/tendermint/issues/4053)