distribution

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package distribution provides operator set management and table data distribution for EigenLayer multichain operations. This package manages the mapping between operator sets and their corresponding table data and indices in Merkle trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Distribution

type Distribution struct {
	// TableIndices maps operator sets to their index positions in ordered structures
	TableIndices map[OperatorSet]uint64
	// contains filtered or unexported fields
}

Distribution manages the organization and storage of operator set data. It maintains both the ordering of operator sets (for Merkle tree construction) and the associated table data for each operator set.

func NewDistribution

func NewDistribution() *Distribution

NewDistribution creates a new empty Distribution instance. The distribution is initialized with empty maps for both indices and data.

Returns:

  • *Distribution: A new empty distribution instance

func NewDistributionWithOperatorSets

func NewDistributionWithOperatorSets(operatorSets []OperatorSet) *Distribution

NewDistributionWithOperatorSets creates a new Distribution with pre-defined operator sets. The operator sets are assigned indices based on their order in the provided slice.

Parameters:

  • operatorSets: A slice of operator sets to initialize the distribution

Returns:

  • *Distribution: A new distribution instance with the operator sets configured

func (*Distribution) GetOperatorSets

func (d *Distribution) GetOperatorSets() []OperatorSet

GetOperatorSets returns all operator sets in the distribution. This method returns operator sets in arbitrary order, suitable for iteration when order doesn't matter.

Returns:

  • []OperatorSet: A slice of all operator sets in the distribution

func (*Distribution) GetOrderedOperatorSets

func (d *Distribution) GetOrderedOperatorSets() []OperatorSet

GetOrderedOperatorSets returns operator sets in their index order. This method returns operator sets ordered by their assigned indices, which is important for maintaining consistent Merkle tree construction.

Returns:

  • []OperatorSet: A slice of operator sets ordered by their indices

func (*Distribution) GetTableData

func (d *Distribution) GetTableData(opset OperatorSet) ([]byte, bool)

GetTableData retrieves the stored table data for a given operator set.

Parameters:

  • opset: The operator set to retrieve data for

Returns:

  • []byte: The table data bytes for the operator set
  • bool: True if data exists for the operator set, false otherwise

func (*Distribution) GetTableIndex

func (d *Distribution) GetTableIndex(opset OperatorSet) (uint64, bool)

GetTableIndex retrieves the index position for a given operator set. This index is used for Merkle tree construction and proof generation.

Parameters:

  • opset: The operator set to look up

Returns:

  • uint64: The index position of the operator set
  • bool: True if the operator set exists, false otherwise

func (*Distribution) SetOperatorSets

func (d *Distribution) SetOperatorSets(operatorSets []OperatorSet)

SetOperatorSets assigns indices to the provided operator sets. Each operator set is assigned an index based on its position in the slice, which determines its position in Merkle tree structures.

Parameters:

  • operatorSets: A slice of operator sets to assign indices to

func (*Distribution) SetTableData

func (d *Distribution) SetTableData(opset OperatorSet, data []byte) error

SetTableData stores table data for a specific operator set. The operator set must already exist in the distribution before data can be set.

Parameters:

  • opset: The operator set to store data for
  • data: The table data bytes to store

Returns:

  • error: An error if the operator set doesn't exist in the distribution

type OperatorSet

type OperatorSet struct {
	// Id is the unique identifier for the operator set
	Id uint32
	// Avs is the Ethereum address of the Actively Validated Service
	Avs common.Address
}

OperatorSet represents a unique operator set in the EigenLayer ecosystem. It consists of an ID and the address of the associated AVS (Actively Validated Service).

Jump to

Keyboard shortcuts

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