orchestrator

package
v0.0.0-...-2da98db Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package orchestrator provides the orchestrator for orchestrating cross-chain transactions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Std     zerolog.Logger
	Sampled zerolog.Logger
}

Log is a struct that contains the logger TODO(revamp): rename to logger

type Orchestrator

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

Orchestrator wraps the zetacore client, chain observers and signers. This is the high level object used for CCTX scheduling

func NewOrchestrator

func NewOrchestrator(
	ctx context.Context,
	zetacoreClient interfaces.ZetacoreClient,
	signerMap map[int64]interfaces.ChainSigner,
	observerMap map[int64]interfaces.ChainObserver,
	logger zerolog.Logger,
	ts *metrics.TelemetryServer,
) *Orchestrator

NewOrchestrator creates a new orchestrator

func (*Orchestrator) GetPendingCctxsWithinRateLimit

func (oc *Orchestrator) GetPendingCctxsWithinRateLimit(
	ctx context.Context,
	foreignChains []chains.Chain,
) (map[int64][]*types.CrossChainTx, error)

GetPendingCctxsWithinRateLimit get pending cctxs across foreign chains within rate limit

func (*Orchestrator) GetUpdatedChainObserver

func (oc *Orchestrator) GetUpdatedChainObserver(
	appContext *zctx.AppContext,
	chainID int64,
) (interfaces.ChainObserver, error)

GetUpdatedChainObserver returns chain observer with updated chain parameters

func (*Orchestrator) GetUpdatedSigner

func (oc *Orchestrator) GetUpdatedSigner(
	appContext *zctx.AppContext,
	chainID int64,
) (interfaces.ChainSigner, error)

GetUpdatedSigner returns signer with updated chain parameters

func (*Orchestrator) MonitorCore

func (oc *Orchestrator) MonitorCore(ctx context.Context) error

MonitorCore starts the orchestrator for CCTXs

func (*Orchestrator) ScheduleCctxBTC

func (oc *Orchestrator) ScheduleCctxBTC(
	ctx context.Context,
	zetaHeight uint64,
	chainID int64,
	cctxList []*types.CrossChainTx,
	observer interfaces.ChainObserver,
	signer interfaces.ChainSigner,
)

ScheduleCctxBTC schedules bitcoin outbound keysign on each ZetaChain block (the ticker) 1. schedule at most one keysign per ticker 2. schedule keysign only when nonce-mark UTXO is available 3. stop keysign when lookahead is reached

func (*Orchestrator) ScheduleCctxEVM

func (oc *Orchestrator) ScheduleCctxEVM(
	ctx context.Context,
	zetaHeight uint64,
	chainID int64,
	cctxList []*types.CrossChainTx,
	observer interfaces.ChainObserver,
	signer interfaces.ChainSigner,
)

ScheduleCctxEVM schedules evm outbound keysign on each ZetaChain block (the ticker)

func (*Orchestrator) StartCctxScheduler

func (oc *Orchestrator) StartCctxScheduler(ctx context.Context) error

StartCctxScheduler schedules keysigns for cctxs on each ZetaChain block (the ticker) TODO(revamp): make this function simpler

Jump to

Keyboard shortcuts

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