Help us shape the future of Go! Take the 2026 Go Developer Survey

benchlist

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchlist

type Benchlist interface {
	// RegisterResponse registers that we received a response from the given validator.
	RegisterResponse(nodeID ids.NodeID)

	// RegisterFailure registers that the given validator failed to respond.
	RegisterFailure(nodeID ids.NodeID)

	// IsBenched returns true if the given validator is benched.
	IsBenched(nodeID ids.NodeID) bool

	// GetBenched returns all benched validators.
	GetBenched() []ids.NodeID

	// Remove removes a validator from the benchlist.
	Remove(nodeID ids.NodeID)
}

Benchlist tracks validator reliability.

func NewBenchlist

func NewBenchlist(config Config) Benchlist

NewBenchlist creates a new benchlist.

type Config

type Config struct {
	// Threshold is the number of consecutive failures before benching.
	Threshold int

	// MinimumFailingDuration is the minimum amount of time a validator must be failing before benching.
	MinimumFailingDuration time.Duration

	// Duration is how long a validator is benched.
	Duration time.Duration

	// MaxPortion is the maximum portion of validators that can be benched.
	MaxPortion float64
}

Config defines benchlist configuration.

type Manager

type Manager interface {
	// GetBenchlist returns the benchlist for the given chain.
	GetBenchlist(chainID ids.ID) Benchlist

	// RegisterChain registers a new chain with the manager.
	RegisterChain(chainID ids.ID, config Config) Benchlist

	// GetBenched returns the chain IDs where the given node is benched.
	GetBenched(nodeID ids.NodeID) []ids.ID
}

Manager manages benchlists for multiple chains.

func NewManager

func NewManager() Manager

NewManager creates a new benchlist manager.

Jump to

Keyboard shortcuts

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