Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This subsystem manages the discovery and selection of upstream peers.
Synopsis
- peerChurnGovernor ∷ ∀ m peeraddr. (MonadDelay m, Alternative (STM m), MonadTimer m, MonadCatch m) ⇒ Tracer m (TracePeerSelection peeraddr) → Tracer m ChurnCounters → DiffTime → DiffTime → DiffTime → PeerMetrics m peeraddr → StrictTVar m ChurnMode → StdGen → STM m FetchMode → PeerSelectionTargets → StrictTVar m PeerSelectionTargets → STM m PeerSelectionCounters → STM m UseBootstrapPeers → m Void
- data ChurnCounters = ChurnCounter ChurnAction Int
Documentation
∷ ∀ m peeraddr. (MonadDelay m, Alternative (STM m), MonadTimer m, MonadCatch m) | |
⇒ Tracer m (TracePeerSelection peeraddr) | |
→ Tracer m ChurnCounters | |
→ DiffTime | the base for churn interval in the deadline mode. |
→ DiffTime | the base for churn interval in the bulk sync mode. |
→ DiffTime | the timeout for outbound governor to find new (thus cold) peers through peer sharing mechanism. |
→ PeerMetrics m peeraddr | |
→ StrictTVar m ChurnMode | |
→ StdGen | |
→ STM m FetchMode | |
→ PeerSelectionTargets | base targets; set in a configuration file |
→ StrictTVar m PeerSelectionTargets | |
→ STM m PeerSelectionCounters | |
→ STM m UseBootstrapPeers | |
→ m Void |
Churn governor.
At every churn interval decrease active peers for a short while (1s), so that we can pick new ones. Then we churn non-active peers.
On startup the churn governor gives a head start to local root peers over root peers.