[−][src]Module solana_core::cluster_info
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
Structs
ClusterInfo | |
Locality | |
Node | |
PruneData | |
Sockets |
Enums
ClusterInfoError |
Constants
DATA_PLANE_FANOUT | The Data plane fanout size, also used as the neighborhood size |
GOSSIP_SLEEP_MILLIS | milliseconds we sleep for between gossip requests |
MAX_BLOOM_SIZE | The maximum size of a bloom filter |
MAX_SNAPSHOT_HASHES | Keep the number of snapshot hashes a node publishes under MAX_PROTOCOL_PAYLOAD_SIZE |
VALIDATOR_PORT_RANGE |
Functions
compute_retransmit_peers | 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 |