ouroboros-consensus-diffusion-0.18.0.0: Integration for the Ouroboros Network layer
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.ThreadNet.Util.NodeTopology

Synopsis

Node Topology

newtype NodeTopology Source #

Which lesser nodes each node connects to

INVARIANT: for each mapping n -> ms, n > m for each m in ms

INVARIANT: only the mapping for n = CoreNodeId 0 is empty

INVARIANT: there is a mapping for each CoreNodeId in the test, 0 .. n - 1

Note that every node is connected to every other but not necessarily directly. In other words, the topology is always a single network of nodes, which is realistic. With other test configuration components, such as network partitions, the network may split (temporarily or not) into separate connected components during the execution, but the base topology is connected.

Instances

Instances details
Generic NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

Associated Types

type Rep NodeTopologyTypeType #

Show NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

Eq NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

Condense NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

type Rep NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

type Rep NodeTopology = D1 ('MetaData "NodeTopology" "Test.ThreadNet.Util.NodeTopology" "ouroboros-consensus-diffusion-0.18.0.0-inplace-unstable-diffusion-testlib" 'True) (C1 ('MetaCons "NodeTopology" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNodeTopology") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CoreNodeId (Set CoreNodeId)))))

coreNodeIdNeighborsHasCallStackNodeTopologyCoreNodeId → [CoreNodeId] Source #

The neighbors of this node

edgesNodeTopologyNodeTopology → [(CoreNodeId, CoreNodeId)] Source #

The edges in this topology

genNodeTopology Source #

Arguments

HasCallStack 
NumCoreNodes

PRECONDITION: non-negative

Gen NodeTopology 

Generate a NodeTopology consistent with the given properties

meshNodeTopology Source #

Arguments

NumCoreNodes

PRECONDITION: non-negative

NodeTopology 

Connect every pair of nodes

minimumDegreeNodeTopologyNodeTopologyMaybe Int Source #

The neighbor count of the node with the fewest neighbors, unless there are zero nodes

shrinkNodeTopologyNodeTopology → [NodeTopology] Source #

Shrink a node topology

The new topologies must be usable with the same number of nodes and slots as the old topology