-
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
293 additions
and
27 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
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Ouroboros.Network.PeerSelection.LocalRootPeers (OutboundConnectionsState (..)) where | ||
|
||
import GHC.Generics | ||
import NoThunks.Class | ||
|
||
data OutboundConnectionsState = | ||
TrustedStateWithExternalPeers | ||
-- ^ | ||
-- * /in praos mode/: connected only to trusted local | ||
-- peers and at least one bootstrap peer or public root; | ||
-- * /in genesis mode/: meeting target of active big ledger peers; | ||
-- * or it is in promiscuous mode (see below). | ||
-- | ||
-- A node is classified as a non promiscuous node if it is a hidden relay or | ||
-- a BPa, e.g. if it is configured such that it can only have a chance to be | ||
-- connected to local roots. This is true in one of the two ways: | ||
-- | ||
-- * it's configured with `DontUseBootstrapPeers` and `DontUseLedgerPeers`; | ||
-- or | ||
-- * the targets are set so the node can only be connected to local roots. | ||
|
||
| 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.