rpc_server

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

Documentation

Index

Constants

View Source
const (
	OperatorSetUpdateMessageLabel = "operator_set_update_message"
	StateRootUpdateMessageLabel   = "state_root_update_message"
	CheckpointTaskResponseLabel   = "checkpoint_task_response"
)
View Source
const MaxCheckpointRange uint64 = 60 * 60 * 2 // 2 hours

Variables

View Source
var (
	TaskNotFoundError400                     = errors.New("400. Task not found")
	OperatorNotPartOfTaskQuorum400           = errors.New("400. Operator not part of quorum")
	OperatorNotFoundError400                 = errors.New("400. Operator not found")
	TaskResponseDigestNotFoundError500       = errors.New("500. Failed to get task response digest")
	MessageDigestNotFoundError500            = errors.New("500. Failed to get message digest")
	OperatorSetUpdateBlockNotFoundError500   = errors.New("500. Failed to get operator set update block")
	UnknownErrorWhileVerifyingSignature400   = errors.New("400. Failed to verify signature")
	InvalidSignatureError400                 = errors.New("400. Invalid signature")
	CallToGetCheckSignaturesIndicesFailed500 = errors.New("500. Failed to get check signatures indices")
	MessageExpiredError500                   = errors.New("500. Message expired")
	UnknownError400                          = errors.New("400. Unknown error")
)

Functions

This section is empty.

Types

type EventListener

type EventListener interface {
	IncOperatorInitializations(operatorId [32]byte)
	IncSignedCheckpointTaskResponse(operatorId [32]byte, errored, notFound bool)
	IncSignedStateRootUpdateMessage(operatorId [32]byte, rollupId uint32, errored, hasNearDa bool)
	IncSignedOperatorSetUpdateMessage(operatorId [32]byte, errored bool)
	IncTotalSignedCheckpointTaskResponse()
	IncTotalSignedStateRootUpdateMessage()
	IncTotalSignedOperatorSetUpdateMessage()
	ObserveLastMessageReceivedTime(operatorId [32]byte, messageType string)
}

func MakeRpcServerMetrics

func MakeRpcServerMetrics(registry *prometheus.Registry) (EventListener, error)

type GetAggregatedCheckpointMessagesArgs

type GetAggregatedCheckpointMessagesArgs struct {
	FromTimestamp, ToTimestamp uint64
}

func (*GetAggregatedCheckpointMessagesArgs) IsValid

type RpcServer

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

func NewRpcServer

func NewRpcServer(serverIpPortAddr string, app aggregator.RpcAggregatorer, logger logging.Logger) *RpcServer

func (*RpcServer) EnableMetrics

func (s *RpcServer) EnableMetrics(registry *prometheus.Registry) error

func (*RpcServer) GetAggregatedCheckpointMessages

func (s *RpcServer) GetAggregatedCheckpointMessages(args *GetAggregatedCheckpointMessagesArgs, reply *messages.CheckpointMessages) error

func (*RpcServer) GetRegistryCoordinatorAddress

func (s *RpcServer) GetRegistryCoordinatorAddress(_ *struct{}, reply *string) error

func (*RpcServer) NotifyOperatorInitialization

func (s *RpcServer) NotifyOperatorInitialization(operatorId eigentypes.OperatorId, reply *bool) error

func (*RpcServer) ProcessSignedCheckpointTaskResponse

func (s *RpcServer) ProcessSignedCheckpointTaskResponse(signedCheckpointTaskResponse *messages.SignedCheckpointTaskResponse, reply *bool) error

rpc endpoint which is called by operator reply doesn't need to be checked. If there are no errors, the task response is accepted rpc framework forces a reply type to exist, so we put bool as a placeholder

func (*RpcServer) ProcessSignedOperatorSetUpdateMessage

func (s *RpcServer) ProcessSignedOperatorSetUpdateMessage(signedOperatorSetUpdateMessage *messages.SignedOperatorSetUpdateMessage, reply *bool) error

func (*RpcServer) ProcessSignedStateRootUpdateMessage

func (s *RpcServer) ProcessSignedStateRootUpdateMessage(signedStateRootUpdateMessage *messages.SignedStateRootUpdateMessage, reply *bool) error

func (*RpcServer) Start

func (s *RpcServer) Start() error

type SelectiveRpcListener

type SelectiveRpcListener struct {
	IncOperatorInitializationsCb             func(operatorId [32]byte)
	IncSignedCheckpointTaskResponseCb        func(operatorId [32]byte, errored, notFound bool)
	IncSignedStateRootUpdateMessageCb        func(operatorId [32]byte, rollupId uint32, errored, hasNearDa bool)
	IncSignedOperatorSetUpdateMessageCb      func(operatorId [32]byte, errored bool)
	IncTotalSignedCheckpointTaskResponseCb   func()
	IncTotalSignedStateRootUpdateMessageCb   func()
	IncTotalSignedOperatorSetUpdateMessageCb func()
	ObserveLastMessageReceivedTimeCb         func(operatorId [32]byte, messageType string)
}

func (*SelectiveRpcListener) IncOperatorInitializations

func (l *SelectiveRpcListener) IncOperatorInitializations(operatorId [32]byte)

func (*SelectiveRpcListener) IncSignedCheckpointTaskResponse

func (l *SelectiveRpcListener) IncSignedCheckpointTaskResponse(operatorId [32]byte, errored, notFound bool)

func (*SelectiveRpcListener) IncSignedOperatorSetUpdateMessage

func (l *SelectiveRpcListener) IncSignedOperatorSetUpdateMessage(operatorId [32]byte, errored bool)

func (*SelectiveRpcListener) IncSignedStateRootUpdateMessage

func (l *SelectiveRpcListener) IncSignedStateRootUpdateMessage(operatorId [32]byte, rollupId uint32, errored, hasNearDa bool)

func (*SelectiveRpcListener) IncTotalSignedCheckpointTaskResponse

func (l *SelectiveRpcListener) IncTotalSignedCheckpointTaskResponse()

func (*SelectiveRpcListener) IncTotalSignedOperatorSetUpdateMessage

func (l *SelectiveRpcListener) IncTotalSignedOperatorSetUpdateMessage()

func (*SelectiveRpcListener) IncTotalSignedStateRootUpdateMessage

func (l *SelectiveRpcListener) IncTotalSignedStateRootUpdateMessage()

func (*SelectiveRpcListener) ObserveLastMessageReceivedTime

func (l *SelectiveRpcListener) ObserveLastMessageReceivedTime(operatorId [32]byte, messageType string)

Jump to

Keyboard shortcuts

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