operator

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: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperatorNamespace = "sffl_operator"
	OperatorSubsytem  = "operator"
)
View Source
const (
	AVS_NAME = "super-fast-finality-layer"
	SEM_VER  = "0.0.1"
)
View Source
const (
	ResendInterval = 2 * time.Second
	MaxRetries     = 10
)

Variables

This section is empty.

Functions

Types

type AggregatorRpcClient

type AggregatorRpcClient struct {
	// contains filtered or unexported fields
}

func NewAggregatorRpcClient

func NewAggregatorRpcClient(aggregatorIpPortAddr string, operatorId eigentypes.OperatorId, registryCoordinatorAddress common.Address, logger logging.Logger) (*AggregatorRpcClient, error)

func (*AggregatorRpcClient) EnableMetrics

func (c *AggregatorRpcClient) EnableMetrics(registry *prometheus.Registry) error

func (*AggregatorRpcClient) GetAggregatedCheckpointMessages

func (c *AggregatorRpcClient) GetAggregatedCheckpointMessages(fromTimestamp, toTimestamp uint64) (*messages.CheckpointMessages, error)

func (*AggregatorRpcClient) InitializeClientIfNotExist

func (c *AggregatorRpcClient) InitializeClientIfNotExist() error

func (*AggregatorRpcClient) SendSignedCheckpointTaskResponseToAggregator

func (c *AggregatorRpcClient) SendSignedCheckpointTaskResponseToAggregator(signedCheckpointTaskResponse *messages.SignedCheckpointTaskResponse)

func (*AggregatorRpcClient) SendSignedOperatorSetUpdateToAggregator

func (c *AggregatorRpcClient) SendSignedOperatorSetUpdateToAggregator(signedOperatorSetUpdateMessage *messages.SignedOperatorSetUpdateMessage)

func (*AggregatorRpcClient) SendSignedStateRootUpdateToAggregator

func (c *AggregatorRpcClient) SendSignedStateRootUpdateToAggregator(signedStateRootUpdateMessage *messages.SignedStateRootUpdateMessage)

type AggregatorRpcClienter

type AggregatorRpcClienter interface {
	core.Metricable

	SendSignedCheckpointTaskResponseToAggregator(signedCheckpointTaskResponse *messages.SignedCheckpointTaskResponse)
	SendSignedStateRootUpdateToAggregator(signedStateRootUpdateMessage *messages.SignedStateRootUpdateMessage)
	SendSignedOperatorSetUpdateToAggregator(signedOperatorSetUpdateMessage *messages.SignedOperatorSetUpdateMessage)
	GetAggregatedCheckpointMessages(fromTimestamp, toTimestamp uint64) (*messages.CheckpointMessages, error)
}

type AvsManager

type AvsManager struct {
	// contains filtered or unexported fields
}

func NewAvsManager

func NewAvsManager(config *optypes.NodeConfig, ethRpcClient eth.Client, ethWsClient eth.Client, elChainReader *elcontracts.ELChainReader, elChainWriter *elcontracts.ELChainWriter, txManager txmgr.TxManager, logger sdklogging.Logger) (*AvsManager, error)

func (*AvsManager) DepositIntoStrategy

func (avsManager *AvsManager) DepositIntoStrategy(operatorAddr common.Address, strategyAddr common.Address, amount *big.Int) error

func (*AvsManager) DeregisterOperator

func (avsManager *AvsManager) DeregisterOperator(blsKeyPair *bls.KeyPair) error

func (*AvsManager) GetCheckpointTaskCreatedChan

func (avsManager *AvsManager) GetCheckpointTaskCreatedChan() <-chan *taskmanager.ContractSFFLTaskManagerCheckpointTaskCreated

func (*AvsManager) GetOperatorId

func (avsManager *AvsManager) GetOperatorId(options *bind.CallOpts, address common.Address) ([32]byte, error)

func (*AvsManager) GetOperatorSetUpdateChan

func (avsManager *AvsManager) GetOperatorSetUpdateChan() <-chan messages.OperatorSetUpdateMessage

func (*AvsManager) IsOperatorRegistered

func (avsManager *AvsManager) IsOperatorRegistered(options *bind.CallOpts, address common.Address) (bool, error)

func (*AvsManager) RegisterOperatorWithAvs

func (avsManager *AvsManager) RegisterOperatorWithAvs(
	client eth.Client,
	operatorEcdsaKeyPair *ecdsa.PrivateKey,
	blsKeyPair *bls.KeyPair,
) error

RegisterOperatorWithAvs Registration specific functions

func (*AvsManager) RegisterOperatorWithEigenlayer

func (avsManager *AvsManager) RegisterOperatorWithEigenlayer(operatorAddr common.Address) error

func (*AvsManager) Start

func (avsManager *AvsManager) Start(ctx context.Context, operatorAddr common.Address) error

type AvsManagerer

type AvsManagerer interface {
	Start(ctx context.Context, operatorAddr common.Address) error
	DepositIntoStrategy(operatorAddr common.Address, strategyAddr common.Address, amount *big.Int) error
	RegisterOperatorWithEigenlayer(operatorAddr common.Address) error
	RegisterOperatorWithAvs(
		client eth.Client,
		operatorEcdsaKeyPair *ecdsa.PrivateKey,
		blsKeyPair *bls.KeyPair,
	) error
	DeregisterOperator(blsKeyPair *bls.KeyPair) error
	GetOperatorId(options *bind.CallOpts, address common.Address) ([32]byte, error)
	GetCheckpointTaskCreatedChan() <-chan *taskmanager.ContractSFFLTaskManagerCheckpointTaskCreated
	GetOperatorSetUpdateChan() <-chan messages.OperatorSetUpdateMessage
}

type Operator

type Operator struct {
	// contains filtered or unexported fields
}

func NewOperatorFromConfig

func NewOperatorFromConfig(c optypes.NodeConfig) (*Operator, error)

TODO(samlaf): config is a mess right now, since the chainio client constructors

take the config in core (which is shared with aggregator and challenger)

func (*Operator) BlsPubkeyG1

func (o *Operator) BlsPubkeyG1() *bls.G1Point

func (*Operator) Close

func (o *Operator) Close() error

func (*Operator) DepositIntoStrategy

func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big.Int) error

func (*Operator) EnableMetrics

func (o *Operator) EnableMetrics(registry *prometheus.Registry) error

func (*Operator) PrintOperatorStatus

func (o *Operator) PrintOperatorStatus() error

func (*Operator) ProcessCheckpointTask

func (o *Operator) ProcessCheckpointTask(event *taskmanager.ContractSFFLTaskManagerCheckpointTaskCreated)

func (*Operator) RegisterOperatorWithAvs

func (o *Operator) RegisterOperatorWithAvs(
	operatorEcdsaKeyPair *ecdsa.PrivateKey,
) error

func (*Operator) RegisterOperatorWithEigenlayer

func (o *Operator) RegisterOperatorWithEigenlayer() error

func (*Operator) SignTaskResponse

func (o *Operator) SignTaskResponse(taskResponse *messages.CheckpointTaskResponse) (*messages.SignedCheckpointTaskResponse, error)

func (*Operator) Start

func (o *Operator) Start(ctx context.Context) error

type OperatorEventListener

type OperatorEventListener interface {
	OnTasksReceived()
	IncInitializationCount()
	ObserveLastInitializedTime()
}

func MakeOperatorMetrics

func MakeOperatorMetrics(registry *prometheus.Registry) (OperatorEventListener, error)

type OperatorStatus

type OperatorStatus struct {
	EcdsaAddress string
	// pubkey compendium related
	PubkeysRegistered bool
	G1Pubkey          string
	G2Pubkey          string
	// avs related
	RegisteredWithAvs bool
	OperatorId        string
}

type RpcClientEventListener

type RpcClientEventListener interface {
	OnMessagesReceived()
	ObserveResendQueueSize(size int)
	ObserveLastCheckpointIdResponded(checkpointId uint32)
	ObserveLastOperatorSetUpdateIdResponded(operatorSetUpdateId uint64)
	IncStateRootUpdateSubmissions(rollupId uint32, resend bool)
	IncOperatorSetUpdateUpdateSubmissions(resend bool)
	IncCheckpointTaskResponseSubmissions(resend bool)
	IncErroredStateRootUpdateSubmissions(rollupId uint32, resend bool)
	IncErroredOperatorSetUpdateSubmissions(resend bool)
	IncErroredCheckpointSubmissions(resend bool)
}

func MakeRpcClientMetrics

func MakeRpcClientMetrics(registry *prometheus.Registry) (RpcClientEventListener, error)

type SelectiveOperatorListener

type SelectiveOperatorListener struct {
	OnTasksReceivedCb            func()
	IncInitializationCountCb     func()
	ObserveLastInitializedTimeCb func()
}

func (*SelectiveOperatorListener) IncInitializationCount

func (l *SelectiveOperatorListener) IncInitializationCount()

func (*SelectiveOperatorListener) ObserveLastInitializedTime

func (l *SelectiveOperatorListener) ObserveLastInitializedTime()

func (*SelectiveOperatorListener) OnTasksReceived

func (l *SelectiveOperatorListener) OnTasksReceived()

type SelectiveRpcClientListener

type SelectiveRpcClientListener struct {
	OnMessagesReceivedCb                      func()
	ObserveResendQueueSizeCb                  func(size int)
	ObserveLastCheckpointIdRespondedCb        func(checkpointId uint32)
	ObserveLastOperatorSetUpdateIdRespondedCb func(operatorSetUpdateId uint64)
	IncStateRootUpdateSubmissionsCb           func(rollupId uint32, resend bool)
	IncOperatorSetUpdateUpdateSubmissionsCb   func(resend bool)
	IncCheckpointTaskResponseSubmissionsCb    func(resend bool)
	IncErroredStateRootUpdateSubmissionsCb    func(rollupId uint32, resend bool)
	IncErroredOperatorSetUpdateSubmissionsCb  func(resend bool)
	IncErroredCheckpointSubmissionsCb         func(resend bool)
}

func (*SelectiveRpcClientListener) IncCheckpointTaskResponseSubmissions

func (l *SelectiveRpcClientListener) IncCheckpointTaskResponseSubmissions(resend bool)

func (*SelectiveRpcClientListener) IncErroredCheckpointSubmissions

func (l *SelectiveRpcClientListener) IncErroredCheckpointSubmissions(resend bool)

func (*SelectiveRpcClientListener) IncErroredOperatorSetUpdateSubmissions

func (l *SelectiveRpcClientListener) IncErroredOperatorSetUpdateSubmissions(resend bool)

func (*SelectiveRpcClientListener) IncErroredStateRootUpdateSubmissions

func (l *SelectiveRpcClientListener) IncErroredStateRootUpdateSubmissions(rollupId uint32, resend bool)

func (*SelectiveRpcClientListener) IncOperatorSetUpdateUpdateSubmissions

func (l *SelectiveRpcClientListener) IncOperatorSetUpdateUpdateSubmissions(resend bool)

func (*SelectiveRpcClientListener) IncStateRootUpdateSubmissions

func (l *SelectiveRpcClientListener) IncStateRootUpdateSubmissions(rollupId uint32, resend bool)

func (*SelectiveRpcClientListener) ObserveLastCheckpointIdResponded

func (l *SelectiveRpcClientListener) ObserveLastCheckpointIdResponded(checkpointId uint32)

func (*SelectiveRpcClientListener) ObserveLastOperatorSetUpdateIdResponded

func (l *SelectiveRpcClientListener) ObserveLastOperatorSetUpdateIdResponded(operatorSetUpdateId uint64)

func (*SelectiveRpcClientListener) ObserveResendQueueSize

func (l *SelectiveRpcClientListener) ObserveResendQueueSize(size int)

func (*SelectiveRpcClientListener) OnMessagesReceived

func (l *SelectiveRpcClientListener) OnMessagesReceived()

Directories

Path Synopsis
cmd
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