relayer

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 31 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
	KeepAliveBlockThreshold int64
}

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,
		mevClient mev.Client,
	) (chain.Processor, error)
}

type PalomaClienter

type PalomaClienter interface {
	NewStatus() paloma.StatusUpdater
	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)
	GetCreator() string
	BlockHeight(context.Context) (int64, error)
	QueryGetSnapshotByID(ctx context.Context, id uint64) (*valset.Snapshot, error)

	QueryGetValidatorAliveUntilBlockHeight(ctx context.Context) (int64, error)
	KeepValidatorAlive(ctx context.Context, appVersion string) error

	GravityQueryLastUnsignedBatch(ctx context.Context, chainReferenceID string) ([]gravity.OutgoingTxBatch, error)
	GravityConfirmBatches(ctx context.Context, signatures ...chain.SignedGravityOutgoingTxBatch) error
	GravityQueryBatchesForRelaying(ctx context.Context, chainReferenceID string) ([]chain.GravityBatchWithSignatures, error)
}

type Relayer

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

func New

func New(config *config.Config, 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, _ sync.Locker) error

func (*Relayer) BootHealthCheck added in v0.8.1

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

func (*Relayer) GravityHandleBatchSendEvent added in v1.8.0

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

func (*Relayer) GravityHandleSendToPalomaEvent added in v1.8.0

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

func (*Relayer) GravityRelayBatches added in v1.8.0

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

func (*Relayer) GravitySignBatches added in v1.8.0

func (r *Relayer) GravitySignBatches(ctx context.Context, locker sync.Locker) 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, _ sync.Locker) error

func (*Relayer) SetAppVersion added in v1.5.0

func (r *Relayer) SetAppVersion(appVersion string)

func (*Relayer) SetMevClient added in v1.5.4

func (r *Relayer) SetMevClient(c mev.Client)

func (*Relayer) SignMessages added in v1.1.1

func (r *Relayer) SignMessages(ctx context.Context, _ 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, _ sync.Locker) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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