Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- deactivateTimeout :: DiffTime
- closeConnectionTimeout :: DiffTime
- simplePeerSelectionPolicy :: forall m peerAddr. ( MonadSTM m, Ord peerAddr) => StrictTVar m StdGen -> STM m ChurnMode -> PeerMetrics m peerAddr -> PeerSelectionPolicy peerAddr m
- prunePolicy :: ( MonadSTM m, Ord peerAddr) => StrictTVar m InboundGovernorObservableState -> PrunePolicy peerAddr ( STM m)
Documentation
deactivateTimeout :: DiffTime Source #
Timeout for
spsDeactivateTimeout
.
The maximal timeout on
ChainSync
(in
StMustReply
state) is
269s
.
closeConnectionTimeout :: DiffTime Source #
Timeout for
spsCloseConnectionTimeout
.
This timeout depends on
KeepAlive
and
TipSample
timeouts.
KeepAlive
keeps agancy 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
).
simplePeerSelectionPolicy :: forall m peerAddr. ( MonadSTM m, Ord peerAddr) => StrictTVar m StdGen -> STM m ChurnMode -> PeerMetrics m peerAddr -> PeerSelectionPolicy peerAddr m Source #
prunePolicy :: ( MonadSTM m, Ord peerAddr) => StrictTVar m InboundGovernorObservableState -> PrunePolicy peerAddr ( STM m) 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.