topology

package
v0.10.3-stop-broadcast... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionTopology

type CollectionTopology struct {
	RandPermTopology
	// contains filtered or unexported fields
}

CollectionTopology builds on top of RandPermTopology and generates a deterministic random topology for collection node such that nodes withing the same collection cluster form a connected graph.

func NewCollectionTopology

func NewCollectionTopology(nodeID flow.Identifier, state protocol.ReadOnlyState) (CollectionTopology, error)

func (CollectionTopology) Subset

func (c CollectionTopology) Subset(idList flow.IdentityList, fanout uint) (flow.IdentityList, error)

Subset samples the idList and returns a list of nodes to connect with such that: a. this node is directly or indirectly connected to all other nodes in the same cluster b. to all other nodes c. to at least one node of each type and /d. to all other nodes of the same type. The collection nodes within a collection cluster need to form a connected graph among themselves independent of any other nodes to ensure reliable dissemination of cluster specific topic messages. e.g ClusterBlockProposal Similarly, all nodes of network need to form a connected graph, to ensure reliable dissemination of messages for topics subscribed by all node types e.g. BlockProposals Each node should be connected to at least one node of each type to ensure nodes don't form an island of a specific role, specially since some node types are represented by a very small number of nodes (e.g. few access nodes compared to tens or hundreds of collection nodes) Finally, all nodes of the same type should form a connected graph for exchanging messages for role specific topics e.g. Transaction

type RandPermTopology

type RandPermTopology struct {
	// contains filtered or unexported fields
}

RandPermTopology generates a random topology from a given set of nodes and for a given role The topology generated is a union of three sets: 1. a random subset of the size (n+1)/2 to make sure the nodes form a connected graph with no islands 2. one node of each of the flow role from the remaining ids to make a node can talk to any other type of node 3. (n+1)/2 of the nodes of the same role as this node from the remaining ids to make sure that nodes of the same type form a connected graph with no islands.

func NewRandPermTopology

func NewRandPermTopology(role flow.Role, id flow.Identifier) (RandPermTopology, error)

func (RandPermTopology) Subset

func (r RandPermTopology) Subset(idList flow.IdentityList, fanout uint) (flow.IdentityList, error)

type Topology

type Topology interface {
	// Subset returns a random subset of the identity list that is passed
	Subset(idList flow.IdentityList, fanout uint) (flow.IdentityList, error)
}

Topology provides a subset of nodes which a given node should directly connect to for 1-k messaging

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL