Expand description

The cluster_info module defines a data structure that is shared by all the nodes in the network over a gossip control plane. The goal is to share small bits of off-chain information and detect and repair partitions.

This CRDT only supports a very limited set of types. A map of Pubkey -> Versioned Struct. The last version is always picked during an update.

The network is arranged in layers:

  • layer 0 - Leader.
  • layer 1 - As many nodes as we can fit
  • layer 2 - Everyone else, if layer 1 is 2^10, layer 2 should be able to fit 2^20 number of nodes.

Bank needs to provide an interface for us to query the stake weight

Structs

Enums

Constants

The Data plane fanout size, also used as the neighborhood size

milliseconds we sleep for between gossip requests

The maximum size of a bloom filter

Maximum number of hashes in IncrementalSnapshotHashes a node publishes such that the serialized size of the push/pull message stays below PACKET_DATA_SIZE.

Maximum number of hashes in SnapshotHashes/AccountsHashes a node publishes such that the serialized size of the push/pull message stays below PACKET_DATA_SIZE.

Functions

Turbine logic 1 - For the current node find out if it is in layer 1 1.1 - If yes, then broadcast to all layer 1 nodes 1 - using the layer 1 index, broadcast to all layer 2 nodes assuming you know neighborhood size 1.2 - If no, then figure out what layer the node is in and who the neighbors are and only broadcast to them 1 - also check if there are nodes in the next layer and repeat the layer 1 to layer 2 logic Returns Neighbor Nodes and Children Nodes (neighbors, children) for a given node based on its stake