inspector

package
v0.31.14 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GossipSubCtrlMsgIhaveLimitsConfig added in v0.31.0

type GossipSubCtrlMsgIhaveLimitsConfig struct {
	// IHaveLimits IHAVE control message validation limits.
	IHaveLimits map[string]int
	// IHaveSyncInspectSampleSizePercentage the percentage of topics to sample for sync pre-processing in float64 form.
	IHaveSyncInspectSampleSizePercentage float64
	// IHaveAsyncInspectSampleSizePercentage  the percentage of topics to sample for async pre-processing in float64 form.
	IHaveAsyncInspectSampleSizePercentage float64
	// IHaveInspectionMaxSampleSize the max number of ihave messages in a sample to be inspected.
	IHaveInspectionMaxSampleSize float64
}

GossipSubCtrlMsgIhaveLimitsConfig validation limit configs for ihave RPC control messages.

func (*GossipSubCtrlMsgIhaveLimitsConfig) IhaveConfigurationOpts added in v0.31.0

IhaveConfigurationOpts returns list of options for the ihave configuration.

type GossipSubInspectorBuilder

type GossipSubInspectorBuilder struct {
	// contains filtered or unexported fields
}

GossipSubInspectorBuilder builder that constructs all rpc inspectors used by gossip sub. The following rpc inspectors are created with this builder. - validation inspector: performs validation on all control messages. - metrics inspector: observes metrics for each rpc message received.

func NewGossipSubInspectorBuilder

func NewGossipSubInspectorBuilder(logger zerolog.Logger, sporkID flow.Identifier, inspectorsConfig *GossipSubRPCInspectorsConfig, provider module.IdentityProvider, inspectorMetrics module.GossipSubRpcValidationInspectorMetrics) *GossipSubInspectorBuilder

NewGossipSubInspectorBuilder returns new *GossipSubInspectorBuilder.

func (*GossipSubInspectorBuilder) Build

Build builds the rpc inspectors used by gossipsub. Any returned error from this func indicates a problem setting up rpc inspectors. In libp2p node setup, the returned error should be treated as a fatal error.

func (*GossipSubInspectorBuilder) SetMetrics

SetMetrics sets the network metrics and registry.

func (*GossipSubInspectorBuilder) SetNetworkType added in v0.31.0

SetNetworkType sets the network type for the inspector. This is used to determine if the node is running on a public or private network. Args: - networkType: the network type. Returns: - *GossipSubInspectorBuilder: the builder.

type GossipSubRPCInspectorsConfig

type GossipSubRPCInspectorsConfig struct {
	// GossipSubRPCInspectorNotificationCacheSize size of the queue for notifications about invalid RPC messages.
	GossipSubRPCInspectorNotificationCacheSize uint32
	// ValidationInspectorConfigs control message validation inspector validation configuration and limits.
	ValidationInspectorConfigs *GossipSubRPCValidationInspectorConfigs
	// MetricsInspectorConfigs control message metrics inspector configuration.
	MetricsInspectorConfigs *GossipSubRPCMetricsInspectorConfigs
}

GossipSubRPCInspectorsConfig encompasses configuration related to gossipsub RPC message inspectors.

func DefaultGossipSubRPCInspectorsConfig

func DefaultGossipSubRPCInspectorsConfig() *GossipSubRPCInspectorsConfig

DefaultGossipSubRPCInspectorsConfig returns the default control message inspectors config.

type GossipSubRPCMetricsInspectorConfigs

type GossipSubRPCMetricsInspectorConfigs struct {
	// NumberOfWorkers number of worker pool workers.
	NumberOfWorkers int
	// CacheSize size of the queue used by worker pool for the control message metrics inspector.
	CacheSize uint32
}

GossipSubRPCMetricsInspectorConfigs rpc metrics observer inspector configuration.

type GossipSubRPCValidationInspectorConfigs

type GossipSubRPCValidationInspectorConfigs struct {
	*validation.ClusterPrefixedMessageConfig
	// NumberOfWorkers number of worker pool workers.
	NumberOfWorkers int
	// CacheSize size of the queue used by worker pool for the control message validation inspector.
	CacheSize uint32
	// GraftLimits GRAFT control message validation limits.
	GraftLimits map[string]int
	// PruneLimits PRUNE control message validation limits.
	PruneLimits map[string]int
	// IHaveLimitsConfig IHAVE control message validation limits configuration.
	IHaveLimitsConfig *GossipSubCtrlMsgIhaveLimitsConfig
}

GossipSubRPCValidationInspectorConfigs validation limits used for gossipsub RPC control message inspection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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