Versions in this module Expand all Collapse all v1 v1.37.1 Sep 8, 2026 Changes in this version + const ConnectedPeersKey + const MaxBloomFilterEntries + const MaxTrackedIPs + const PrimaryNetworkValidatorHealthKey + const SendFailRateKey + const TimeSinceLastMsgReceivedKey + const TimeSinceLastMsgSentKey + var ErrNoIngressConnections = errors.New("primary network validator has no inbound connections") + func NewValidatorsWrapper(manager validators.Manager) *validatorsWrapper + type Config struct + AllowPrivateIPs bool + BLSKey bls.Signer + Beacons validators.Manager + CPUTargeter tracker.Targeter + CompressionType compression.Type + DialerConfig dialer.Config + DiskTargeter tracker.Targeter + GenesisBytes []byte + MaxClockDifference time.Duration + MaximumInboundMessageTimeout time.Duration + MyIPPort *utils.Atomic[netip.AddrPort] + MyNodeID ids.NodeID + NetworkID uint32 + ObjectedLPs set.Set[uint32] + PeerReadBufferSize int + PeerWriteBufferSize int + PingFrequency time.Duration + ProxyEnabled bool + ProxyReadHeaderTimeout time.Duration + RequireValidatorToConnect bool + ResourceTracker consensustracker.ResourceTracker + SecurityProfile *consensusconfig.ChainSecurityProfile + SequencerIDForChain func(chainID ids.ID) ids.ID + StakingMLDSA *mldsa.PrivateKey + StakingMLDSAPub []byte + SupportedLPs set.Set[uint32] + TLSConfig *tls.Config + TLSKey crypto.Signer + TLSKeyLogFile string + ThrottlerConfig ThrottlerConfig + TrackedChains set.Set[ids.ID] + UptimeCalculator uptime.Calculator + UptimeMetricFreq time.Duration + UptimeRequirement float64 + Validators validators.Manager + func NewTestNetworkConfig(metrics metric.Registerer, networkID uint32, ...) (*Config, error) + type ConsistentHashPeerSelector = ScopedConsistentHashSelector + func NewConsistentHashPeerSelector(virtualNodes int) *ConsistentHashPeerSelector + type DelayConfig struct + InitialReconnectDelay time.Duration + MaxReconnectDelay time.Duration + type ExternalHandler interface + Connected func(nodeID ids.NodeID, version *version.Application, chainID ids.ID) + Disconnected func(nodeID ids.NodeID) + HandleInbound func(ctx context.Context, msg message.InboundMessage) + type ExternalSender interface + Gossip func(msg Message, nodeIDs set.Set[ids.NodeID], chainID ids.ID, ...) set.Set[ids.NodeID] + Send func(msg Message, nodeIDs set.Set[ids.NodeID], chainID ids.ID, requestID uint32) set.Set[ids.NodeID] + type HealthConfig struct + Enabled bool + MaxPortionSendQueueBytesFull float64 + MaxSendFailRate float64 + MaxTimeSinceMsgReceived time.Duration + MaxTimeSinceMsgSent time.Duration + MinConnectedPeers uint + NoIngressValidatorConnectionGracePeriod time.Duration + SendFailRateHalflife time.Duration + type Message = message.OutboundMessage + type Network interface + Dispatch func() error + ManuallyTrack func(nodeID ids.NodeID, endpoint endpoints.Endpoint) + NodeUptime func() (UptimeResult, error) + PeerInfo func(nodeIDs []ids.NodeID) []peer.Info + RegisterBlockchainNetwork func(blockchainID, networkID ids.ID) + RegisterChainIdentity func(id peer.ChainIdentity) + StartClose func() + TrackChain func(chainID ids.ID) error + TrackedChains func() set.Set[ids.ID] + func NewNetwork(config *Config, minCompatibleTime time.Time, msgCreator message.Creator, ...) (Network, error) + func NewTestNetwork(log log.Logger, registry metric.Registry, cfg *Config, router ExternalHandler) (Network, error) + type PeerListGossipConfig struct + PeerListBloomResetFreq time.Duration + PeerListNumValidatorIPs uint32 + PeerListPullGossipFreq time.Duration + type ScopedConsistentHashSelector struct + func NewScopedConsistentHashSelector(virtualNodes int) *ScopedConsistentHashSelector + func (s *ScopedConsistentHashSelector) Clear(key SelectorKey) + func (s *ScopedConsistentHashSelector) ClearAll() + func (s *ScopedConsistentHashSelector) Contains(key SelectorKey, nodeID ids.NodeID) bool + func (s *ScopedConsistentHashSelector) Keys() []SelectorKey + func (s *ScopedConsistentHashSelector) RemovePeer(key SelectorKey, nodeID ids.NodeID) + func (s *ScopedConsistentHashSelector) SelectDeterministic(key SelectorKey, msgKey []byte, n int, exclude set.Set[ids.NodeID]) []ids.NodeID + func (s *ScopedConsistentHashSelector) SelectPseudoRandom(key SelectorKey, seed []byte, n int, exclude set.Set[ids.NodeID]) []ids.NodeID + func (s *ScopedConsistentHashSelector) Size(key SelectorKey) int + func (s *ScopedConsistentHashSelector) TopByWeight(key SelectorKey, limit int) []ids.NodeID + func (s *ScopedConsistentHashSelector) TotalSize() int + func (s *ScopedConsistentHashSelector) UpsertPeer(key SelectorKey, nodeID ids.NodeID, weight uint64) + type SelectorKey = ids.ID + type SetCallbackListener interface + OnValidatorAdded func(nodeID ids.NodeID, pk *bls.PublicKey, txID ids.ID, weight uint64) + OnValidatorRemoved func(nodeID ids.NodeID, weight uint64) + OnValidatorWeightChanged func(nodeID ids.NodeID, oldWeight, newWeight uint64) + type ThrottlerConfig struct + InboundConnUpgradeThrottlerConfig throttling.InboundConnUpgradeThrottlerConfig + InboundMsgThrottlerConfig throttling.InboundMsgThrottlerConfig + MaxInboundConnsPerSec float64 + OutboundMsgThrottlerConfig throttling.MsgByteThrottlerConfig + type TimeoutConfig struct + PingPongTimeout time.Duration + ReadHandshakeTimeout time.Duration + type UptimeResult struct + RewardingStakePercentage float64 + WeightedAveragePercentage float64