Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateRPCInspector ¶ added in v0.32.0
type AggregateRPCInspector struct {
// contains filtered or unexported fields
}
AggregateRPCInspector gossip sub RPC inspector that combines multiple RPC inspectors into a single inspector. Each individual inspector will be invoked synchronously.
func NewAggregateRPCInspector ¶ added in v0.32.0
func NewAggregateRPCInspector(inspectors ...p2p.GossipSubRPCInspector) *AggregateRPCInspector
NewAggregateRPCInspector returns new aggregate RPC inspector.
func (*AggregateRPCInspector) Inspect ¶ added in v0.32.0
Inspect func with the p2p.GossipSubAppSpecificRpcInspector func signature that will invoke all the configured inspectors.
func (*AggregateRPCInspector) Inspectors ¶ added in v0.32.0
func (a *AggregateRPCInspector) Inspectors() []p2p.GossipSubRPCInspector
type GossipSubInspectorSuite ¶ added in v0.32.0
type GossipSubInspectorSuite struct { component.Component // contains filtered or unexported fields }
GossipSubInspectorSuite encapsulates what is exposed to the libp2p node regarding the gossipsub RPC inspectors as well as their notification distributors.
func NewGossipSubInspectorSuite ¶ added in v0.32.0
func NewGossipSubInspectorSuite(metricsInspector *inspector.ControlMsgMetricsInspector, validationInspector *validation.ControlMsgValidationInspector, ctrlMsgInspectDistributor p2p.GossipSubInspectorNotifDistributor) *GossipSubInspectorSuite
NewGossipSubInspectorSuite creates a new GossipSubInspectorSuite. The suite is composed of the aggregated inspector, which is used to inspect the gossipsub rpc messages, and the control message notification distributor, which is used to notify consumers when a misbehaving peer regarding gossipsub control messages is detected. The suite is also a component, which is used to start and stop the rpc inspectors. Args:
- metricsInspector: the control message metrics inspector.
- validationInspector: the gossipsub validation control message validation inspector.
- ctrlMsgInspectDistributor: the notification distributor that is used to notify consumers when a misbehaving peer
regarding gossipsub control messages is detected. Returns:
- the new GossipSubInspectorSuite.
func (*GossipSubInspectorSuite) ActiveClustersChanged ¶ added in v0.32.0
func (s *GossipSubInspectorSuite) ActiveClustersChanged(list flow.ChainIDList)
ActiveClustersChanged is called when the list of active collection nodes cluster is changed. GossipSubInspectorSuite consumes this event and forwards it to all the respective rpc inspectors, that are concerned with this cluster-based topics (i.e., channels), so that they can update their internal state.
func (*GossipSubInspectorSuite) AddInvalidControlMessageConsumer ¶ added in v0.32.0
func (s *GossipSubInspectorSuite) AddInvalidControlMessageConsumer(c p2p.GossipSubInvCtrlMsgNotifConsumer)
AddInvalidControlMessageConsumer adds a consumer to the invalid control message notification distributor. This consumer is notified when a misbehaving peer regarding gossipsub control messages is detected. This follows a pub/sub pattern where the consumer is notified when a new notification is published. A consumer is only notified once for each notification, and only receives notifications that were published after it was added.
func (*GossipSubInspectorSuite) InspectFunc ¶ added in v0.32.0
InspectFunc returns the inspect function that is used to inspect the gossipsub rpc messages. This function follows a dependency injection pattern, where the inspect function is injected into the gossipsu, and is called whenever a gossipsub rpc message is received.