checkconsensusproposerduty

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

README

check_consensus_proposer_duty Task

Description

The check_consensus_proposer_duty task is designed to check for a specific proposer duty on the consensus chain. It verifies if a matching validator is scheduled to propose a block within a specified future time frame (slot distance).

Configuration Parameters

  • validatorNamePattern:
    A pattern to identify validators by name. This parameter is used to select validators for the duty check based on their names.

  • validatorIndex:
    The index of a specific validator to be checked. If this is set, the task focuses on the validator with this index. If it is null, the task does not filter by a specific validator index.

  • minSlotDistance:
    The minimum slot distance from the current slot at which to start checking for the validator's proposer duty. A value of 0 indicates the current slot.

  • maxSlotDistance:
    The maximum number of slots (individual time periods in the blockchain) within which the validator is expected to propose a block. The task succeeds if a matching validator is scheduled for block proposal within this slot distance.

  • failOnCheckMiss:
    This parameter specifies the task's behavior if a matching proposer duty is not found within the maxSlotDistance. If set to false, the task continues running until it either finds a matching proposer duty or reaches its timeout. If true, the task will fail immediately upon not finding a matching duty.

Defaults

These are the default settings for the check_consensus_proposer_duty task:

- name: check_consensus_proposer_duty
  config:
    validatorNamePattern: ""
    validatorIndex: null
    maxSlotDistance: 0
    failOnCheckMiss: false

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "check_consensus_proposer_duty"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Check consensus chain proposer duties.",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	ValidatorNamePattern string  `yaml:"validatorNamePattern" json:"validatorNamePattern"`
	ValidatorIndex       *uint64 `yaml:"validatorIndex" json:"validatorIndex"`
	MinSlotDistance      uint64  `yaml:"minSlotDistance" json:"minSlotDistance"`
	MaxSlotDistance      uint64  `yaml:"maxSlotDistance" json:"maxSlotDistance"`
	FailOnCheckMiss      bool    `yaml:"failOnCheckMiss" json:"failOnCheckMiss"`
}

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) Description

func (t *Task) Description() string

func (*Task) Execute

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

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Logger

func (t *Task) Logger() logrus.FieldLogger

func (*Task) Name

func (t *Task) Name() string

func (*Task) Timeout

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

func (*Task) Title

func (t *Task) Title() string

Jump to

Keyboard shortcuts

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