generateslashings

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

README

generate_slashings Task

Description

The generate_slashings task is designed to create slashing operations for artificially constructed slashable conditions, and send these operations to the network.
It's important to note that while the slashing operations are sent to the network, the fake attestations or proposals that justify these slashings are never actually broadcasted. This task is vital for testing the network's response to validator misconduct without affecting the actual network operations.

Configuration Parameters

  • slashingType:
    Determines the type of slashing to be simulated. Options are attester for attestations-related slashing and proposer for proposal-related slashing.
    This setting decides the kind of validator misbehavior being simulated.

  • limitPerSlot:
    The maximum number of slashing operations to generate per slot.

  • limitTotal:
    The total limit on the number of slashing operations to be generated by this task.

  • mnemonic:
    A mnemonic phrase for generating the keys of validators involved in the simulated slashing.

  • startIndex:
    The index from which to start generating validator keys within the mnemonic sequence.

  • indexCount:
    The number of validator keys to generate from the mnemonic, indicating how many distinct slashing operations will be created.

    • clientPattern:
      A regex pattern for selecting specific client endpoints to send the slashing operations. If not specified, the task will use any available endpoint.
  • excludeClientPattern: A regex pattern to exclude certain clients from being used for slashing operations. This feature provides an additional layer of control by allowing the exclusion of specific clients, which can be useful for testing under various network conditions.

Defaults

Default settings for the generate_slashings task:

- name: generate_slashings
  config:
    slashingType: attester
    limitPerSlot: 0
    limitTotal: 0
    mnemonic: ""
    startIndex: 0
    indexCount: 0
    clientPattern: ""
    excludeClientPattern: ""

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "generate_slashings"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Generates slashable attestations / proposals and sends them to the network",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error)

Types

type Config

type Config struct {
	SlashingType         string `yaml:"slashingType" json:"slashingType"`
	LimitPerSlot         int    `yaml:"limitPerSlot" json:"limitPerSlot"`
	LimitTotal           int    `yaml:"limitTotal" json:"limitTotal"`
	Mnemonic             string `yaml:"mnemonic" json:"mnemonic"`
	StartIndex           int    `yaml:"startIndex" json:"startIndex"`
	IndexCount           int    `yaml:"indexCount" json:"indexCount"`
	ClientPattern        string `yaml:"clientPattern" json:"clientPattern"`
	ExcludeClientPattern string `yaml:"excludeClientPattern" json:"excludeClientPattern"`
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Task

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

func (*Task) Config

func (t *Task) Config() interface{}

func (*Task) Execute

func (t *Task) Execute(ctx context.Context) error

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Timeout

func (t *Task) Timeout() time.Duration

Jump to

Keyboard shortcuts

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