generatebatchdeposits

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: GPL-3.0 Imports: 29 Imported by: 0

README

generate_batch_deposits Task

Description

The generate_batch_deposits task spams the chain with valid, unique validator deposits by routing them through a small forwarder contract (BatchDeposit). Every deposit carries a freshly-derived BLS keypair and a fully-valid signature, which forces the consensus layer through the worst-case per-deposit signature verification path.

If batchContract is empty the task deploys a fresh forwarder bound to the configured deposit contract before generation starts and exposes its address via task outputs.

Use Cases

  • Stress-test consensus client deposit signature verification.
  • Fill the deposit/pending queue at maximum throughput against a devnet.
  • Reproduce edge cases where many deposits land in a single block.

Configuration Parameters

  • limitPerSlot: Maximum number of deposits to generate per slot. Counted in deposits, not in batches.
  • limitTotal: Total deposits to generate.
  • limitPendingBatches: Maximum number of in-flight batch transactions.
  • mnemonic: Mnemonic phrase used to derive validator keys.
  • startIndex: Index within the mnemonic at which to start key derivation.
  • indexCount: Maximum number of validator keys to derive (an alternative cap to limitTotal).
  • walletPrivkey: Private key of the wallet used to send the batch transactions and (if needed) deploy the contract.
  • depositContract: Address of the beacon chain deposit contract.
  • batchContract: Optional address of an already-deployed BatchDeposit forwarder. If empty, the task deploys one on start.
  • batchSize: Number of deposits per batched transaction. Default 100.
  • batchTxGasLimit: Gas limit per batched transaction. Default 12_000_000.
  • depositAmount: ETH amount per deposit. Default 32 ETH.
  • depositTxFeeCap / depositTxTipCap: Fee/tip caps (wei) for batch transactions.
  • withdrawalCredentials: Required 32-byte withdrawal credentials shared by every deposit in every batch (e.g. 0x03 + 11 zero bytes + 20-byte address for builder credentials).
  • clientPattern / excludeClientPattern: Client selection regexes.
  • awaitReceipt: Wait for every batch transaction receipt before completing.
  • failOnReject: Fail the task if any batch transaction is rejected or reverted.
  • awaitInclusion: Wait for every individual deposit to appear in a beacon block before completing.
  • invalidSigPercent: Random percentage (0-100) of deposits to generate with corrupted signatures. Default 0.

Outputs

  • batchContract: Address of the forwarder contract used (or deployed by) this task.
  • validatorPubkeys: All derived validator pubkeys, in the order they were submitted.
  • batchTransactions: Hashes of the submitted batch transactions.
  • batchReceipts: Receipts for the batch transactions (when awaitReceipt is enabled).
  • includedDeposits: Number of deposits confirmed on the beacon chain (when awaitInclusion is enabled).

Defaults

- name: generate_batch_deposits
  config:
    limitPerSlot: 0
    limitTotal: 0
    limitPendingBatches: 0
    mnemonic: ""
    startIndex: 0
    indexCount: 0
    walletPrivkey: ""
    depositContract: ""
    batchContract: ""
    batchSize: 100
    batchTxGasLimit: 12000000
    depositAmount: 32
    depositTxFeeCap: 100000000000
    depositTxTipCap: 1000000000
    withdrawalCredentials: ""
    clientPattern: ""
    excludeClientPattern: ""
    awaitReceipt: false
    failOnReject: false
    awaitInclusion: false
    invalidSigPercent: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "generate_batch_deposits"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Generates valid unique deposits and forwards them through a BatchDeposit contract in batchSize-sized transactions. Optionally deploys the contract first.",
		Category:    "validator",
		Config:      DefaultConfig(),
		Outputs: []types.TaskOutputDefinition{
			{
				Name:        "batchContract",
				Type:        outputTypeString,
				Description: "Address of the BatchDeposit forwarder contract used (deployed by this task if batchContract was empty).",
			},
			{
				Name:        "validatorPubkeys",
				Type:        outputTypeArray,
				Description: "Array of validator public keys for all generated deposits.",
			},
			{
				Name:        "batchTransactions",
				Type:        outputTypeArray,
				Description: "Array of batch transaction hashes (one per submitted batch).",
			},
			{
				Name:        "batchReceipts",
				Type:        outputTypeArray,
				Description: "Array of batch transaction receipts (when awaitReceipt is enabled).",
			},
			{
				Name:        "includedDeposits",
				Type:        outputTypeNumber,
				Description: "Number of deposits included on beacon chain (when awaitInclusion is enabled).",
			},
		},
		NewTask: NewTask,
	}
)

Functions

func NewTask

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

Types

type Config

type Config struct {
	LimitPerSlot          int    `` /* 143-byte string literal not displayed */
	LimitTotal            int    `yaml:"limitTotal" json:"limitTotal" require:"A.2" desc:"Total limit on the number of deposits to generate."`
	LimitPendingBatches   int    `` /* 130-byte string literal not displayed */
	Mnemonic              string `yaml:"mnemonic" json:"mnemonic" require:"B" desc:"Mnemonic phrase used to generate validator keys."`
	StartIndex            int    `yaml:"startIndex" json:"startIndex" desc:"Index within the mnemonic from which to start generating validator keys."`
	IndexCount            int    `yaml:"indexCount" json:"indexCount" require:"A.3" desc:"Number of validator keys to generate from the mnemonic."`
	WalletPrivkey         string `` /* 163-byte string literal not displayed */
	DepositContract       string `` /* 133-byte string literal not displayed */
	BatchContract         string `` /* 166-byte string literal not displayed */
	BatchSize             int    `yaml:"batchSize" json:"batchSize" desc:"Number of deposits to bundle into a single transaction. Default 100."`
	BatchTxGasLimit       uint64 `yaml:"batchTxGasLimit" json:"batchTxGasLimit" desc:"Gas limit for each batched deposit transaction. Default 12,000,000."`
	DepositAmount         uint64 `yaml:"depositAmount" json:"depositAmount" desc:"Amount of ETH to deposit per validator. Default 32 ETH."`
	DepositTxFeeCap       int64  `yaml:"depositTxFeeCap" json:"depositTxFeeCap" desc:"Maximum fee cap (in wei) for batch transactions."`
	DepositTxTipCap       int64  `yaml:"depositTxTipCap" json:"depositTxTipCap" desc:"Maximum priority tip (in wei) for batch transactions."`
	WithdrawalCredentials string `` /* 221-byte string literal not displayed */
	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 batch transaction receipts on the execution layer before completing."`
	FailOnReject          bool   `yaml:"failOnReject" json:"failOnReject" desc:"Fail the task if any batch transaction is rejected."`
	AwaitInclusion        bool   `` /* 133-byte string literal not displayed */
	InvalidSigPercent     int    `` /* 133-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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL