generateconsolidations

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

README

generate_consolidations Task

Description

The generate_consolidations task is designed to create and send consolidation transactions to the Ethereum network. Consolidations are specialized transactions used for consolidating multiple validator balances into a single validator, optimizing the management and operation of validators within the network.

The source validators can be specified in two ways:

  • By providing sourceMnemonic, sourceStartIndex & sourceIndexCount to select the source validators by the pubkeys derived from the mnemonic & key range
  • By providing sourceStartValidatorIndex & sourceIndexCount to select the source validators by their validator index

Configuration Parameters

  • limitPerSlot: Specifies the maximum number of consolidation transactions allowed per slot.

  • limitTotal: Sets the total allowable number of consolidation transactions that the task can generate.

  • limitPending: Defines the maximum number of pending consolidation transactions allowed at any given time.

  • sourceMnemonic: The mnemonic used to derive source validator keys; these validators are getting consolidated into the target validator.

  • sourceStartIndex: The starting index for key derivation from the source mnemonic, identifying the first source validator in the consolidation process.

  • sourceStartValidatorIndex: The exact starting validator index from which to begin consolidation, providing precise control over the selection of source validators.

  • sourceIndexCount: The number of validators to include in the consolidation process from the source mnemonic.

  • targetPublicKey: The public key of the target validator to which all consolidated funds will be transferred.

  • targetValidatorIndex: The index of the target validator to which all consolidated funds will be transferred. (alternative to targetPublicKey)

  • consolidationEpoch: The specific blockchain epoch during which the consolidations are to be executed, aligning the transactions with defined blockchain timings.

  • walletPrivkey: The private key of the wallet initiating the consolidation transactions, necessary for transaction authorization. This wallet must be set as withdrawal address for the source & target validator for successful consolidation.

  • consolidationContract: The address of the contract on the blockchain that handles the consolidation operations.

  • txAmount: The amount of ETH to be sent to the consolidation contract in each transaction (for consolidation fees).

  • txFeeCap: The maximum fee cap for each transaction, controlling the cost associated with the consolidation.

  • txTipCap: The tip cap for each transaction, influencing transaction priority.

  • txGasLimit: The gas limit for each transaction, ensuring transactions are executed within the cost constraints.

  • clientPattern: A regex pattern to select specific clients for sending the transactions, targeting appropriate network nodes.

  • excludeClientPattern: A regex pattern to exclude certain clients from sending transactions, optimizing network interactions.

  • awaitReceipt: When enabled, the task waits for a receipt for each transaction, confirming execution on the network.

  • failOnReject: Determines if the task should fail upon transaction rejection, enhancing error handling.

Defaults

Default settings for the generate_consolidations task:

- name: generate_consolidations
  config:
    limitPerSlot: 0
    limitTotal: 0
    limitPending: 0
    sourceMnemonic: ""
    sourceStartIndex: 0
    sourceStartValidatorIndex: null
    sourceIndexCount: 0
    targetValidatorIndex: null
    targetPublicKey: ""
    consolidationEpoch: null
    walletPrivkey: ""
    consolidationContract: "0x0000BBdDc7CE488642fb579F8B00f3a590007251"
    txAmount: "500000000000000000"
    txFeeCap: "100000000000"
    txTipCap: "1000000000"
    txGasLimit: 100000
    clientPattern: ""
    excludeClientPattern: ""
    awaitReceipt: false
    failOnReject: false
    consolidationTransactionsResultVar: ""
    consolidationReceiptsResultVar: ""

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "generate_consolidations"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Generates consolidations and sends them to the network",
		Config:      DefaultConfig(),
		NewTask:     NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	LimitPerSlot              int      `yaml:"limitPerSlot" json:"limitPerSlot"`
	LimitTotal                int      `yaml:"limitTotal" json:"limitTotal"`
	LimitPending              int      `yaml:"limitPending" json:"limitPending"`
	SourceMnemonic            string   `yaml:"sourceMnemonic" json:"sourceMnemonic"`
	SourceStartIndex          int      `yaml:"sourceStartIndex" json:"sourceStartIndex"`
	SourceStartValidatorIndex *uint64  `yaml:"sourceStartValidatorIndex" json:"sourceStartValidatorIndex"`
	SourceIndexCount          int      `yaml:"sourceIndexCount" json:"sourceIndexCount"`
	TargetPublicKey           string   `yaml:"targetPublicKey" json:"targetPublicKey"`
	TargetValidatorIndex      *uint64  `yaml:"targetValidatorIndex" json:"targetValidatorIndex"`
	ConsolidationEpoch        *uint64  `yaml:"consolidationEpoch" json:"consolidationEpoch"`
	WalletPrivkey             string   `yaml:"walletPrivkey" json:"walletPrivkey"`
	ConsolidationContract     string   `yaml:"consolidationContract" json:"consolidationContract"`
	TxAmount                  *big.Int `yaml:"txAmount" json:"txAmount"`
	TxFeeCap                  *big.Int `yaml:"txFeeCap" json:"txFeeCap"`
	TxTipCap                  *big.Int `yaml:"txTipCap" json:"txTipCap"`
	TxGasLimit                uint64   `yaml:"txGasLimit" json:"txGasLimit"`
	ClientPattern             string   `yaml:"clientPattern" json:"clientPattern"`
	ExcludeClientPattern      string   `yaml:"excludeClientPattern" json:"excludeClientPattern"`
	AwaitReceipt              bool     `yaml:"awaitReceipt" json:"awaitReceipt"`
	FailOnReject              bool     `yaml:"failOnReject" json:"failOnReject"`
}

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