checkconsensusforks

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 6 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 ForkInfo added in v0.0.10

type ForkInfo struct {
	HeadSlot uint64   `json:"headSlot"`
	HeadRoot string   `json:"headRoot"`
	Clients  []string `json:"clients"`
}

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