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 ¶
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.
Click to show internal directories.
Click to hide internal directories.