ouroboros-network-0.16.1.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Diffusion.Policies

Synopsis

Documentation

deactivateTimeoutDiffTime Source #

Timeout for spsDeactivateTimeout and churn hot to warm demotions.

The maximal timeout on ChainSync (in StMustReply state) is 269s, see maxChainSyncTimeout below.

closeConnectionTimeoutDiffTime Source #

Timeout for spsCloseConnectionTimeout.

This timeout depends on KeepAlive and TipSample timeouts. KeepAlive keeps agency most of the time, but TipSample can give away its agency for longer periods of time. Here we allow it to get 6 blocks (assuming a new block every 20s).

minChainSyncTimeoutDiffTime Source #

Chain sync mustReplayTimeout lower bound.

maxChainSyncTimeoutDiffTime Source #

Chain sync mustReplayTimeout upper bound.

churnEstablishConnectionTimeoutDiffTime Source #

Churn timeouts after 60s trying to establish a connection.

This doesn't mean the connection is terminated after it, just churns moves on.

peerMetricsConfigurationPeerMetricsConfiguration Source #

Number of events tracked by PeerMetrics. This corresponds to one hour of blocks on mainnet.

TODO: issue #3866

inboundPeersRetryDelayDiffTime Source #

Minimal delay between adding inbound peers to known set of outbound governor.

It is set to 60s, the same as the peer sharing request timeout.

maxInboundPeersInt Source #

Maximal number of light peers included at once.

optionalMergeOrd k ⇒ Map k a → Map k b → Map k (a, Maybe b) Source #

Merge two dictionaries where values of the first one are obligatory, while the second one are optional.

simplePeerSelectionPolicy Source #

Arguments

∷ ∀ m peerAddr. (MonadSTM m, Ord peerAddr) 
StrictTVar m StdGen 
STM m ChurnMode 
PeerMetrics m peerAddr 
RepromoteDelay

delay on error

PeerSelectionPolicy peerAddr m 

prunePolicyOrd peerAddr ⇒ PrunePolicy peerAddr Source #

Sort by upstreamness and a random score.

Note: this PrunePolicy does not depend on igsConnections. We put igsPrng in InboundGovernorState only to show that we can have a PrunePolicy which depends on the InboundGovernorState as a more refined policy would do.

complexity: \(\mathcal{O}(n\log\;n)\)

TODO: complexity could be improved.