ouroboros-network:sim-tests-lib
Safe HaskellNone
LanguageHaskell2010

Test.Ouroboros.Network.PeerSelection.PeerGraph

Synopsis

Documentation

newtype PeerGraph Source #

The peer graph is the graph of all the peers in the mock p2p network, in traditional adjacency representation.

Constructors

PeerGraph [(PeerAddr, [PeerAddr], PeerInfo)] 

validPeerGraph :: PeerGraph -> Bool Source #

Invariant. Used to check the QC generator and shrinker.

type PeerShareScript = Script (Maybe ([PeerAddr], PeerShareTime)) Source #

The peer sharing script is the script we interpret to provide answers to peer share requests that the governor makes. After each peer share request to a peer we move on to the next entry in the script, unless we get to the end in which case that becomes the reply for all remaining peer share requests.

A Nothing indicates failure. The [PeerAddr] is the list of peers to return which must always be a subset of the actual edges in the p2p graph.

This representation was chosen because it allows easy shrinking.

type ConnectionScript = TimedScript AsyncDemotion Source #

Connection script is the script which provides asynchronous demotions either to cold or warm peer.

type PeerSharingScript = Script PeerSharing Source #

PeerSharing script is the script which provides PeerSharing values when a new connection is established.

data PeerShareTime Source #

The peer sharing time is our simulation of elapsed time to respond to peer share requests. This is important because the governor uses timeouts and behaves differently in these three cases.