chain

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 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 {
	TokenContract  string
	EthBlockHeight uint64
	EventNonce     uint64
	BatchNonce     uint64
	SkywayNonce    uint64
}

func (BatchSendEvent) GetEventNonce added in v1.12.4

func (e BatchSendEvent) GetEventNonce() uint64

func (BatchSendEvent) GetSkywayNonce added in v1.12.4

func (e BatchSendEvent) GetSkywayNonce() uint64

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 LightNodeSaleEvent added in v1.12.4

type LightNodeSaleEvent struct {
	ClientAddress        string
	SmartContractAddress string
	Amount               uint64
	EthBlockHeight       uint64
	EventNonce           uint64
	SkywayNonce          uint64
}

func (LightNodeSaleEvent) GetEventNonce added in v1.12.4

func (e LightNodeSaleEvent) GetEventNonce() uint64

func (LightNodeSaleEvent) GetSkywayNonce added in v1.12.4

func (e LightNodeSaleEvent) GetSkywayNonce() uint64

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

	SubmitEventClaims(context.Context, []SkywayEventer, string) error

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

	SkywaySignBatches(context.Context, ...skyway.OutgoingTxBatch) ([]SignedSkywayOutgoingTxBatch, error)
	SkywayRelayBatches(context.Context, []SkywayBatchWithSignatures) error

	GetSkywayEvents(context.Context, string) ([]SkywayEventer, 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 {
	EthereumSender string
	PalomaReceiver string
	TokenContract  string
	EthBlockHeight uint64
	EventNonce     uint64
	Amount         uint64
	SkywayNonce    uint64
}

func (SendToPalomaEvent) GetEventNonce added in v1.12.4

func (e SendToPalomaEvent) GetEventNonce() uint64

func (SendToPalomaEvent) GetSkywayNonce added in v1.12.4

func (e SendToPalomaEvent) GetSkywayNonce() uint64

type SignedEntity added in v1.8.0

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

type SignedQueuedMessage

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

type SignedSkywayOutgoingTxBatch added in v1.12.2

type SignedSkywayOutgoingTxBatch struct {
	skyway.OutgoingTxBatch
	Signature       []byte
	SignedByAddress string
}

type SkywayBatchWithSignatures added in v1.12.2

type SkywayBatchWithSignatures struct {
	skyway.OutgoingTxBatch
	Signatures []ValidatorSignature
}

func (SkywayBatchWithSignatures) GetBytes added in v1.12.2

func (gb SkywayBatchWithSignatures) GetBytes() []byte

func (SkywayBatchWithSignatures) GetSignatures added in v1.12.2

func (gb SkywayBatchWithSignatures) GetSignatures() []ValidatorSignature

type SkywayEventer added in v1.12.4

type SkywayEventer interface {
	GetEventNonce() uint64
	GetSkywayNonce() uint64
}

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