relayer

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingChainConfig = errors.Unrecoverable(whoops.String("missing chain config"))
	ErrUnknown            = errors.Unrecoverable(whoops.String("unknown errror"))

	ErrInvalidMinOnChainBalance = whoops.Errorf("invalid minOnChainBalance: %s")

	ErrNotAValidatorAccount = whoops.String("not a validator account")

	ErrValidatorIsNotStaking = whoops.String("validator is not staking")
)

Functions

This section is empty.

Types

type Config added in v0.5.0

type Config struct {
	KeepAliveLoopTimeout time.Duration
	KeepAliveThreshold   time.Duration
}

type EvmFactorier

type EvmFactorier interface {
	Build(
		cfg config.EVM,
		chainReferenceID,
		smartContractID,
		smartContractABIJson,
		smartContractAddress string,
		chainID *big.Int,
		blockHeight int64,
		blockHeightHash common.Hash,
		minOnChainBalance *big.Int,
	) (chain.Processor, error)
}

type PalomaClienter

type PalomaClienter interface {
	AddExternalChainInfo(ctx context.Context, chainInfos ...paloma.ChainInfoIn) error
	QueryValidatorInfo(ctx context.Context) ([]*valset.ExternalChainInfo, error)
	BroadcastMessageSignatures(ctx context.Context, signatures ...paloma.BroadcastMessageSignatureIn) error
	QueryMessagesForAttesting(ctx context.Context, queueTypeName string) ([]chain.MessageWithSignatures, error)
	QueryMessagesForRelaying(ctx context.Context, queueTypeName string) ([]chain.MessageWithSignatures, error)
	QueryMessagesForSigning(ctx context.Context, queueTypeName string) ([]chain.QueuedMessage, error)
	QueryGetEVMChainInfos(ctx context.Context) ([]*evmtypes.ChainInfo, error)
	AddMessageEvidence(ctx context.Context, queueTypeName string, messageID uint64, proof proto.Message) error
	SetPublicAccessData(ctx context.Context, queueTypeName string, messageID uint64, data []byte) error
	SetErrorData(ctx context.Context, queueTypeName string, messageID uint64, data []byte) error
	QueryGetEVMValsetByID(ctx context.Context, id uint64, chainID string) (*evmtypes.Valset, error)
	GetValidatorAddress() sdk.ValAddress
	GetValidator(ctx context.Context) (*stakingtypes.Validator, error)

	BlockHeight(context.Context) (int64, error)
	QueryGetSnapshotByID(ctx context.Context, id uint64) (*valset.Snapshot, error)

	QueryGetValidatorAliveUntil(ctx context.Context) (time.Time, error)
	KeepValidatorAlive(ctx context.Context) error
}

type Relayer

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

func New

func New(config config.Root, palomaClient PalomaClienter, evmFactory EvmFactorier, customTime utiltime.Time, cfg Config) *Relayer

func (*Relayer) AttestMessages added in v1.2.0

func (r *Relayer) AttestMessages(ctx context.Context, locker sync.Locker) error

func (*Relayer) BootHealthCheck added in v0.8.1

func (r *Relayer) BootHealthCheck(ctx context.Context) error

func (*Relayer) HealthCheck added in v0.7.0

func (r *Relayer) HealthCheck(ctx context.Context) error

func (*Relayer) RelayMessages added in v1.1.1

func (r *Relayer) RelayMessages(ctx context.Context, locker sync.Locker) error

func (*Relayer) SignMessages added in v1.1.1

func (r *Relayer) SignMessages(ctx context.Context, locker sync.Locker) error

func (*Relayer) Start

func (r *Relayer) Start(ctx context.Context) error

Start starts the relayer. It's responsible for handling the communication with Paloma and other chains.

func (*Relayer) UpdateExternalChainInfos added in v1.2.0

func (r *Relayer) UpdateExternalChainInfos(ctx context.Context, locker sync.Locker) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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