checkconsensusblockproposals

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README

check_consensus_block_proposals Task

Description

The check_consensus_block_proposals task checks consensus block proposals to make sure they meet certain requirements. It looks at various details of the blocks to confirm they follow the rules or patterns you set.

Configuration Parameters

  • blockCount:
    The number of blocks that need to match your criteria for the task to be successful.

  • graffitiPattern:
    A pattern to match the graffiti on the blocks.

  • validatorNamePattern:
    A pattern to identify blocks by the names of their validators.

  • extraDataPattern:
    A pattern to match the execution layer extra data on the blocks.

  • minAttestationCount:
    The minimum number of attestations (votes or approvals) in a block.

  • minDepositCount:
    The minimum number of deposit actions required in a block.

  • minExitCount:
    The minimum number of exit operations in a block.

  • minSlashingCount:
    The minimum total number of slashing events (penalties for bad actions) in a block.

  • minAttesterSlashingCount:
    The minimum number of attester slashings in a block.

  • minProposerSlashingCount:
    The minimum number of proposer slashings in a block.

  • minBlsChangeCount:
    The minimum number of BLS changes in a block.

  • minWithdrawalCount:
    The minimum number of withdrawal actions in a block.

  • minTransactionCount:
    The minimum total number of transactions (any type) needed in a block.

  • minBlobCount:
    The minimum number of blob sidecars (extra data packets) in a block.

  • expectDeposits:
    A list of validator public keys expected to have deposit operations included in the block.

  • expectExits:
    A list of validator public keys expected to have exit operations included in the block.

  • expectSlashings:
    A list of expected slashing operations in the block, each specified as an object with a publicKey and a slashingType ("attester" or "proposer"). If slashingType is omitted, any type of slashing is accepted.

  • expectBlsChanges:
    A list of expected BLS change operations in the block, each as an object with a publicKey and the target address (optional).

  • expectWithdrawals:
    A list of expected withdrawal operations in the block, each as an object with a publicKey, address, and a minAmount specifying the minimum amount expected for the withdrawal.

Defaults

These are the default settings for the check_consensus_block_proposals task:

- name: check_consensus_block_proposals
  config:
    blockCount: 1
    graffitiPattern: ""
    validatorNamePattern: ""
    extraDataPattern: ""
    minAttestationCount: 0
    minDepositCount: 0
    minExitCount: 0
    minSlashingCount: 0
    minAttesterSlashingCount: 0
    minProposerSlashingCount: 0
    minBlsChangeCount: 0
    minWithdrawalCount: 0
    minTransactionCount: 0
    minBlobCount: 0
    expectDeposits: []
    expectExits: []
    expectSlashings: []
    expectBlsChanges: []
    expectWithdrawals: []

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "check_consensus_block_proposals"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Check for consensus block proposals that meet specific criteria.",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	BlockCount               int    `yaml:"blockCount" json:"blockCount"`
	GraffitiPattern          string `yaml:"graffitiPattern" json:"graffitiPattern"`
	ValidatorNamePattern     string `yaml:"validatorNamePattern" json:"validatorNamePattern"`
	ExtraDataPattern         string `yaml:"extraDataPattern" json:"extraDataPattern"`
	MinAttestationCount      int    `yaml:"minAttestationCount" json:"minAttestationCount"`
	MinDepositCount          int    `yaml:"minDepositCount" json:"minDepositCount"`
	MinExitCount             int    `yaml:"minExitCount" json:"minExitCount"`
	MinSlashingCount         int    `yaml:"minSlashingCount" json:"minSlashingCount"`
	MinAttesterSlashingCount int    `yaml:"minAttesterSlashingCount" json:"minAttesterSlashingCount"`
	MinProposerSlashingCount int    `yaml:"minProposerSlashingCount" json:"minProposerSlashingCount"`
	MinBlsChangeCount        int    `yaml:"minBlsChangeCount" json:"minBlsChangeCount"`
	MinWithdrawalCount       int    `yaml:"minWithdrawalCount" json:"minWithdrawalCount"`
	MinTransactionCount      int    `yaml:"minTransactionCount" json:"minTransactionCount"`
	MinBlobCount             int    `yaml:"minBlobCount" json:"minBlobCount"`

	ExpectDeposits  []string `yaml:"expectDeposits" json:"expectDeposits"`
	ExpectExits     []string `yaml:"expectExits" json:"expectExits"`
	ExpectSlashings []struct {
		PublicKey    string `yaml:"publicKey" json:"publicKey"`
		SlashingType string `yaml:"slashingType" json:"slashingType"`
	} `yaml:"expectSlashings" json:"expectSlashings"`
	ExpectBlsChanges []struct {
		PublicKey string `yaml:"publicKey" json:"publicKey"`
		Address   string `yaml:"address" json:"address"`
	} `yaml:"expectBlsChanges" json:"expectBlsChanges"`
	ExpectWithdrawals []struct {
		PublicKey string   `yaml:"publicKey" json:"publicKey"`
		Address   string   `yaml:"address" json:"address"`
		MinAmount *big.Int `yaml:"minAmount" json:"minAmount"`
	} `yaml:"expectWithdrawals" json:"expectWithdrawals"`
}

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