orchestrator

package
v0.0.0-...-1929ff6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 35 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

func CreateChainObserverMap

func CreateChainObserverMap(
	ctx context.Context,
	client interfaces.ZetacoreClient,
	tss interfaces.TSSSigner,
	dbpath string,
	logger base.Logger,
	ts *metrics.TelemetryServer,
) (map[int64]interfaces.ChainObserver, error)

CreateChainObserverMap creates a map of interfaces.ChainObserver (by chainID) for all chains in the config. - Note (!) that it calls observer.Start() on creation - Note that data race handling is the responsibility of the caller.

func CreateSignerMap

func CreateSignerMap(
	ctx context.Context,
	tss interfaces.TSSSigner,
	logger base.Logger,
	ts *metrics.TelemetryServer,
) (map[int64]interfaces.ChainSigner, error)

CreateSignerMap creates a map of interfaces.ChainSigner (by chainID) for all chains in the config. Note that signer construction failure for a chain does not prevent the creation of signers for other chains.

Types

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 New

func New(
	ctx context.Context,
	client interfaces.ZetacoreClient,
	signerMap map[int64]interfaces.ChainSigner,
	observerMap map[int64]interfaces.ChainObserver,
	tss interfaces.TSSSigner,
	dbDirectory string,
	logger base.Logger,
	ts *metrics.TelemetryServer,
) (*Orchestrator, error)

New creates a new Orchestrator

func (*Orchestrator) GetPendingCctxsWithinRateLimit

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

GetPendingCctxsWithinRateLimit get pending cctxs across foreign chains within rate limit

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) ScheduleCctxSolana

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

ScheduleCctxSolana schedules solana outbound keysign on each ZetaChain block (the ticker)

func (*Orchestrator) Start

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

Start starts the orchestrator for CCTXs.

Jump to

Keyboard shortcuts

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