ouroboros-network-api
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.PeerSelection.LedgerPeers.Type

Description

Various types related to ledger peers. This module is re-exported from Ouroboros.Network.PeerSelection.LedgerPeers.

Synopsis

Documentation

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
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

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
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

data IsBigLedgerPeer Source #

A boolean like type. Big ledger peers are the largest SPOs which control 90% of staked stake.

Note that IsBigLedgerPeer indicates a role that peer plays in the eclipse evasion, e.g. that a peer was explicitly selected as a big ledger peer, e.g. IsNotBigLedgerPeer does not necessarily mean that the peer isn't a big ledger peer. This is because we select root peers from all ledger peers (including big ones).

data LedgerStateJudgement Source #

Wether the node is caught up or fell too far behind the chain

Constructors

YoungEnough 
TooOld 

Instances

Instances details
Generic LedgerStateJudgement Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Associated Types

type Rep LedgerStateJudgement 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep LedgerStateJudgement = D1 ('MetaData "LedgerStateJudgement" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.9.0.1-inplace" 'False) (C1 ('MetaCons "YoungEnough" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TooOld" 'PrefixI 'False) (U1 :: Type -> Type))
Show LedgerStateJudgement Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq LedgerStateJudgement Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

NoThunks LedgerStateJudgement Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep LedgerStateJudgement Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep LedgerStateJudgement = D1 ('MetaData "LedgerStateJudgement" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.9.0.1-inplace" 'False) (C1 ('MetaCons "YoungEnough" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TooOld" 'PrefixI 'False) (U1 :: Type -> Type))

data UseLedgerPeers Source #

Only use the ledger after the given slot number.

Instances

Instances details
Generic UseLedgerPeers Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Associated Types

type Rep UseLedgerPeers 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep UseLedgerPeers = D1 ('MetaData "UseLedgerPeers" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.9.0.1-inplace" 'False) (C1 ('MetaCons "DontUseLedgerPeers" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UseLedgerPeers" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AfterSlot)))
Show UseLedgerPeers Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq UseLedgerPeers Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

NoThunks UseLedgerPeers Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep UseLedgerPeers Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep UseLedgerPeers = D1 ('MetaData "UseLedgerPeers" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.9.0.1-inplace" 'False) (C1 ('MetaCons "DontUseLedgerPeers" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UseLedgerPeers" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AfterSlot)))

data AfterSlot Source #

Only use the ledger after the given slot number.

Constructors

Always 
After SlotNo 

Instances

Instances details
Generic AfterSlot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Associated Types

type Rep AfterSlot 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep AfterSlot = D1 ('MetaData "AfterSlot" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.9.0.1-inplace" 'False) (C1 ('MetaCons "Always" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "After" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo)))
Show AfterSlot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq AfterSlot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

NoThunks AfterSlot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep AfterSlot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

type Rep AfterSlot = D1 ('MetaData "AfterSlot" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.9.0.1-inplace" 'False) (C1 ('MetaCons "Always" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "After" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo)))

data LedgerPeersKind Source #

Which ledger peers to pick.

data LedgerPeerSnapshot Source #

The type of big ledger peers that is serialised or later provided by node configuration for the networking layer to connect to when syncing.

Constructors

LedgerPeerSnapshotV1 (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))])

Internal use for version 1, use pattern synonym for public API

Bundled Patterns

pattern LedgerPeerSnapshot :: (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))]) -> LedgerPeerSnapshot

Public API to access snapshot data. Currently access to only most recent version is available. Nonetheless, serialisation from the node into JSON is supported for older versions via internal api so that newer CLI can still support older node formats.

Instances

Instances details
FromJSON LedgerPeerSnapshot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

ToJSON LedgerPeerSnapshot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

FromCBOR LedgerPeerSnapshot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

ToCBOR LedgerPeerSnapshot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Show LedgerPeerSnapshot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

Eq LedgerPeerSnapshot Source # 
Instance details

Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type

newtype MinBigLedgerPeersForTrustedState Source #

Minimum number of hot big ledger peers in Genesis mode for trusted state to be signalled to Consensus. This number should be smaller than the targetNumberOfActiveBigLedgerPeers but greater than 1. In Genesis, we may demote a big ledger peer for underperformance, but not promote a replacement immediately to guard against adversaries which may want to slow down our progress.

compareLedgerPeerSnapshotApproximate :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool Source #

Since ledger peer snapshot is serialised with all domain names fully qualified, and all stake values are approximate in floating point, comparison is necessarily approximate as well. The candidate argument is processed here to simulate a round trip by the serialisation mechanism and then compared to the baseline argument, which is assumed that it was actually processed this way when a snapshot was created earlier, and hence it is approximate as well. The two approximate values should be equal if they were created from the same faithful data.

Orphan instances