inspector

package
v0.33.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

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

func (a *AggregateRPCInspector) Inspect(peerID peer.ID, rpc *pubsub.RPC) error

Inspect func with the p2p.GossipSubAppSpecificRpcInspector func signature that will invoke all the configured inspectors.

func (*AggregateRPCInspector) Inspectors

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

func (s *GossipSubInspectorSuite) InspectFunc() func(peer.ID, *pubsub.RPC) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL