checkconsensusslotrange

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: 6 Imported by: 0

README

check_consensus_slot_range Task

Description

The check_consensus_slot_range task verifies that the current wall clock time on the consensus chain falls within a specified range of slots and epochs. This is important for ensuring that the chain operates within expected time boundaries.

Configuration Parameters

  • minSlotNumber:
    The minimum slot number that the consensus wall clock should be at or above. This sets the lower bound for the check.

  • maxSlotNumber:
    The maximum slot number that the consensus wall clock should not exceed. This sets the upper bound for the slot range.

  • minEpochNumber:
    The minimum epoch number that the consensus wall clock should be in or above. Similar to the minSlotNumber, this sets a lower limit, but in terms of epochs.

  • maxEpochNumber:
    The maximum epoch number that the consensus wall clock should not go beyond. This parameter sets the upper limit for the epoch range.

  • failIfLower:
    A flag that determines the task's behavior if the current wall clock time is below the specified minimum slot or epoch number. If true, the task will fail in such cases; if false, it will continue without failing.

  • continueOnPass:
    When set to false (default), the task exits immediately upon the slot/epoch being within range. When set to true, the task continues running after success, allowing it to be used for continuous monitoring within concurrent task execution.

Defaults

These are the default settings for the check_consensus_slot_range task:

- name: check_consensus_slot_range
  config:
    minSlotNumber: 0
    maxSlotNumber: 18446744073709551615
    minEpochNumber: 0
    maxEpochNumber: 18446744073709551615
    failIfLower: false
    continueOnPass: false

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "check_consensus_slot_range"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Check if consensus wallclock is in a specific range.",
		Category:    "consensus",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "genesisTime",
				Type:        "int64",
				Description: "The genesis timestamp in Unix seconds.",
			},
			{
				Name:        "currentSlot",
				Type:        "uint64",
				Description: "The current wallclock slot number.",
			},
			{
				Name:        "currentEpoch",
				Type:        "uint64",
				Description: "The current wallclock epoch number.",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	MinSlotNumber  uint64 `yaml:"minSlotNumber" json:"minSlotNumber" desc:"Minimum slot number required to pass the check."`
	MaxSlotNumber  uint64 `yaml:"maxSlotNumber" json:"maxSlotNumber" desc:"Maximum slot number allowed to pass the check."`
	MinEpochNumber uint64 `yaml:"minEpochNumber" json:"minEpochNumber" desc:"Minimum epoch number required to pass the check."`
	MaxEpochNumber uint64 `yaml:"maxEpochNumber" json:"maxEpochNumber" desc:"Maximum epoch number allowed to pass the check."`
	FailIfLower    bool   `yaml:"failIfLower" json:"failIfLower" desc:"If true, fail immediately when slot/epoch is below minimum instead of waiting."`
	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