chainio

package
v0.0.0-...-14be240 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvsManagersBindings

type AvsManagersBindings struct {
	TaskManager    *txtaskmanager.ContractTriggerXTaskManager
	ServiceManager *txservicemanager.ContractTriggerXServiceManager
	// contains filtered or unexported fields
}

func NewAvsManagersBindings

func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr common.Address, ethclient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsManagersBindings, error)

func (*AvsManagersBindings) GetErc20Mock

func (b *AvsManagersBindings) GetErc20Mock(tokenAddr common.Address) (*erc20mock.ContractERC20Mock, error)

type AvsReader

type AvsReader struct {
	sdkavsregistry.ChainReader
	AvsServiceBindings *AvsManagersBindings
	// contains filtered or unexported fields
}

func BuildAvsReader

func BuildAvsReader(serviceManagerAddr, operatorStateRetrieverAddr common.Address, ethHttpClient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsReader, error)

func BuildAvsReaderFromConfig

func BuildAvsReaderFromConfig(c *config.Config) (*AvsReader, error)

func NewAvsReader

func NewAvsReader(avsRegistryReader sdkavsregistry.ChainReader, avsServiceBindings *AvsManagersBindings, logger logging.Logger) (*AvsReader, error)

func (*AvsReader) CheckSignatures

func (r *AvsReader) CheckSignatures(
	ctx context.Context, msgHash [32]byte, quorumNumbers []byte, referenceBlockNumber uint32, nonSignerStakesAndSignature txtaskmanager.IBLSSignatureCheckerNonSignerStakesAndSignature,
) (txtaskmanager.IBLSSignatureCheckerQuorumStakeTotals, error)

func (*AvsReader) GenerateTaskId

func (r *AvsReader) GenerateTaskId(jobId uint32, taskNum uint32) ([8]byte, error)

func (*AvsReader) GetErc20Mock

func (r *AvsReader) GetErc20Mock(ctx context.Context, tokenAddr common.Address) (*erc20mock.ContractERC20Mock, error)

func (*AvsReader) GetJobToTaskCounter

func (r *AvsReader) GetJobToTaskCounter(ctx context.Context, jobId uint32) (uint32, error)

func (*AvsReader) GetQuorumManager

func (r *AvsReader) GetQuorumManager(ctx context.Context) (common.Address, error)

func (*AvsReader) GetTaskHash

func (r *AvsReader) GetTaskHash(ctx context.Context, taskId [8]byte) ([32]byte, error)

func (*AvsReader) GetTaskManager

func (r *AvsReader) GetTaskManager(ctx context.Context) (common.Address, error)

func (*AvsReader) GetTaskResponseHash

func (r *AvsReader) GetTaskResponseHash(ctx context.Context, taskId [8]byte) ([32]byte, error)

func (*AvsReader) GetTaskValidator

func (r *AvsReader) GetTaskValidator(ctx context.Context) (common.Address, error)

func (*AvsReader) IsOperatorBlacklisted

func (r *AvsReader) IsOperatorBlacklisted(ctx context.Context, operator common.Address) (bool, error)

type AvsReaderer

type AvsReaderer interface {
	// TriggerXTaskManager methods
	GetTaskHash(ctx context.Context, taskId [8]byte) ([32]byte, error)
	GetTaskResponseHash(ctx context.Context, taskId [8]byte) ([32]byte, error)
	GetJobToTaskCounter(ctx context.Context, jobId uint32) (uint32, error)
	GenerateTaskId(jobId uint32, taskNum uint32) ([8]byte, error)

	// TriggerXServiceManager methods
	IsOperatorBlacklisted(ctx context.Context, operator common.Address) (bool, error)
	GetTaskManager(ctx context.Context) (common.Address, error)
	GetTaskValidator(ctx context.Context) (common.Address, error)
	GetQuorumManager(ctx context.Context) (common.Address, error)

	// Existing methods
	CheckSignatures(
		ctx context.Context, msgHash [32]byte, quorumNumbers []byte, referenceBlockNumber uint32, nonSignerStakesAndSignature txtaskmanager.IBLSSignatureCheckerNonSignerStakesAndSignature,
	) (txtaskmanager.IBLSSignatureCheckerQuorumStakeTotals, error)
	GetErc20Mock(ctx context.Context, tokenAddr common.Address) (*erc20mock.ContractERC20Mock, error)
	GetOperatorId(opts *bind.CallOpts, operatorAddress common.Address) ([32]byte, error)
	IsOperatorRegistered(opts *bind.CallOpts, operatorAddress common.Address) (bool, error)
}

type AvsSubscriber

type AvsSubscriber struct {
	AvsContractBindings *AvsManagersBindings
	// contains filtered or unexported fields
}

func BuildAvsSubscriber

func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient sdkcommon.EthClientInterface, logger sdklogging.Logger) (*AvsSubscriber, error)

func BuildAvsSubscriberFromConfig

func BuildAvsSubscriberFromConfig(config *config.Config) (*AvsSubscriber, error)

func NewAvsSubscriber

func NewAvsSubscriber(avsContractBindings *AvsManagersBindings, logger sdklogging.Logger) *AvsSubscriber

func (*AvsSubscriber) ParseKeeperDeregistered

func (*AvsSubscriber) ParseKeeperRegistered

func (*AvsSubscriber) ParseTaskCreated

func (*AvsSubscriber) ParseTaskResponded

func (*AvsSubscriber) SubscribeToKeeperDeregistered

func (s *AvsSubscriber) SubscribeToKeeperDeregistered(keeperDeregisteredChan chan *txservicemanager.ContractTriggerXServiceManagerKeeperRemoved) event.Subscription

func (*AvsSubscriber) SubscribeToKeeperRegistered

func (s *AvsSubscriber) SubscribeToKeeperRegistered(keeperRegisteredChan chan *txservicemanager.ContractTriggerXServiceManagerKeeperAdded) event.Subscription

func (*AvsSubscriber) SubscribeToNewTasks

func (s *AvsSubscriber) SubscribeToNewTasks(newTaskCreatedChan chan *txtaskmanager.ContractTriggerXTaskManagerTaskCreated) event.Subscription

func (*AvsSubscriber) SubscribeToTaskResponses

func (s *AvsSubscriber) SubscribeToTaskResponses(taskResponseChan chan *txtaskmanager.ContractTriggerXTaskManagerTaskResponded) event.Subscription

type AvsSubscriberer

type AvsSubscriberer interface {
	SubscribeToNewTasks(newTaskCreatedChan chan *txtaskmanager.ContractTriggerXTaskManagerTaskCreated) event.Subscription
	SubscribeToTaskResponses(taskResponseLogs chan *txtaskmanager.ContractTriggerXTaskManagerTaskResponded) event.Subscription
	SubscribeToKeeperRegistered(keeperRegisteredChan chan *txservicemanager.ContractTriggerXServiceManagerKeeperAdded) event.Subscription
	SubscribeToKeeperDeregistered(keeperDeregisteredChan chan *txservicemanager.ContractTriggerXServiceManagerKeeperRemoved) event.Subscription

	ParseTaskResponded(rawLog types.Log) (*txtaskmanager.ContractTriggerXTaskManagerTaskResponded, error)
	ParseTaskCreated(rawLog types.Log) (*txtaskmanager.ContractTriggerXTaskManagerTaskCreated, error)
	ParseKeeperRegistered(rawLog types.Log) (*txservicemanager.ContractTriggerXServiceManagerKeeperAdded, error)
	ParseKeeperDeregistered(rawLog types.Log) (*txservicemanager.ContractTriggerXServiceManagerKeeperRemoved, error)
}

type AvsWriter

type AvsWriter struct {
	avsregistry.ChainWriter
	AvsContractBindings *AvsManagersBindings

	TxMgr txmgr.TxManager
	// contains filtered or unexported fields
}

func BuildAvsWriter

func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr common.Address, ethHttpClient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsWriter, error)

func BuildAvsWriterFromConfig

func BuildAvsWriterFromConfig(c *config.Config) (*AvsWriter, error)

func NewAvsWriter

func NewAvsWriter(avsRegistryWriter avsregistry.ChainWriter, avsServiceBindings *AvsManagersBindings, logger logging.Logger, txMgr txmgr.TxManager) *AvsWriter

func (*AvsWriter) CreateNewTask

func (w *AvsWriter) CreateNewTask(
	ctx context.Context,
	jobId uint32,
	quorumNumbers []byte,
	quorumThreshold uint8,
) ([8]byte, error)

func (*AvsWriter) DeregisterOperatorFromAVS

func (w *AvsWriter) DeregisterOperatorFromAVS(
	ctx context.Context,
	operatorAddr common.Address,
) (*types.Receipt, error)

func (*AvsWriter) GetTxMgr

func (w *AvsWriter) GetTxMgr() txmgr.TxManager

func (*AvsWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator

func (w *AvsWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator(
	ctx context.Context,
	operatorEcdsaKeyPair *ecdsa.PrivateKey,
	registrationSigSalt [32]byte,
	registrationSigExpiry *big.Int,
	blsKeyPair *bls.KeyPair,
	quorumNumbers eigenSdkTypes.QuorumNums,
	socket string,
	shouldWaitForConfirmation bool,
) (*types.Receipt, error)

type AvsWriterer

type AvsWriterer interface {
	// Task Management
	CreateNewTask(
		ctx context.Context,
		jobId uint32,
		quorumNumbers []byte,
		quorumThreshold uint8,
	) ([8]byte, error)

	RespondToTask(
		ctx context.Context,
		task txtaskmanager.ITriggerXTaskManagerTask,
		taskResponse txtaskmanager.ITriggerXTaskManagerTaskResponse,
		nonSignerStakesAndSignature txtaskmanager.IBLSSignatureCheckerNonSignerStakesAndSignature,
	) (*types.Receipt, error)

	// Operator Management
	RegisterOperatorInQuorumWithAVSRegistryCoordinator(
		ctx context.Context,
		operatorEcdsaKeyPair *ecdsa.PrivateKey,
		registrationSigSalt [32]byte,
		registrationSigExpiry *big.Int,
		blsKeyPair *bls.KeyPair,
		quorumNumbers eigenSdkTypes.QuorumNums,
		socket string,
		shouldWaitForConfirmation bool,
	) (*types.Receipt, error)

	DeregisterOperatorFromAVS(
		ctx context.Context,
		operatorAddr common.Address,
	) (*types.Receipt, error)

	// Utility
	GetTxMgr() txmgr.TxManager
}

type SignatureWithSaltAndExpiry

type SignatureWithSaltAndExpiry struct {
	Signature []byte
	Salt      [32]byte
	Expiry    *big.Int
}

Jump to

Keyboard shortcuts

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