attestor

package
v0.0.0-...-2c9fc41 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MQ_WAIT_TIMEOUT        = 30 * time.Second
	MQ_REBROADCAST_TIMEOUT = 15 * time.Second
)
View Source
const AttestorSubsystem = "attestor"
View Source
const OperatorNamespace = "sffl_operator"

Variables

This section is empty.

Functions

func SignStateRootUpdateMessage

func SignStateRootUpdateMessage(blsKeypair *bls.KeyPair, stateRootUpdateMessage *messages.StateRootUpdateMessage) (*bls.Signature, error)

Types

type Attestor

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

Attestor subscribes for RPCs block updates Also subscribes for MQ blocks from Consumer Each block from RPC waits for MQ_WAIT_TIMEOUT for MQ block In case same block doesn't arrive from MQ block is signed and sent If it arrives it is compared and then sent to Aggregator

func NewAttestor

func NewAttestor(config *optypes.NodeConfig, blsKeypair *bls.KeyPair, operatorId eigentypes.OperatorId, registry *prometheus.Registry, logger sdklogging.Logger) (*Attestor, error)

func (*Attestor) Close

func (attestor *Attestor) Close() error

func (*Attestor) EnableMetrics

func (attestor *Attestor) EnableMetrics(registry *prometheus.Registry) error

func (*Attestor) GetSignedRootC

func (attestor *Attestor) GetSignedRootC() <-chan messages.SignedStateRootUpdateMessage

func (*Attestor) Start

func (attestor *Attestor) Start(ctx context.Context) error

type Attestorer

type Attestorer interface {
	core.Metricable

	Start(ctx context.Context) error
	Close() error
	GetSignedRootC() <-chan messages.SignedStateRootUpdateMessage
}

type BlockPredicate

type BlockPredicate = func(consumer.BlockData) bool

type EventListener

type EventListener interface {
	OnMissedMQBlock(rollupId uint32)
	OnBlockMismatch(rollupId uint32)
	OnBlockReceived(rollupId uint32)
	ObserveLastBlockReceived(rollupId uint32, blockNumber uint64)
	ObserveLastBlockReceivedTimestamp(rollupId uint32, timestamp uint64)
	ObserveInitializationInitialBlockNumber(rollupId uint32, blockNumber uint64)
}

func MakeAttestorMetrics

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

type Notifier

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

Notifier Broadcasts block from some rollup to subscribers

func NewNotifier

func NewNotifier() Notifier

func (*Notifier) Notify

func (notifier *Notifier) Notify(rollupId uint32, block consumer.BlockData) error

func (*Notifier) Subscribe

func (notifier *Notifier) Subscribe(rollupId uint32, predicate BlockPredicate) (<-chan consumer.BlockData, *list.Element)

func (*Notifier) Unsubscribe

func (notifier *Notifier) Unsubscribe(rollupId uint32, el *list.Element)

type SelectiveEventListener

type SelectiveEventListener struct {
	OnMissedMQBlockCb                         func(rollupId uint32)
	OnBlockMismatchCb                         func(rollupId uint32)
	OnBlockReceivedCb                         func(rollupId uint32)
	ObserveLastBlockReceivedCb                func(rollupId uint32, blockNumber uint64)
	ObserveLastBlockReceivedTimestampCb       func(rollupId uint32, timestamp uint64)
	ObserveInitializationInitialBlockNumberCb func(rollupId uint32, blockNumber uint64)
}

func (*SelectiveEventListener) ObserveInitializationInitialBlockNumber

func (l *SelectiveEventListener) ObserveInitializationInitialBlockNumber(rollupId uint32, blockNumber uint64)

func (*SelectiveEventListener) ObserveLastBlockReceived

func (l *SelectiveEventListener) ObserveLastBlockReceived(rollupId uint32, blockNumber uint64)

func (*SelectiveEventListener) ObserveLastBlockReceivedTimestamp

func (l *SelectiveEventListener) ObserveLastBlockReceivedTimestamp(rollupId uint32, timestamp uint64)

func (*SelectiveEventListener) OnBlockMismatch

func (l *SelectiveEventListener) OnBlockMismatch(rollupId uint32)

func (*SelectiveEventListener) OnBlockReceived

func (l *SelectiveEventListener) OnBlockReceived(rollupId uint32)

func (*SelectiveEventListener) OnMissedMQBlock

func (l *SelectiveEventListener) OnMissedMQBlock(rollupId uint32)

Jump to

Keyboard shortcuts

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