cardano-diffusion
Safe HaskellNone
LanguageHaskell2010

Cardano.Network.PeerSelection.Churn

Description

This subsystem manages the discovery and selection of upstream peers.

Synopsis

Documentation

data PeerChurnArgs (m :: Type -> Type) extraArgs extraDebugState extraFlags extraPeers extraAPI peeraddr #

Record of arguments for peer churn governor

Constructors

PeerChurnArgs 

Fields

newtype ChurnMode Source #

Churn mode is set by churn and available in peer selection policy. It follows FetchMode, thus it's a newtype wrapper.

It is shared using its own TVar to make sure the value available in peer selection policy is consistent with the value available in churn actions.

Constructors

ChurnMode 

Instances

Instances details
Generic ChurnMode Source # 
Instance details

Defined in Cardano.Network.PeerSelection.Churn

Associated Types

type Rep ChurnMode 
Instance details

Defined in Cardano.Network.PeerSelection.Churn

type Rep ChurnMode = D1 ('MetaData "ChurnMode" "Cardano.Network.PeerSelection.Churn" "cardano-diffusion-1.0.0.0-inplace" 'True) (C1 ('MetaCons "ChurnMode" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFetchMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FetchMode)))
Show ChurnMode Source # 
Instance details

Defined in Cardano.Network.PeerSelection.Churn

type Rep ChurnMode Source # 
Instance details

Defined in Cardano.Network.PeerSelection.Churn

type Rep ChurnMode = D1 ('MetaData "ChurnMode" "Cardano.Network.PeerSelection.Churn" "cardano-diffusion-1.0.0.0-inplace" 'True) (C1 ('MetaCons "ChurnMode" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFetchMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FetchMode)))

peerChurnGovernor :: forall m extraState extraFlags extraPeers extraCounters peeraddr. (MonadDelay m, Alternative (STM m), MonadTimer m, MonadCatch m, extraCounters ~ ViewExtraPeers extraPeers) => PeerChurnArgs m (ExtraArguments m) extraState extraFlags extraPeers (LedgerPeersConsensusInterface m) peeraddr -> m Void Source #

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.