chain

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSignatureVerificationFailed              = whoops.String("signature verification failed")
	ErrSignatureDoesNotMatchItsRespectiveSigner = whoops.String("signature does not match its respective signer")
	ErrTooLittleOrTooManySignaturesProvided     = whoops.String("too many or too little signatures provided")
	ErrProcessorDoesNotSupportThisQueue         = whoops.Errorf("processor does not support queue: %s")

	ErrNotFound = whoops.String("not found")

	ErrNotConnectedToRightChain = whoops.String("not connected to the right chain")

	ErrMissingAccount    = whoops.Errorf("missing account for chain %s")
	ErrAccountBalanceLow = whoops.Errorf("account balance %s for account %s (%s) is lower than minimum allowed balance")

	EnrichedChainReferenceID whoops.Field[string] = "chainReferenceID"
	EnrichedID               whoops.Field[uint64] = "id"
	EnrichedItemType         whoops.Field[string] = "type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSendEvent added in v1.8.0

type BatchSendEvent struct {
	EthBlockHeight uint64
	EventNonce     uint64
	BatchNonce     uint64
	TokenContract  string
}

type ChainInfo

type ChainInfo interface {
	ChainReferenceID() string
	ChainID() string
	ChainType() string
}

type ExternalAccount

type ExternalAccount struct {
	ChainType        string
	ChainReferenceID string

	Address string
	PubKey  []byte
}

type GravityBatchWithSignatures added in v1.8.0

type GravityBatchWithSignatures struct {
	gravity.OutgoingTxBatch
	Signatures []ValidatorSignature
}

func (GravityBatchWithSignatures) GetBytes added in v1.8.0

func (gb GravityBatchWithSignatures) GetBytes() []byte

func (GravityBatchWithSignatures) GetSignatures added in v1.8.0

func (gb GravityBatchWithSignatures) GetSignatures() []ValidatorSignature

type MessageToProcess

type MessageToProcess struct {
	QueueTypeName string
	Msg           QueuedMessage
}

type MessageWithSignatures

type MessageWithSignatures struct {
	QueuedMessage
	Signatures []ValidatorSignature
}

func (MessageWithSignatures) GetBytes added in v1.8.0

func (msg MessageWithSignatures) GetBytes() []byte

func (MessageWithSignatures) GetSignatures added in v1.8.0

func (msg MessageWithSignatures) GetSignatures() []ValidatorSignature

type Processor

type Processor interface {
	health.Checker
	// GetChainReferenceID returns the chain reference EventNonce against which the processor is running.
	GetChainReferenceID() string

	// SupportedQueues is a list of consensus queues that this processor supports and expects to work with.
	SupportedQueues() []string

	ExternalAccount() ExternalAccount

	// SignMessages takes a list of messages and signs them via their key.
	SignMessages(ctx context.Context, messages ...QueuedMessage) ([]SignedQueuedMessage, error)

	// ProcessMessages will receive messages from the current queues and it's on the implementation
	// to ensure that there are enough signatures for consensus.
	ProcessMessages(context.Context, queue.TypeName, []MessageWithSignatures) error

	// ProvideEvidence takes a queue name and a list of messages that have already been executed. This
	// takes the "public evidence" from the message and gets the information back to the Paloma.
	ProvideEvidence(context.Context, queue.TypeName, []MessageWithSignatures) error

	SubmitBatchSendToEthClaims(context.Context, []BatchSendEvent, string) error
	SubmitSendToPalomaClaims(context.Context, []SendToPalomaEvent, string) error

	// it verifies if it's being connected to the right chain
	IsRightChain(ctx context.Context) error

	GravitySignBatches(context.Context, ...gravity.OutgoingTxBatch) ([]SignedGravityOutgoingTxBatch, error)
	GravityRelayBatches(context.Context, []GravityBatchWithSignatures) error

	GetBatchSendEvents(context.Context, string) ([]BatchSendEvent, error)
	GetSendToPalomaEvents(context.Context, string) ([]SendToPalomaEvent, error)
}

type ProcessorBuilder

type ProcessorBuilder interface {
	Build(ChainInfo) (Processor, error)
}

type QueuedMessage

type QueuedMessage struct {
	ID               uint64
	Nonce            []byte
	BytesToSign      []byte
	PublicAccessData []byte
	ErrorData        []byte
	Msg              any
}

type SendToPalomaEvent added in v1.8.0

type SendToPalomaEvent struct {
	EthBlockHeight uint64
	EventNonce     uint64
	Amount         uint64
	EthereumSender string
	PalomaReceiver string
	TokenContract  string
}

type SignedEntity added in v1.8.0

type SignedEntity interface {
	GetSignatures() []ValidatorSignature
	GetBytes() []byte
}

type SignedGravityOutgoingTxBatch added in v1.8.0

type SignedGravityOutgoingTxBatch struct {
	gravity.OutgoingTxBatch
	Signature       []byte
	SignedByAddress string
}

type SignedQueuedMessage

type SignedQueuedMessage struct {
	QueuedMessage
	Signature       []byte
	SignedByAddress string
}

type ValidatorSignature

type ValidatorSignature struct {
	ValAddress      sdk.ValAddress
	Signature       []byte
	SignedByAddress string
	PublicKey       []byte
}

Directories

Path Synopsis
evm

Jump to

Keyboard shortcuts

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