ouroboros-network:api
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.PeerSelection.LedgerPeers.Utils

Synopsis

Documentation

bigLedgerPeerQuota :: AccPoolStake Source #

Big ledger peers are those ledger peers, which when sorted down by their relative stake, in the aggregate hold 90% of the total stake in the network.

accumulateBigLedgerStake :: [(PoolStake, NonEmpty relayAccessPoint)] -> [(AccPoolStake, (PoolStake, NonEmpty relayAccessPoint))] Source #

Sort ascendingly a given list of pools with stake, and tag each one with cumulative stake, with a cutoff at bigLedgerPeerQuota

recomputeRelativeStake :: LedgerPeersKind -> [(PoolStake, NonEmpty relayAccessPoint)] -> [(PoolStake, NonEmpty relayAccessPoint)] Source #

Not all stake pools have valid / usable relay information. This means that we need to recalculate the relative stake for each pool.

newtype AccPoolStake Source #

The accumulated relative stake of a stake pool, like PoolStake but it also includes the relative stake of all preceding pools. A value in the range [0, 1].

Constructors

AccPoolStake 

Instances

Instances details
FromJSON AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

ToJSON AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

FromCBOR AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

ToCBOR AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

toCBOR :: AccPoolStake -> Encoding #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy AccPoolStake -> Size #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [AccPoolStake] -> Size #

NFData AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

rnf :: AccPoolStake -> () #

Num AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Fractional AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Show AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Ord AccPoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

newtype PoolStake Source #

The relative stake of a stakepool in relation to the total amount staked. A value in the [0, 1] range.

Constructors

PoolStake 

Instances

Instances details
FromJSON PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

ToJSON PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

FromCBOR PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

ToCBOR PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

toCBOR :: PoolStake -> Encoding #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy PoolStake -> Size #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [PoolStake] -> Size #

NFData PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Methods

rnf :: PoolStake -> () #

Num PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Fractional PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Show PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Ord PoolStake Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

data RelayAccessPoint Source #

A relay can have either an IP address and a port number or a domain with a port number

Constructors

RelayAccessDomain !Domain !PortNumber 
RelayAccessSRVDomain !Domain

SRV domain, prefixed (as defined in CIP#0155)

RelayAccessAddress !IP !PortNumber 

Instances

Instances details
FromJSON RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

ToJSON RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

FromCBOR RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

ToCBOR RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

NFData RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Methods

rnf :: RelayAccessPoint -> () #

Show RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Eq RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint

Ord RelayAccessPoint Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.RelayAccessPoint