-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
peer-selection: added publicly visible OutboundConnectionsState
Consensus needs to know if the outbound governor is connected just to local roots or any external roots. Diffusion takes a callback `OutboundConnectionsState -> STM m ()` used by the outbound governor. Co-authored-by: Armando Santos (@bolt12) Co-authored-by: Marcin Szamotulski (@coot)
- Loading branch information
Showing
15 changed files
with
308 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ouroboros-network-api/src/Ouroboros/Network/PeerSelection/LocalRootPeers.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Ouroboros.Network.PeerSelection.LocalRootPeers (OutboundConnectionsState (..)) where | ||
|
||
import GHC.Generics | ||
import NoThunks.Class | ||
|
||
data OutboundConnectionsState = | ||
TrustedStateWithExternalPeers | ||
-- ^ | ||
-- * /in the Praos mode/: connected only to trusted local | ||
-- peers and at least one bootstrap peer or public root; | ||
-- * /in the Genesis mode/: meeting target of active big ledger peers; | ||
-- * or it is in `Unrestricted` mode | ||
-- (see `Ouroboros.Network.PeerSelection.Governor.AssociationMode`). | ||
|
||
| UntrustedState | ||
-- ^ catch all other cases | ||
deriving (Eq, Show, Generic) | ||
|
||
instance NoThunks OutboundConnectionsState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.