Module solana_gossip::cluster_info
source · 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 fit2^20
number of nodes.
Bank needs to provide an interface for us to query the stake weight
Macros
Structs
Enums
Constants
- The Data plane fanout size, also used as the neighborhood size
- FIELDS 🔒
- Number of bytes in the randomly generated token sent with ping messages.
- milliseconds we sleep for between gossip requests
- Maximum number of hashes in AccountsHashes a node publishes such that the serialized size of the push/pull message stays below PACKET_DATA_SIZE.
- The maximum size of a bloom filter
- A hard limit on incoming gossip messages Chosen to be able to handle 1Gbps of pure gossip traffic 128MB/PACKET_DATA_SIZE
- Maximum number of incremental hashes in SnapshotHashes a node publishes such that the serialized size of the push/pull message stays below PACKET_DATA_SIZE.
- Maximum number of hashes in LegacySnapshotHashes a node publishes such that the serialized size of the push/pull message stays below PACKET_DATA_SIZE.
- Maximum number of origin nodes that a PruneData may contain, such that the serialized size of the PruneMessage stays below PACKET_DATA_SIZE.
- Minimum number of staked nodes for enforcing stakes in gossip.
- Minimum stake that a node should have so that its CRDS values are propagated through gossip (few types are exempted).
- Minimum serialized size of a Protocol::PullResponse packet.
- Max size of serialized crds-values in a Protocol::PushMessage packet. This is equal to PACKET_DATA_SIZE minus serialized size of an empty push message: Protocol::PushMessage(Pubkey::default(), Vec::default())
- VARIANTS 🔒
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 - extend 🔒
- merge 🔒
Type Definitions
- Ping 🔒