checkconsensusfinality

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

README

check_consensus_finality Task

Description

The check_consensus_finality task checks the finality status of the consensus chain. Finality in a blockchain context refers to the point where a block's transactions are considered irreversible.

Task Behavior
  • The task monitors the finality status of the consensus chain.
  • By default, the task returns immediately when the finality criteria are met.
  • Use continueOnPass: true to keep monitoring even after success (useful when running concurrently with other tasks).

Configuration Parameters

  • minUnfinalizedEpochs:
    The minimum number of epochs that are allowed to be not yet finalized. Default: 0.

  • maxUnfinalizedEpochs:
    The maximum number of epochs that can remain unfinalized before the task fails. Default: 0.

  • minFinalizedEpochs:
    The minimum number of epochs that must be finalized for the task to be successful. Default: 0.

  • failOnCheckMiss:
    If set to true, the task will stop with a failure result if the finality status does not meet the criteria specified in the other parameters. If false, the task will not fail immediately and will continue checking. Default: false.

  • continueOnPass:
    If set to true, the task continues monitoring even after the finality criteria are met. This is useful when running concurrently with other tasks where you want to keep checking that finality is maintained. If false (default), the task exits immediately on success.

Defaults

These are the default settings for the check_consensus_finality task:

- name: check_consensus_finality
  config:
    minUnfinalizedEpochs: 0
    maxUnfinalizedEpochs: 0
    minFinalizedEpochs: 0
    failOnCheckMiss: 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_finality"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Check finality status for consensus chain.",
		Category:    "consensus",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "finalizedEpoch",
				Type:        "uint64",
				Description: "The latest finalized epoch number.",
			},
			{
				Name:        "finalizedRoot",
				Type:        "string",
				Description: "The root hash of the finalized checkpoint.",
			},
			{
				Name:        "unfinalizedEpochs",
				Type:        "uint64",
				Description: "Number of epochs since the last finalized checkpoint.",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	MinUnfinalizedEpochs uint64 `` /* 127-byte string literal not displayed */
	MaxUnfinalizedEpochs uint64 `` /* 126-byte string literal not displayed */
	MinFinalizedEpochs   uint64 `yaml:"minFinalizedEpochs" json:"minFinalizedEpochs" desc:"Minimum number of finalized epochs required to pass the check."`
	FailOnCheckMiss      bool   `yaml:"failOnCheckMiss" json:"failOnCheckMiss" desc:"If true, fail the task when the finality check condition is not met."`
	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