checkconsensussyncstatus

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

README

check_consensus_sync_status Task

Description

The check_consensus_sync_status task checks the synchronization status of consensus clients, ensuring they are aligned with the current state of the blockchain network.

Task Behavior
  • The task polls consensus clients at regular intervals to check their sync status.
  • By default, the task returns immediately when the sync criteria are met.
  • Use continueOnPass: true to keep monitoring even after success.

Configuration Parameters

  • clientPattern:
    A regular expression pattern used to specify which clients to check. This allows for targeted health checks of specific clients or groups of clients within the network. A blank pattern targets all clients.

  • pollInterval:
    The frequency for checking the clients' sync status. Default: 5s.

  • expectSyncing:
    Set to true if the clients are expected to be in a syncing state, or false if they should be fully synced. Default: false.

  • expectOptimistic:
    When true, expects clients to be in an optimistic sync state. Default: false.

  • expectMinPercent:
    The minimum sync progress percentage required for the task to succeed. Default: 100.

  • expectMaxPercent:
    The maximum sync progress percentage allowable for the task to succeed. Default: 100.

  • minSlotHeight:
    The minimum slot height that clients should be synced to. Default: 10.

  • waitForChainProgression:
    If set to true, the task checks for blockchain progression in addition to synchronization status. If false, the task solely checks for synchronization status, without waiting for further chain progression. Default: false.

  • continueOnPass:
    If set to true, the task continues monitoring sync status even after the criteria are met. This is useful when running concurrently with other tasks. If false (default), the task exits immediately on success.

Defaults

Default settings for the check_consensus_sync_status task:

- name: check_consensus_sync_status
  config:
    clientPattern: ""
    pollInterval: 5s
    expectSyncing: false
    expectOptimistic: false
    expectMinPercent: 100
    expectMaxPercent: 100
    minSlotHeight: 10
    waitForChainProgression: false
    continueOnPass: false

Outputs

This task does not produce any outputs.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "check_consensus_sync_status"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Checks consensus clients for their sync status.",
		Category:    "consensus",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "goodClients",
				Type:        "array",
				Description: "Array of clients that meet sync criteria.",
			},
			{
				Name:        "failedClients",
				Type:        "array",
				Description: "Array of clients that do not meet sync criteria.",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

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

Types

type ClientInfo

type ClientInfo struct {
	Name          string `json:"name"`
	Optimistic    bool   `json:"optimistic"`
	Synchronizing bool   `json:"synchronizing"`
	SyncHead      uint64 `json:"syncHead"`
	SyncDistance  uint64 `json:"syncDistance"`
}

type Config

type Config struct {
	ClientPattern           string          `yaml:"clientPattern" json:"clientPattern" desc:"Regex pattern to select specific client endpoints for sync status checking."`
	PollInterval            helper.Duration `yaml:"pollInterval" json:"pollInterval" desc:"Interval between sync status polls (e.g., '5s', '1m')."`
	ExpectSyncing           bool            `yaml:"expectSyncing" json:"expectSyncing" desc:"If true, expect clients to be syncing."`
	ExpectOptimistic        bool            `yaml:"expectOptimistic" json:"expectOptimistic" desc:"If true, expect clients to be in optimistic mode."`
	ExpectMinPercent        float64         `yaml:"expectMinPercent" json:"expectMinPercent" desc:"Minimum percentage of clients expected to match the sync condition."`
	ExpectMaxPercent        float64         `yaml:"expectMaxPercent" json:"expectMaxPercent" desc:"Maximum percentage of clients expected to match the sync condition."`
	MinSlotHeight           int             `yaml:"minSlotHeight" json:"minSlotHeight" desc:"Minimum slot height required before checking sync status."`
	WaitForChainProgression bool            `yaml:"waitForChainProgression" json:"waitForChainProgression" desc:"If true, wait for the chain to progress before checking."`
	ContinueOnPass          bool            `` /* 137-byte string literal not displayed */
}

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