checkconsensusblockproposals

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

README

check_consensus_block_proposals Task

Description

The check_consensus_block_proposals task assesses consensus block proposals against specified criteria to ensure they comply with expected blockchain operations and standards. This task is crucial for validating the integrity and content of blocks proposed on the consensus layer.

Configuration Parameters

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

  • graffitiPattern:
    A regex pattern to match against the graffiti field of the block, allowing for specific textual content verification.

  • validatorNamePattern:
    A regex pattern to select validators by name involved in block proposals.

  • extraDataPattern:
    A regex pattern to validate the extra data field within the block header.

  • minAttestationCount:
    The minimum number of attestations required in the block to satisfy the check.

  • minDepositCount:
    The minimum number of deposit events that must be included in the block.

  • minExitCount:
    The minimum number of validator exits required in the block.

  • minSlashingCount:
    The minimum number of slashing events the block must contain.

  • minAttesterSlashingCount:
    The minimum number of attester slashing operations required in the block.

  • minProposerSlashingCount:
    The minimum number of proposer slashing operations the block must include.

  • minBlsChangeCount:
    The minimum number of BLS key changes needed in the block.

  • minWithdrawalCount:
    The minimum number of withdrawals that must be processed in the block.

  • minTransactionCount:
    The minimum number of transactions (of any type) required in the block.

  • minBlobCount:
    The minimum number of blob sidecars that must be included in the block.

  • minDepositRequestCount:
    The minimum number of deposit request operations needed in the block.

  • minWithdrawalRequestCount:
    The minimum number of withdrawal requests required in the block.

  • minConsolidationRequestCount:
    The minimum number of consolidation requests that the block must include.

  • expectDeposits:
    A list of validator public keys, specifying which validators should have deposit transactions included in the block.

  • expectExits:
    A list of validator public keys indicating which validators should have exit transactions included in the block.

  • expectSlashings:
    A list detailing expected slashing operations in the block, with each entry specifying a public key and a slashing type (attester or proposer). If the slashing type is omitted, any type of slashing is accepted. {publicKey: "0x0000...", slashingType: "attester"|"proposer"}

  • expectBlsChanges:
    Specifies expected BLS key changes in the block, with each object detailing a public key and a new address for the key change. {publicKey: "0x0000...", address: "0x00..."}

  • expectWithdrawals:
    Specifies expected withdrawal operations, including public keys, destination addresses, and minimum/maximum withdrawal amounts. {publicKey: "0x0000...", address: "0x00...", minAmount: 0, maxAmount: 0}

  • expectDepositRequests:
    Specifies expected deposit request operations, each object detailing the public key, withdrawal credentials, and deposit amount. {publicKey:"0x0000...", withdrawalCredentials: "0x0000...", amount: 0}

  • expectWithdrawalRequests:
    Specifies expected withdrawal request operations, each detailing the source address, validator public key, and amount to be withdrawn. {sourceAddress:"0x0000...", validatorPubkey: "0x0000...", amount: 0}

  • expectConsolidationRequests:
    Specifies expected consolidation request operations, each specifying source addresses, source public keys, and target public keys for consolidation. {sourceAddress:"0x0000...", sourcePubkey: "0x0000...", targetPubkey: "0x0000..."}

Defaults

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
    minDepositRequestCount: 0
    minWithdrawalRequestCount: 0
    minConsolidationRequestCount: 0
    expectDeposits: []
    expectExits: []
    expectSlashings: []
    expectBlsChanges: []
    expectWithdrawals: []
    expectDepositRequests: []
    expectWithdrawalRequests: []
    expectConsolidationRequests: []

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.",
		Category:    "consensus",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "matchingBlockRoots",
				Type:        "array",
				Description: "Array of block roots that match the criteria.",
			},
			{
				Name:        "matchingBlockHeaders",
				Type:        "array",
				Description: "Array of block headers that match the criteria.",
			},
			{
				Name:        "matchingBlockBodies",
				Type:        "array",
				Description: "Array of block bodies that match the criteria.",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	CheckLookback                int    `yaml:"checkLookback" json:"checkLookback" desc:"Number of slots to look back when checking for block proposals."`
	BlockCount                   int    `yaml:"blockCount" json:"blockCount" desc:"Number of matching blocks required to pass the check."`
	PayloadTimeout               int    `yaml:"payloadTimeout" json:"payloadTimeout" desc:"Timeout in seconds to wait for execution payload (gloas+). Default: 12"`
	GraffitiPattern              string `yaml:"graffitiPattern" json:"graffitiPattern" desc:"Regex pattern to match block graffiti."`
	ValidatorNamePattern         string `yaml:"validatorNamePattern" json:"validatorNamePattern" desc:"Regex pattern to match validator names."`
	ExtraDataPattern             string `yaml:"extraDataPattern" json:"extraDataPattern" desc:"Regex pattern to match execution payload extra data."`
	MinAttestationCount          int    `yaml:"minAttestationCount" json:"minAttestationCount" desc:"Minimum number of attestations required in the block."`
	MinDepositCount              int    `yaml:"minDepositCount" json:"minDepositCount" desc:"Minimum number of deposits required in the block."`
	MinExitCount                 int    `yaml:"minExitCount" json:"minExitCount" desc:"Minimum number of voluntary exits required in the block."`
	MinSlashingCount             int    `` /* 127-byte string literal not displayed */
	MinAttesterSlashingCount     int    `` /* 130-byte string literal not displayed */
	MinProposerSlashingCount     int    `` /* 130-byte string literal not displayed */
	MinBlsChangeCount            int    `yaml:"minBlsChangeCount" json:"minBlsChangeCount" desc:"Minimum number of BLS to execution changes required in the block."`
	MinWithdrawalCount           int    `yaml:"minWithdrawalCount" json:"minWithdrawalCount" desc:"Minimum number of withdrawals required in the block."`
	MinTransactionCount          int    `yaml:"minTransactionCount" json:"minTransactionCount" desc:"Minimum number of transactions required in the block."`
	MinBlobCount                 int    `yaml:"minBlobCount" json:"minBlobCount" desc:"Minimum number of blob sidecars required in the block."`
	MinDepositRequestCount       int    `yaml:"minDepositRequestCount" json:"minDepositRequestCount" desc:"Minimum number of deposit requests required in the block."`
	MinWithdrawalRequestCount    int    `` /* 133-byte string literal not displayed */
	MinConsolidationRequestCount int    `` /* 142-byte string literal not displayed */

	ExpectDeposits  []string `yaml:"expectDeposits" json:"expectDeposits" desc:"List of validator public keys expected to have deposits in the block."`
	ExpectExits     []string `yaml:"expectExits" json:"expectExits" desc:"List of validator public keys expected to have exits in the block."`
	ExpectSlashings []struct {
		PublicKey    string `yaml:"publicKey" json:"publicKey" desc:"Public key of the slashed validator."`
		SlashingType string `yaml:"slashingType" json:"slashingType" desc:"Type of slashing: 'attester' or 'proposer'."`
	} `yaml:"expectSlashings" json:"expectSlashings" desc:"List of expected slashings in the block."`
	ExpectBlsChanges []struct {
		PublicKey string `yaml:"publicKey" json:"publicKey" desc:"Public key of the validator."`
		Address   string `yaml:"address" json:"address" desc:"Target execution layer address."`
	} `yaml:"expectBlsChanges" json:"expectBlsChanges" desc:"List of expected BLS to execution changes in the block."`
	ExpectWithdrawals []struct {
		PublicKey string   `yaml:"publicKey" json:"publicKey" desc:"Public key of the validator."`
		Address   string   `yaml:"address" json:"address" desc:"Withdrawal address."`
		MinAmount *big.Int `yaml:"minAmount" json:"minAmount" desc:"Minimum withdrawal amount."`
		MaxAmount *big.Int `yaml:"maxAmount" json:"maxAmount" desc:"Maximum withdrawal amount."`
	} `yaml:"expectWithdrawals" json:"expectWithdrawals" desc:"List of expected withdrawals in the block."`
	ExpectDepositRequests []struct {
		PublicKey             string   `yaml:"publicKey" json:"publicKey" desc:"Public key of the validator."`
		WithdrawalCredentials string   `yaml:"withdrawalCredentials" json:"withdrawalCredentials" desc:"Withdrawal credentials."`
		Amount                *big.Int `yaml:"amount" json:"amount" desc:"Deposit amount."`
	} `yaml:"expectDepositRequests" json:"expectDepositRequests" desc:"List of expected deposit requests in the block."`
	ExpectWithdrawalRequests []struct {
		SourceAddress   string   `yaml:"sourceAddress" json:"sourceAddress" desc:"Source address initiating the withdrawal."`
		ValidatorPubkey string   `yaml:"validatorPubkey" json:"validatorPubkey" desc:"Public key of the validator."`
		Amount          *big.Int `yaml:"amount" json:"amount" desc:"Withdrawal amount."`
	} `yaml:"expectWithdrawalRequests" json:"expectWithdrawalRequests" desc:"List of expected withdrawal requests in the block."`
	ExpectConsolidationRequests []struct {
		SourceAddress string `yaml:"sourceAddress" json:"sourceAddress" desc:"Source address initiating the consolidation."`
		SourcePubkey  string `yaml:"sourcePubkey" json:"sourcePubkey" desc:"Public key of the source validator."`
		TargetPubkey  string `yaml:"targetPubkey" json:"targetPubkey" desc:"Public key of the target validator."`
	} `` /* 130-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