checkconsensusforks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 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.

Task Behavior
  • The task monitors for chain forks over a specified number of epochs.
  • By default, the task returns immediately when the fork criteria are met for the minimum number of epochs.
  • Use continueOnPass: true to keep monitoring even after success (useful for detecting late forks).

Configuration Parameters

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

  • 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. Default: 1.

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

  • continueOnPass:
    If set to true, the task continues monitoring for forks even after the criteria are met. This is useful for detecting forks that may occur later in the test. If false (default), the task exits immediately on success.

Defaults

These are the default settings for the check_consensus_forks task:

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

Outputs

  • forks:
    Array of fork info objects containing head slot, root, and clients on each fork.

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.",
		Category:    "consensus",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "forks",
				Type:        "array",
				Description: "Array of fork info objects with head slot, root, and clients.",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	MinCheckEpochCount uint64 `` /* 129-byte string literal not displayed */
	MaxForkDistance    int64  `yaml:"maxForkDistance" json:"maxForkDistance" desc:"Maximum allowed fork distance (depth) in slots."`
	MaxForkCount       uint64 `yaml:"maxForkCount" json:"maxForkCount" desc:"Maximum number of forks allowed during monitoring."`
	ContinueOnPass     bool   `` /* 137-byte string literal not displayed */
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type ForkInfo

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