stellar-core overlay 思维导图 (StellarMessage (:star: Messages directed to or…
stellar-core overlay 思维导图
Manages list of banned nodes.
FloodGate keeps track of which peers have sent us which broadcast messages, in order to ensure that for each broadcast message M and for each peer P, we either send M to P once (and only once), or receive M
P (thereby inhibit sending M to P at all).
The broadcast message types are
All messages are marked with the ledger sequence number to which they relate, and all flood-management information for a given ledger number is purged from the FloodGate when the ledger closes.
The ItemFetcher keeps instances of the Tracker class. There exists exactly one Tracker per item. The tracker is used to maintain the state of the search.
This class monitors system load, and attempts to assign blame for the origin of load to particular peers, including the transactions we inject ourselves.
The purpose is ultimately to offer a diagnostic view of the peer when and if it's overloaded, as well as to support an automatic load-shedding action of disconnecting the "worst" peers and/or rejecting traffic due to load.
This is all very heuristic and speculative; if it turns out not to work, or to do more harm than good, it ought to be disabled/removed.
maintains a virtual broadcast network, consisting of a set of remote TCP peers (TCPPeer), a mechanism for flooding messages to all peers (
)), and a mechanism for sending and receiving anycast request/reply pairs (
Overlay network messages are defined as the XDR structure type
), in the file src/xdr/Stellar-overlay.x
The overlay subsystem manages a virtual "broadcast network" composed of a set of peer-to-peer TCP connections, as well as mechanisms for managing distribution of broadcast messages, anycast request/reply message pairs, and peer-to-peer control messages to and from those peers.
Within the local process, the overlay subsystem primarily delivers messages to, and accepts them from, the
, as well as propagating through the network any transactions injected from public API servers.
:star: Messages directed to or from a specific peer, with or without a response:
:star: One-way broadcast messages informing other peers of an event:
:star: Two-way anycast messages requesting a value (by hash) or providing it
Anycasts are initiated and serviced two instances of
) (mTxSetFetcher and mQuorumSetFetcher).
Anycast messages are sent to directly-connected peers, in sequence until satisfied. They are not flooded between peers.
Broadcasts are initiated by the Herder and sent to both the Herder
), for propagation to other peers.