Documentation
¶
Overview ¶
Package operatorTableCalculator provides stake table root calculation functionality for EigenLayer multichain operations. This package handles the calculation of Merkle tree roots from operator set data across multiple chains, integrating with EigenLayer's CrossChainRegistry to fetch active operator reservations.
Index ¶
- type Config
- type CrossChainRegistryCallerInterface
- type MockICrossChainRegistryCaller
- func (_m *MockICrossChainRegistryCaller) CalculateOperatorTableBytes(opts *bind.CallOpts, operatorSet ICrossChainRegistry.OperatorSet) ([]byte, error)
- func (_m *MockICrossChainRegistryCaller) GetActiveGenerationReservationCount(opts *bind.CallOpts) (*big.Int, error)
- func (_m *MockICrossChainRegistryCaller) GetActiveGenerationReservationsByRange(opts *bind.CallOpts, startIndex *big.Int, endIndex *big.Int) ([]ICrossChainRegistry.OperatorSet, error)
- type StakeTableCalculator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrossChainRegistryCallerInterface ¶ added in v0.0.12
type CrossChainRegistryCallerInterface interface {
GetActiveGenerationReservationCount(opts *bind.CallOpts) (*big.Int, error)
GetActiveGenerationReservationsByRange(opts *bind.CallOpts, startIndex *big.Int, endIndex *big.Int) ([]ICrossChainRegistry.OperatorSet, error)
CalculateOperatorTableBytes(opts *bind.CallOpts, operatorSet ICrossChainRegistry.OperatorSet) ([]byte, error)
}
CrossChainRegistryCallerInterface defines the interface for interacting with the CrossChainRegistry contract
type MockICrossChainRegistryCaller ¶ added in v0.0.12
MockICrossChainRegistryCaller is a mock type for the CrossChainRegistryCallerInterface
func NewMockICrossChainRegistryCaller ¶ added in v0.0.12
func NewMockICrossChainRegistryCaller(t interface {
mock.TestingT
Cleanup(func())
}) *MockICrossChainRegistryCaller
NewMockICrossChainRegistryCaller creates a new instance of MockICrossChainRegistryCaller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockICrossChainRegistryCaller) CalculateOperatorTableBytes ¶ added in v0.0.12
func (_m *MockICrossChainRegistryCaller) CalculateOperatorTableBytes(opts *bind.CallOpts, operatorSet ICrossChainRegistry.OperatorSet) ([]byte, error)
CalculateOperatorTableBytes provides a mock function with given fields: opts, operatorSet
func (*MockICrossChainRegistryCaller) GetActiveGenerationReservationCount ¶ added in v0.0.12
func (_m *MockICrossChainRegistryCaller) GetActiveGenerationReservationCount(opts *bind.CallOpts) (*big.Int, error)
GetActiveGenerationReservationCount provides a mock function with given fields: opts
func (*MockICrossChainRegistryCaller) GetActiveGenerationReservationsByRange ¶ added in v0.0.12
func (_m *MockICrossChainRegistryCaller) GetActiveGenerationReservationsByRange(opts *bind.CallOpts, startIndex *big.Int, endIndex *big.Int) ([]ICrossChainRegistry.OperatorSet, error)
GetActiveGenerationReservationsByRange provides a mock function with given fields: opts, startIndex, endIndex
type StakeTableCalculator ¶
type StakeTableCalculator struct {
// contains filtered or unexported fields
}
StakeTableCalculator is responsible for calculating the cloud operator table root.
func NewStakeTableRootCalculator ¶
func NewStakeTableRootCalculator(cfg *Config, ec chainManager.EthClientInterface, l *zap.Logger) (*StakeTableCalculator, error)
NewStakeTableRootCalculator creates a new instance of StakeTableCalculator.
func NewStakeTableRootCalculatorWithRegistryCaller ¶ added in v0.0.12
func NewStakeTableRootCalculatorWithRegistryCaller(cfg *Config, ec chainManager.EthClientInterface, registryCaller CrossChainRegistryCallerInterface, l *zap.Logger) (*StakeTableCalculator, error)
NewStakeTableRootCalculatorWithRegistryCaller creates a new instance of StakeTableCalculator with a pre-bound registry caller.
func (*StakeTableCalculator) CalculateStakeTableRoot ¶
func (c *StakeTableCalculator) CalculateStakeTableRoot( ctx context.Context, referenceBlockNumber uint64, ) ( [32]byte, *merkletree.MerkleTree, *distribution.Distribution, error, )
CalculateStakeTableRoot performs the complete calculation for a given reference block.