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

Ouroboros.Network.PeerSelection.LedgerPeers

Synopsis

Ledger Peers specific data types

data UseLedgerAfter Source #

Only use the ledger after the given slot number.

data IsLedgerPeer Source #

Identifies a peer as coming from ledger or not

Constructors

IsLedgerPeer

a ledger peer.

IsNotLedgerPeer 

newtype NumberOfPeers Source #

Constructors

NumberOfPeers 

Instances

Instances details
Show NumberOfPeers Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Common

data LedgerPeersKind Source #

Which ledger peers to pick.

Instances

Instances details
Show LedgerPeersKind Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers

Ledger Peers specific functions

accPoolStake ∷ [(PoolStake, NonEmpty RelayAccessPoint)] → Map AccPoolStake (PoolStake, NonEmpty RelayAccessPoint) Source #

Convert a list of pools with stake to a Map keyed on the accumulated stake. Consensus provides a list of pairs of relative stake and corresponding relays for all usable registered pools. By creating a Map keyed on the AccPoolStake that is the sum of the pool's relative stake and the stake of all preceding pools we can support weighted random selection in O(log n) time by taking advantage of Map.lookupGE (returns the smallest key greater or equal to the provided value).

accBigPoolStake ∷ [(PoolStake, NonEmpty RelayAccessPoint)] → Map AccPoolStake (PoolStake, NonEmpty RelayAccessPoint) Source #

Convert a list of pools with stake to a Map keyed on the accumulated stake which only contains big ledger peers, e.g. largest ledger peers which cumulatively control 90% of stake.

bigLedgerPeerQuotaAccPoolStake Source #

The total accumulated stake of big ledger peers.

DNS based provider for ledger root peers

withLedgerPeers ∷ ∀ peerAddr resolver exception m a. (MonadAsync m, MonadThrow m, MonadMonotonicTime m, Exception exception, Ord peerAddr) ⇒ StdGenDNSSemaphore m → (IPPortNumber → peerAddr) → Tracer m TraceLedgerPeersSTM m UseLedgerAfterLedgerPeersConsensusInterface m → DNSActions resolver exception m → ((NumberOfPeersLedgerPeersKind → m (Maybe (Set peerAddr, DiffTime))) → Async m Void → m a) → m a Source #

For a LedgerPeers worker thread and submit request and receive responses.

Re-exports

Internal only exported for testing purposes

resolveLedgerPeers ∷ ∀ m peerAddr resolver exception. (Ord peerAddr, MonadThrow m, MonadAsync m, Exception exception) ⇒ Tracer m TraceLedgerPeers → (IPPortNumber → peerAddr) → DNSSemaphore m → ResolvConfDNSActions resolver exception m → [DomainAccessPoint] → m (Map DomainAccessPoint (Set peerAddr)) Source #

Provides DNS resolution functionality.

Concurrently resolve DNS names, respecting the maxDNSConcurrency limit.