Documentation ¶
Index ¶
- func DefaultRPCValidationConfig(opts ...queue.HeroStoreConfigOption) *validation.ControlMsgValidationInspectorConfig
- type GossipSubInspectorBuilder
- func (b *GossipSubInspectorBuilder) Build() ([]p2p.GossipSubRPCInspector, error)
- func (b *GossipSubInspectorBuilder) SetMetrics(netMetrics module.NetworkMetrics, metricsRegistry prometheus.Registerer) *GossipSubInspectorBuilder
- func (b *GossipSubInspectorBuilder) SetMetricsEnabled(metricsEnabled bool) *GossipSubInspectorBuilder
- func (b *GossipSubInspectorBuilder) SetPublicNetwork(public bool) *GossipSubInspectorBuilder
- type GossipSubRPCInspectorsConfig
- type GossipSubRPCMetricsInspectorConfigs
- type GossipSubRPCValidationInspectorConfigs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRPCValidationConfig ¶
func DefaultRPCValidationConfig(opts ...queue.HeroStoreConfigOption) *validation.ControlMsgValidationInspectorConfig
DefaultRPCValidationConfig returns default RPC control message inspector config.
Types ¶
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, distributor p2p.GossipSubInspectorNotificationDistributor) *GossipSubInspectorBuilder
NewGossipSubInspectorBuilder returns new *GossipSubInspectorBuilder.
func (*GossipSubInspectorBuilder) Build ¶
func (b *GossipSubInspectorBuilder) Build() ([]p2p.GossipSubRPCInspector, error)
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 ¶
func (b *GossipSubInspectorBuilder) SetMetrics(netMetrics module.NetworkMetrics, metricsRegistry prometheus.Registerer) *GossipSubInspectorBuilder
SetMetrics sets the network metrics and registry.
func (*GossipSubInspectorBuilder) SetMetricsEnabled ¶
func (b *GossipSubInspectorBuilder) SetMetricsEnabled(metricsEnabled bool) *GossipSubInspectorBuilder
SetMetricsEnabled disable and enable metrics collection for the inspectors underlying hero store cache.
func (*GossipSubInspectorBuilder) SetPublicNetwork ¶
func (b *GossipSubInspectorBuilder) SetPublicNetwork(public bool) *GossipSubInspectorBuilder
SetPublicNetwork used to differentiate between libp2p nodes used for public vs private networks. Currently, there are different metrics collectors for public vs private networks.
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
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 { // 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 }
GossipSubRPCValidationInspectorConfigs validation limits used for gossipsub RPC control message inspection.