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
- Information about the grid neighbors for a particular node in the topology.
- A representation of routing based on sample
- A storage for the current and maybe previous topology
- A set of topologies indexed by session
- Topology representation for a session.
- An entry tracking a session grid topology and some cached local neighbors.
- Information about a peer in the gossip topology for a session.
Enums
- Routing mode
Constants
- The number of peers to randomly propagate messages to.
- 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).