Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateRPCInspector ¶
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 ¶
func NewAggregateRPCInspector(inspectors ...p2p.GossipSubRPCInspector) *AggregateRPCInspector
NewAggregateRPCInspector returns new aggregate RPC inspector.
func (*AggregateRPCInspector) Inspect ¶
Inspect func with the p2p.GossipSubAppSpecificRpcInspector func signature that will invoke all the configured inspectors.
func (*AggregateRPCInspector) Inspectors ¶
func (a *AggregateRPCInspector) Inspectors() []p2p.GossipSubRPCInspector
type GossipSubInspectorSuite ¶
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 ¶
func NewGossipSubInspectorSuite( 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 ¶
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 ¶
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 ¶
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.