checkconsensusforks

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

README

check_consensus_forks Task

Description

The check_consensus_forks task is designed to check for forks in the consensus layer of the blockchain. Forks occur when there are divergences in the blockchain, leading to two or more competing chains.

Configuration Parameters

  • minCheckEpochCount:
    The minimum number of epochs to check for forks.

  • maxForkDistance:
    The maximum distance allowed before a divergence in the chain is counted as a fork.
    The distance is measured by the number of blocks between the heads of the forked chains.

  • maxForkCount:
    The maximum number of forks that are acceptable. If the number of forks exceeds this limit, the task will coplete with a failure result.

Defaults

These are the default settings for the check_consensus_forks task:

- name: check_consensus_forks
  config:
    minCheckEpochCount: 1
    maxForkDistance: 1
    maxForkCount: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "check_consensus_forks"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Check for consensus layer forks.",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	MinCheckEpochCount uint64 `yaml:"minCheckEpochCount" json:"minCheckEpochCount"`
	MaxForkDistance    uint64 `yaml:"maxForkDistance" json:"maxForkDistance"`
	MaxForkCount       uint64 `yaml:"maxForkCount" json:"maxForkCount"`
}

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