chainio

package
v0.0.0-...-ded9150 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildElReader

func BuildElReader(
	registryCoordinatorAddress common.Address,
	operatorStateRetrieverAddress common.Address,
	ethHttpClient eth.Client,
	logger logging.Logger,
) (*elcontracts.ELChainReader, error)

func BuildElWriter

func BuildElWriter(
	registryCoordinatorAddress common.Address,
	operatorStateRetrieverAddress common.Address,
	txMgr *txmgr.SimpleTxManager,
	ethHttpClient eth.Client,
	logger logging.Logger,
) (*elcontracts.ELChainWriter, error)

Types

type AvsManagersBindings

type AvsManagersBindings struct {
	RegistryCoordinator       *regcoord.ContractRegistryCoordinator
	SFFLRegistryCoordinator   *sfflregcoord.ContractSFFLRegistryCoordinator
	OperatorSetUpdateRegistry *opsetupdatereg.ContractSFFLOperatorSetUpdateRegistry
	TaskManager               *taskmanager.ContractSFFLTaskManager
	ServiceManager            *csservicemanager.ContractSFFLServiceManager
	BlsApkRegistry            blsapkreg.ContractBLSApkRegistryFilters
	// contains filtered or unexported fields
}

func NewAvsManagersBindings

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

func (*AvsManagersBindings) GetErc20Mock

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

type AvsReader

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

func BuildAvsReader

func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.Client, logger logging.Logger) (*AvsReader, error)

func BuildAvsReaderFromConfig

func BuildAvsReaderFromConfig(config *config.Config, client eth.Client, logger logging.Logger) (*AvsReader, error)

func NewAvsReader

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

func (*AvsReader) CheckSignatures

func (r *AvsReader) CheckSignatures(
	ctx context.Context, quorumNumbers []byte, aggregation messages.MessageBlsAggregation,
) (taskmanager.IBLSSignatureCheckerQuorumStakeTotals, error)

func (*AvsReader) GetErc20Mock

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

func (*AvsReader) GetLastCheckpointToTimestamp

func (r *AvsReader) GetLastCheckpointToTimestamp(ctx context.Context) (uint64, error)

func (*AvsReader) GetNextOperatorSetUpdateId

func (r *AvsReader) GetNextOperatorSetUpdateId(ctx context.Context) (uint64, error)

func (*AvsReader) GetOperatorSetById

func (r *AvsReader) GetOperatorSetById(ctx context.Context, id uint64) ([]opsetupdatereg.RollupOperatorsOperator, error)

func (*AvsReader) GetOperatorSetUpdateBlock

func (r *AvsReader) GetOperatorSetUpdateBlock(ctx context.Context, id uint64) (uint32, error)

func (*AvsReader) GetOperatorSetUpdateDelta

func (r *AvsReader) GetOperatorSetUpdateDelta(ctx context.Context, id uint64) ([]opsetupdatereg.RollupOperatorsOperator, error)

type AvsReaderer

type AvsReaderer interface {
	sdkavsregistry.AvsRegistryReader

	CheckSignatures(
		ctx context.Context, quorumNumbers []byte, aggregation messages.MessageBlsAggregation,
	) (taskmanager.IBLSSignatureCheckerQuorumStakeTotals, error)
	GetErc20Mock(ctx context.Context, tokenAddr gethcommon.Address) (*erc20mock.ContractERC20Mock, error)
	GetOperatorSetUpdateDelta(ctx context.Context, id uint64) ([]opsetupdatereg.RollupOperatorsOperator, error)
	GetOperatorSetById(ctx context.Context, id uint64) ([]opsetupdatereg.RollupOperatorsOperator, error)
	GetOperatorSetUpdateBlock(ctx context.Context, id uint64) (uint32, error)
	GetNextOperatorSetUpdateId(ctx context.Context) (uint64, error)
	GetLastCheckpointToTimestamp(ctx context.Context) (uint64, error)
}

type AvsSubscriber

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

Subscribers use a ws connection instead of http connection like Readers kind of stupid that the geth client doesn't have a unified interface for both... it takes a single url, so the bindings, even though they have watcher functions, those can't be used with the http connection... seems very very stupid. Am I missing something?

func BuildAvsSubscriber

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

func NewAvsSubscriber

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

func (*AvsSubscriber) ParseCheckpointTaskResponded

func (s *AvsSubscriber) ParseCheckpointTaskResponded(rawLog types.Log) (*taskmanager.ContractSFFLTaskManagerCheckpointTaskResponded, error)

func (*AvsSubscriber) SubscribeToNewTasks

func (s *AvsSubscriber) SubscribeToNewTasks(checkpointTaskCreatedChan chan *taskmanager.ContractSFFLTaskManagerCheckpointTaskCreated) (event.Subscription, error)

func (*AvsSubscriber) SubscribeToOperatorSetUpdates

func (s *AvsSubscriber) SubscribeToOperatorSetUpdates(operatorSetUpdateChan chan *opsetupdatereg.ContractSFFLOperatorSetUpdateRegistryOperatorSetUpdatedAtBlock) (event.Subscription, error)

func (*AvsSubscriber) SubscribeToTaskResponses

func (s *AvsSubscriber) SubscribeToTaskResponses(taskResponseChan chan *taskmanager.ContractSFFLTaskManagerCheckpointTaskResponded) (event.Subscription, error)

type AvsSubscriberer

type AvsSubscriberer interface {
	avsregistry.AvsRegistrySubscriber
	SubscribeToNewTasks(checkpointTaskCreatedChan chan *taskmanager.ContractSFFLTaskManagerCheckpointTaskCreated) (event.Subscription, error)
	SubscribeToTaskResponses(taskResponseLogs chan *taskmanager.ContractSFFLTaskManagerCheckpointTaskResponded) (event.Subscription, error)
	SubscribeToOperatorSetUpdates(operatorSetUpdateChan chan *opsetupdatereg.ContractSFFLOperatorSetUpdateRegistryOperatorSetUpdatedAtBlock) (event.Subscription, error)
	ParseCheckpointTaskResponded(rawLog types.Log) (*taskmanager.ContractSFFLTaskManagerCheckpointTaskResponded, error)
}

type AvsWriter

type AvsWriter struct {
	avsregistry.AvsRegistryWriter
	AvsContractBindings *AvsManagersBindings

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

func BuildAvsWriter

func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.Client, logger logging.Logger) (*AvsWriter, error)

func BuildAvsWriterFromConfig

func BuildAvsWriterFromConfig(txMgr txmgr.TxManager, config *config.Config, client eth.Client, logger logging.Logger) (*AvsWriter, error)

func NewAvsWriter

func NewAvsWriter(avsRegistryWriter avsregistry.AvsRegistryWriter, avsServiceBindings *AvsManagersBindings, client eth.Client, logger logging.Logger, txMgr txmgr.TxManager) *AvsWriter

func (*AvsWriter) RaiseChallenge

func (w *AvsWriter) RaiseChallenge(
	ctx context.Context,
	task taskmanager.CheckpointTask,
	taskResponse messages.CheckpointTaskResponse,
	taskResponseMetadata taskmanager.CheckpointTaskResponseMetadata,
	pubkeysOfNonSigningOperators []taskmanager.BN254G1Point,
) (*types.Receipt, error)

func (*AvsWriter) SendAggregatedResponse

func (w *AvsWriter) SendAggregatedResponse(
	ctx context.Context, task taskmanager.CheckpointTask,
	taskResponse messages.CheckpointTaskResponse,
	aggregation messages.MessageBlsAggregation,
) (*types.Receipt, error)

func (*AvsWriter) SendNewCheckpointTask

func (w *AvsWriter) SendNewCheckpointTask(ctx context.Context, fromTimestamp uint64, toTimestamp uint64, quorumThreshold eigentypes.QuorumThresholdPercentage, quorumNumbers eigentypes.QuorumNums) (taskmanager.CheckpointTask, uint32, error)

returns the tx receipt, as well as the task index (which it gets from parsing the tx receipt logs)

type AvsWriterer

type AvsWriterer interface {
	avsregistry.AvsRegistryWriter

	SendNewCheckpointTask(
		ctx context.Context,
		fromTimestamp uint64,
		toTimestamp uint64,
		quorumThreshold eigentypes.QuorumThresholdPercentage,
		quorumNumbers eigentypes.QuorumNums,
	) (taskmanager.CheckpointTask, uint32, error)
	RaiseChallenge(
		ctx context.Context,
		task taskmanager.CheckpointTask,
		taskResponse messages.CheckpointTaskResponse,
		taskResponseMetadata taskmanager.CheckpointTaskResponseMetadata,
		pubkeysOfNonSigningOperators []taskmanager.BN254G1Point,
	) (*types.Receipt, error)
	SendAggregatedResponse(ctx context.Context,
		task taskmanager.CheckpointTask,
		taskResponse messages.CheckpointTaskResponse,
		aggregation messages.MessageBlsAggregation,
	) (*types.Receipt, error)
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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