polkadot_node_network_protocol

Module grid_topology

Source
Expand description

Grid topology support module Grid topology support implementation The basic operation of the 2D grid topology is that:

  • A validator producing a message sends it to its row-neighbors and its column-neighbors
  • A validator receiving a message originating from one of its row-neighbors sends it to its column-neighbors
  • A validator receiving a message originating from one of its column-neighbors sends it to its row-neighbors

This grid approach defines 2 unique paths for every validator to reach every other validator in at most 2 hops.

However, we also supplement this with some degree of random propagation: every validator, upon seeing a message for the first time, propagates it to 8 random peers. This inserts some redundancy in case the grid topology isn’t working or is being attacked - an adversary doesn’t know which peers a validator will send to. This is combined with the property that the adversary doesn’t know which validators will elect to check a block.

Structs§

GridNeighbors
Information about the grid neighbors for a particular node in the topology.
RandomRouting
A representation of routing based on sample
SessionBoundGridTopologyStorage
A storage for the current and maybe previous topology
SessionGridTopologies
A set of topologies indexed by session
SessionGridTopology
Topology representation for a session.
SessionGridTopologyEntry
An entry tracking a session grid topology and some cached local neighbors.
TopologyPeerInfo
Information about a peer in the gossip topology for a session.

Enums§

RequiredRouting
Routing mode

Constants§

DEFAULT_RANDOM_CIRCULATION
The number of peers to randomly propagate messages to.
DEFAULT_RANDOM_SAMPLE_RATE
The sample rate for randomly propagating messages. This reduces the left tail of the binomial distribution but also introduces a bias towards peers who we sample before others (i.e. those who get a block before others).