generatewithdrawalrequests

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

README

generate_withdrawal_requests Task

Description

The generate_withdrawal_requests task facilitates the generation and submission of withdrawal requests to the Ethereum network. This task is crucial for simulating the process of withdrawing funds or exiting validators as part of execution layer triggered staking operations.

The source validators can be specified in three ways:

  • By providing sourcePubkey, which is used as static pubkey for all requests
  • 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 withdrawal requests allowed per slot, managing network load and ensuring efficient processing.

  • limitTotal: Sets an upper limit on the total number of withdrawal requests that can be generated by this task.

  • limitPending: Defines the maximum number of pending withdrawal requests allowed at any given time.

  • sourcePubkey: The static pubkey to include in the withdrawal requests.

  • sourceMnemonic: The mnemonic used to derive source validator keys from which withdrawals will be requested.

  • sourceStartIndex: The starting index for key derivation from the source mnemonic.

  • sourceStartValidatorIndex: An alternative to using sourceMnemonic and sourceStartIndex, this directly specifies the starting validator index for withdrawal requests.

  • sourceIndexCount: The number of validators to include in the withdrawal process from the specified starting index.

  • withdrawAmount: The amount in gwei to be withdrawn per request. Setting this to 0 triggers a full exit for the validator.

  • walletPrivkey: The private key of the wallet initiating the withdrawal requests, necessary for transaction authorization.

  • withdrawalContract: The address of the smart contract that handles the withdrawal requests on the blockchain.

  • txAmount, txFeeCap, txTipCap, txGasLimit: Transaction parameters including the amount to be transferred, fee cap, tip cap, and gas limit, which dictate the economic aspects of the withdrawal transactions.

  • clientPattern, excludeClientPattern: Regular expressions for selecting or excluding specific client endpoints for sending the withdrawal requests.

  • awaitReceipt: Specifies whether to wait for a receipt confirmation for each transaction, confirming execution on the network.

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

Outputs

  • transactionHashes: A list of hashes for the transactions that have been sent. This output provides identifiers for tracking the transactions on the blockchain.

  • transactionReceipts: If awaitReceipt is true, this will include the receipts for each transaction, providing details such as success status, gas used, and potentially logs if applicable.

Defaults

Default settings for the generate_withdrawal_requests task:

- name: generate_withdrawal_requests
  config:
    limitPerSlot: 0
    limitTotal: 0
    limitPending: 0
    sourcePubkey: ""
    sourceMnemonic: ""
    sourceStartIndex: 0
    sourceStartValidatorIndex: null
    sourceIndexCount: 0
    withdrawAmount: 0
    walletPrivkey: ""
    withdrawalContract: "0x00000961Ef480Eb55e80D19ad83579A64c007002"
    txAmount: "500000000000000000"
    txFeeCap: "100000000000"
    txTipCap: "1000000000"
    txGasLimit: 200000
    clientPattern: ""
    excludeClientPattern: ""
    awaitReceipt: false
    failOnReject: false

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "generate_withdrawal_requests"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Generates el triggered withdrawal or exit requests and sends them to the network",
		Category:    "validator",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "transactionHashes",
				Type:        "array",
				Description: "Array of el triggered withdrawal or exit transaction hashes.",
			},
			{
				Name:        "transactionReceipts",
				Type:        "array",
				Description: "Array of el triggered withdrawal or exit transaction receipts.",
			},
		},
		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" require:"A.1" desc:"Maximum number of withdrawal requests to generate per slot."`
	LimitTotal                int      `yaml:"limitTotal" json:"limitTotal" require:"A.2" desc:"Total limit on the number of withdrawal requests to generate."`
	LimitPending              int      `yaml:"limitPending" json:"limitPending" desc:"Maximum number of pending withdrawal requests to allow before waiting."`
	SourcePubkey              string   `yaml:"sourcePubkey" json:"sourcePubkey" require:"B.1" desc:"Public key of the validator to withdraw from."`
	SourceMnemonic            string   `yaml:"sourceMnemonic" json:"sourceMnemonic" require:"B.2" desc:"Mnemonic phrase to derive validator keys for withdrawal."`
	SourceStartIndex          int      `` /* 129-byte string literal not displayed */
	SourceStartValidatorIndex *uint64  `` /* 136-byte string literal not displayed */
	SourceIndexCount          int      `yaml:"sourceIndexCount" json:"sourceIndexCount" desc:"Number of validators to generate withdrawal requests for."`
	WithdrawAmount            uint64   `` /* 163-byte string literal not displayed */
	WalletPrivkey             string   `` /* 132-byte string literal not displayed */
	WithdrawalContract        string   `yaml:"withdrawalContract" json:"withdrawalContract" desc:"Address of the withdrawal request contract."`
	TxAmount                  *big.Int `yaml:"txAmount" json:"txAmount" desc:"Amount of ETH to send with the withdrawal request transaction."`
	TxFeeCap                  *big.Int `yaml:"txFeeCap" json:"txFeeCap" desc:"Maximum fee cap (in wei) for withdrawal request transactions."`
	TxTipCap                  *big.Int `yaml:"txTipCap" json:"txTipCap" desc:"Maximum priority tip (in wei) for withdrawal request transactions."`
	TxGasLimit                uint64   `yaml:"txGasLimit" json:"txGasLimit" desc:"Gas limit for withdrawal request transactions."`
	ClientPattern             string   `` /* 127-byte string literal not displayed */
	ExcludeClientPattern      string   `yaml:"excludeClientPattern" json:"excludeClientPattern" desc:"Regex pattern to exclude certain client endpoints."`
	AwaitReceipt              bool     `yaml:"awaitReceipt" json:"awaitReceipt" desc:"Wait for transaction receipts before completing."`
	FailOnReject              bool     `yaml:"failOnReject" json:"failOnReject" desc:"Fail the task if any transaction is rejected."`
}

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