Safe Haskell | None |
---|---|
Language | Haskell2010 |
Various types related to ledger peers. This module is re-exported from Ouroboros.Network.PeerSelection.LedgerPeers.
Synopsis
- newtype PoolStake = PoolStake {}
- newtype AccPoolStake = AccPoolStake {}
- data IsBigLedgerPeer
- data LedgerStateJudgement
- data LedgerPeersConsensusInterface (m :: Type -> Type) = LedgerPeersConsensusInterface {}
- 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
- newtype MinBigLedgerPeersForTrustedState = MinBigLedgerPeersForTrustedState {}
- 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.
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].
Instances
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).
Instances
Eq IsBigLedgerPeer Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type (==) :: IsBigLedgerPeer -> IsBigLedgerPeer -> Bool # (/=) :: IsBigLedgerPeer -> IsBigLedgerPeer -> Bool # |
data LedgerStateJudgement Source #
Wether the node is caught up or fell too far behind the chain
Instances
data LedgerPeersConsensusInterface (m :: Type -> Type) Source #
Return ledger state information and ledger peers.
data UseLedgerPeers Source #
Only use the ledger after the given slot number.
Instances
Generic UseLedgerPeers Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type
from :: UseLedgerPeers -> Rep UseLedgerPeers x # to :: Rep UseLedgerPeers x -> UseLedgerPeers # | |||||
Show UseLedgerPeers Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type showsPrec :: Int -> UseLedgerPeers -> ShowS # show :: UseLedgerPeers -> String # showList :: [UseLedgerPeers] -> ShowS # | |||||
Eq UseLedgerPeers Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type (==) :: UseLedgerPeers -> UseLedgerPeers -> Bool # (/=) :: UseLedgerPeers -> UseLedgerPeers -> Bool # | |||||
NoThunks UseLedgerPeers Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type noThunks :: Context -> UseLedgerPeers -> IO (Maybe ThunkInfo) # wNoThunks :: Context -> UseLedgerPeers -> IO (Maybe ThunkInfo) # showTypeOf :: Proxy UseLedgerPeers -> String # | |||||
type Rep UseLedgerPeers Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type type Rep UseLedgerPeers = D1 ('MetaData "UseLedgerPeers" "Ouroboros.Network.PeerSelection.LedgerPeers.Type" "ouroboros-network-api-0.11.0.0-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))) |
Only use the ledger after the given slot number.
Instances
Generic AfterSlot Source # | |||||
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type
| |||||
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.11.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.
Instances
Show LedgerPeersKind Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type 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.
LedgerPeerSnapshotV1 (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))]) | Internal use for version 1, use pattern synonym for public API |
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 # | |
ToJSON LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type toJSON :: LedgerPeerSnapshot -> Value # toEncoding :: LedgerPeerSnapshot -> Encoding # toJSONList :: [LedgerPeerSnapshot] -> Value # toEncodingList :: [LedgerPeerSnapshot] -> Encoding # omitField :: LedgerPeerSnapshot -> Bool # | |
FromCBOR LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type fromCBOR :: Decoder s LedgerPeerSnapshot # label :: Proxy LedgerPeerSnapshot -> Text # | |
ToCBOR LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type 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 showsPrec :: Int -> LedgerPeerSnapshot -> ShowS # show :: LedgerPeerSnapshot -> String # showList :: [LedgerPeerSnapshot] -> ShowS # | |
Eq LedgerPeerSnapshot Source # | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type (==) :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool # (/=) :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool # |
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
FromJSON RelayAccessPointCoded Source # | |
ToJSON RelayAccessPointCoded Source # | |
toJSON :: RelayAccessPointCoded -> Value # toEncoding :: RelayAccessPointCoded -> Encoding # toJSONList :: [RelayAccessPointCoded] -> Value # toEncodingList :: [RelayAccessPointCoded] -> Encoding # omitField :: RelayAccessPointCoded -> Bool # |