generatewithdrawalrequests

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 23 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: 0x09Fc772D0857550724b07B850a4323f39112aAaA
    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 withdrawal requests 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"`
	SourcePubkey              string   `yaml:"sourcePubkey" json:"sourcePubkey"`
	SourceMnemonic            string   `yaml:"sourceMnemonic" json:"sourceMnemonic"`
	SourceStartIndex          int      `yaml:"sourceStartIndex" json:"sourceStartIndex"`
	SourceStartValidatorIndex *uint64  `yaml:"sourceStartValidatorIndex" json:"sourceStartValidatorIndex"`
	SourceIndexCount          int      `yaml:"sourceIndexCount" json:"sourceIndexCount"`
	WithdrawAmount            uint64   `yaml:"withdrawAmount" json:"withdrawAmount"`
	WalletPrivkey             string   `yaml:"walletPrivkey" json:"walletPrivkey"`
	WithdrawalContract        string   `yaml:"withdrawalContract" json:"withdrawalContract"`
	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