blsagg

package
v0.0.0-...-6c97b1e Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageAlreadyInitializedErrorFn = func(messageDigest coretypes.MessageDigest) error {
		return fmt.Errorf("message 0x%x already initialized", messageDigest)
	}
	MessageExpiredError    = fmt.Errorf("message expired")
	MessageNotFoundErrorFn = func(messageDigest coretypes.MessageDigest) error {
		return fmt.Errorf("message 0x%x not initialized or already completed", messageDigest)
	}
	OperatorNotPartOfMessageQuorumErrorFn = func(operatorId eigentypes.OperatorId, messageDigest coretypes.MessageDigest) error {
		return fmt.Errorf("operator 0x%x not part of message 0x%x's quorum", operatorId, messageDigest)
	}
	SignatureVerificationError = func(err error) error {
		return fmt.Errorf("Failed to verify signature: %w", err)
	}
	IncorrectSignatureError                   = errors.New("Signature verification failed. Incorrect Signature.")
	MessageDigestNotFoundError                = errors.New("Message digest not found")
	QuorumThresholdPercentageOutOfBoundsError = errors.New("Quorum threshold percentage out of bounds")
	QuorumThresholdPercentageLessThan51Error  = errors.New("Quorum threshold percentage less than 51")
)

Functions

This section is empty.

Types

type AggregatedOperators

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

type MessageBlsAggregationService

type MessageBlsAggregationService interface {
	InitializeMessageIfNotExists(
		messageKey coretypes.MessageKey,
		quorumNumbers []eigentypes.QuorumNum,
		quorumThresholdPercentages []eigentypes.QuorumThresholdPercentage,
		timeToExpiry time.Duration,
		aggregationTimeout time.Duration,
		ethBlockNumber uint64,
	) error

	ProcessNewSignature(
		ctx context.Context,
		message MessageBlsAggregationServiceMessage,
		blsSignature *bls.Signature,
		operatorId eigentypes.OperatorId,
	) error

	GetResponseChannel() <-chan MessageBlsAggregationServiceResponse
}

type MessageBlsAggregationServiceMessage

type MessageBlsAggregationServiceMessage interface {
	Digest() (coretypes.MessageDigest, error)
	Key() coretypes.MessageKey
}

type MessageBlsAggregationServiceResponse

type MessageBlsAggregationServiceResponse struct {
	messages.MessageBlsAggregation

	MessageKey coretypes.MessageKey
	Message    MessageBlsAggregationServiceMessage

	Status   MessageBlsAggregationStatus
	Finished bool
	Err      error
}

type MessageBlsAggregationStatus

type MessageBlsAggregationStatus int32
const (
	MessageBlsAggregationStatusNone MessageBlsAggregationStatus = iota
	MessageBlsAggregationStatusFullStakeThresholdMet
	MessageBlsAggregationStatusThresholdNotReached
	MessageBlsAggregationStatusThresholdReached
)

type MessageBlsAggregatorService

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

func NewMessageBlsAggregatorService

func NewMessageBlsAggregatorService(avsRegistryService avsregistry.AvsRegistryService, ethClient eth.Client, logger logging.Logger) *MessageBlsAggregatorService

func (*MessageBlsAggregatorService) GetResponseChannel

func (mbas *MessageBlsAggregatorService) GetResponseChannel() <-chan MessageBlsAggregationServiceResponse

func (*MessageBlsAggregatorService) InitializeMessageIfNotExists

func (mbas *MessageBlsAggregatorService) InitializeMessageIfNotExists(
	messageKey coretypes.MessageKey,
	quorumNumbers []eigentypes.QuorumNum,
	quorumThresholdPercentages []eigentypes.QuorumThresholdPercentage,
	timeToExpiry time.Duration,
	aggregationTimeout time.Duration,
	ethBlockNumber uint64,
) error

func (*MessageBlsAggregatorService) ProcessNewSignature

func (mbas *MessageBlsAggregatorService) ProcessNewSignature(
	ctx context.Context,
	message MessageBlsAggregationServiceMessage,
	blsSignature *bls.Signature,
	operatorId eigentypes.OperatorId,
) error

type SignedMessage

type SignedMessage struct {
	Message                     MessageBlsAggregationServiceMessage
	MessageDigest               coretypes.MessageDigest
	BlsSignature                *bls.Signature
	OperatorId                  eigentypes.OperatorId
	SignatureVerificationErrorC chan error
}

type SignedMessageHandlingResult

type SignedMessageHandlingResult int32
const (
	SignedMessageHandlingResultThresholdReached SignedMessageHandlingResult = iota
	SignedMessageHandlingResultFullStakeThresholdMet
	SignedMessageHandlingResultSuccess
	SignedMessageHandlingResultError
)

Jump to

Keyboard shortcuts

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