Crate sc_peerset

Source
Expand description

Peer Set Manager (PSM). Contains the strategy for choosing which nodes the network should be connected to.

The PSM handles sets of nodes. A set of nodes is defined as the nodes that are believed to support a certain capability, such as handling blocks and transactions of a specific chain, or collating a certain parachain.

For each node in each set, the peerset holds a flag specifying whether the node is connected to us or not.

This connected/disconnected status is specific to the node and set combination, and it is for example possible for a node to be connected through a specific set but not another.

In addition, for each, set, the peerset also holds a list of reserved nodes towards which it will at all time try to maintain a connection with.

Structs§

IncomingIndex
Opaque identifier for an incoming connection. Allocated by the network.
PeerId
Identifier of a peer of the network.
Peerset
Side of the peer set manager owned by the network. In other words, the “receiving” side.
PeersetConfig
Configuration to pass when creating the peer set manager.
PeersetHandle
Shared handle to the peer set manager (PSM). Distributed around the code.
ReputationChange
Description of a reputation adjustment for a node.
SetConfig
Configuration for a single set of nodes.
SetId
Identifier of a set in the peerset.

Enums§

DropReason
Reason for calling Peerset::dropped.
Message
Message that can be sent by the peer set manager (PSM).

Constants§

BANNED_THRESHOLD
We don’t accept nodes whose reputation is under this value.