Skip to content

Commit

Permalink
ouroboros-network-api: added IsBigLedgerPeer
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Mar 17, 2023
1 parent 22035b9 commit fb98c1b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ouroboros-network-api/CHANGELOG.md
@@ -1,5 +1,14 @@
# Revision history for ouroboros-network-api

## next version

### Breaking changes

### Non breaking changes

* Added `IsBigLedgerPeer` type to
`Ouroboros.Network.PeerSelection.LedgerPeers.Type`.

## 0.1.0.0 -- 2022-11-17

* Initial release
Expand Up @@ -4,6 +4,7 @@
module Ouroboros.Network.PeerSelection.LedgerPeers.Type
( PoolStake (..)
, AccPoolStake (..)
, IsBigLedgerPeer (..)
) where

import Control.DeepSeq (NFData (..))
Expand All @@ -21,3 +22,18 @@ newtype PoolStake = PoolStake { unPoolStake :: Rational }
--
newtype AccPoolStake = AccPoolStake { unAccPoolStake :: Rational }
deriving (Eq, Fractional, Num, Ord, Show)


-- | 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 IsBigLedgerPeer
= IsBigLedgerPeer
| IsNotBigLedgerPeer
deriving Eq

0 comments on commit fb98c1b

Please sign in to comment.