Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Network.PeerSelection.LedgerPeers.Type
Contents
Description
Various types related to ledger peers. This module is re-exported from Ouroboros.Network.PeerSelection.LedgerPeers.
Synopsis
- newtype PoolStake = PoolStake {}
- newtype AccPoolStake = AccPoolStake {}
- data IsLedgerPeer
- data IsBigLedgerPeer
- data LedgerPeersConsensusInterface extraAPI (m :: Type -> Type) = LedgerPeersConsensusInterface {
- lpGetLatestSlot :: STM m (WithOrigin SlotNo)
- lpGetLedgerPeers :: STM m [(PoolStake, NonEmpty RelayAccessPoint)]
- lpExtraAPI :: extraAPI
- mapExtraAPI :: forall a b (m :: Type -> Type). (a -> b) -> LedgerPeersConsensusInterface a m -> LedgerPeersConsensusInterface b m
- data UseLedgerPeers
- data AfterSlot
- data LedgerPeersKind
- data LedgerPeerSnapshot where
- LedgerPeerSnapshotV1 (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))])
- pattern LedgerPeerSnapshot :: (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))]) -> LedgerPeerSnapshot
- isLedgerPeersEnabled :: UseLedgerPeers -> Bool
- compareLedgerPeerSnapshotApproximate :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool
Documentation
The relative stake of a stakepool in relation to the total amount staked. A value in the [0, 1] range.
Constructors
PoolStake | |
Fields |
Instances
NFData PoolStake Source # | |
Num PoolStake Source # | |
Fractional PoolStake Source # | |
Show PoolStake Source # | |
Eq PoolStake Source # | |
Ord PoolStake Source # | |
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 | |
Fields |
Instances
data IsLedgerPeer Source #
Identifies a peer as coming from ledger or not.
Constructors
IsLedgerPeer | a ledger peer. |
IsNotLedgerPeer |
Instances
Show IsLedgerPeer Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods showsPrec :: Int -> IsLedgerPeer -> ShowS # show :: IsLedgerPeer -> String # showList :: [IsLedgerPeer] -> ShowS # | |
Eq IsLedgerPeer Source # | |
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).
Constructors
IsBigLedgerPeer | |
IsNotBigLedgerPeer |
Instances
Eq IsBigLedgerPeer Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods (==) :: IsBigLedgerPeer -> IsBigLedgerPeer -> Bool # (/=) :: IsBigLedgerPeer -> IsBigLedgerPeer -> Bool # |
data LedgerPeersConsensusInterface extraAPI (m :: Type -> Type) Source #
Return ledger state information and ledger peers.
Constructors
LedgerPeersConsensusInterface | |
Fields
|
mapExtraAPI :: forall a b (m :: Type -> Type). (a -> b) -> LedgerPeersConsensusInterface a m -> LedgerPeersConsensusInterface b m Source #
data UseLedgerPeers Source #
Only use the ledger after the given slot number.
Constructors
DontUseLedgerPeers | |
UseLedgerPeers AfterSlot |
Instances
Only use the ledger after the given slot number.
Instances
Generic AfterSlot Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Associated Types
| |||||
Show AfterSlot Source # | |||||
Eq AfterSlot Source # | |||||
NoThunks AfterSlot Source # | |||||
type Rep AfterSlot Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type type Rep AfterSlot = D1 ('MetaData "AfterSlot" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.13.0.0-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.
Constructors
AllLedgerPeers | |
BigLedgerPeers |
Instances
Show LedgerPeersKind Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods showsPrec :: Int -> LedgerPeersKind -> ShowS # show :: LedgerPeersKind -> String # showList :: [LedgerPeersKind] -> ShowS # |
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
FromJSON LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods parseJSON :: Value -> Parser LedgerPeerSnapshot # parseJSONList :: Value -> Parser [LedgerPeerSnapshot] # | |
ToJSON LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods toJSON :: LedgerPeerSnapshot -> Value # toEncoding :: LedgerPeerSnapshot -> Encoding # toJSONList :: [LedgerPeerSnapshot] -> Value # toEncodingList :: [LedgerPeerSnapshot] -> Encoding # omitField :: LedgerPeerSnapshot -> Bool # | |
FromCBOR LedgerPeerSnapshot Source # | |
ToCBOR LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods toCBOR :: LedgerPeerSnapshot -> Encoding # encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy LedgerPeerSnapshot -> Size # encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [LedgerPeerSnapshot] -> Size # | |
Show LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods showsPrec :: Int -> LedgerPeerSnapshot -> ShowS # show :: LedgerPeerSnapshot -> String # showList :: [LedgerPeerSnapshot] -> ShowS # | |
Eq LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods (==) :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool # (/=) :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool # |
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
FromJSON RelayAccessPointCoded Source # | |
Methods parseJSON :: Value -> Parser RelayAccessPointCoded # parseJSONList :: Value -> Parser [RelayAccessPointCoded] # | |
ToJSON RelayAccessPointCoded Source # | |
Methods toJSON :: RelayAccessPointCoded -> Value # toEncoding :: RelayAccessPointCoded -> Encoding # toJSONList :: [RelayAccessPointCoded] -> Value # toEncodingList :: [RelayAccessPointCoded] -> Encoding # omitField :: RelayAccessPointCoded -> Bool # |