executor

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: LGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CrossChainPackageEventType          = "IBCPackage"
	CorssChainPackageInfoAttributeKey   = "IBCPackageInfo"
	CorssChainPackageInfoAttributeValue = "%d" + separator + "%d" + separator + "%d" // destChainID channelID sequence

	DefaultGasPrice = 20000000000 // 20 GWei

	FallBehindThreshold          = 5
	SleepSecondForUpdateClient   = 10
	DataSeedDenyServiceThreshold = 60
)

Variables

View Source
var (
	PureHeaderSyncChannelID relayercommon.CrossChainChannelID = -1
)

Functions

This section is empty.

Types

type BBCClient

type BBCClient struct {
	BBCClient     *rpc.HTTP
	Provider      string
	CurrentHeight int64
	UpdatedAt     time.Time
}

type BBCExecutor

type BBCExecutor struct {
	BBCClients []*BBCClient
	Config     *config.Config
	// contains filtered or unexported fields
}

func NewBBCExecutor

func NewBBCExecutor(cfg *config.Config, networkType ctypes.ChainNetwork) (*BBCExecutor, error)

func (*BBCExecutor) FindValidatorSetChangeHeight

func (executor *BBCExecutor) FindValidatorSetChangeHeight(start, end int64, startValidatorHash, endValidatorHash cmn.HexBytes) (height int64, err error)

func (*BBCExecutor) GetClient

func (executor *BBCExecutor) GetClient() *rpc.HTTP

func (*BBCExecutor) GetInitConsensusState

func (executor *BBCExecutor) GetInitConsensusState(height int64) (*common.ConsensusState, error)

func (*BBCExecutor) GetLatestBlockHeight

func (executor *BBCExecutor) GetLatestBlockHeight(client rpc.Client) (int64, error)

func (*BBCExecutor) GetNextSequence

func (executor *BBCExecutor) GetNextSequence(channelID common.CrossChainChannelID, height int64) (uint64, error)

func (*BBCExecutor) MonitorCrossChainPackage

func (executor *BBCExecutor) MonitorCrossChainPackage(height int64, preValidatorsHash cmn.HexBytes) (*common.TaskSet, cmn.HexBytes, error)

func (*BBCExecutor) MonitorValidatorSetChange

func (executor *BBCExecutor) MonitorValidatorSetChange(height int64, preValidatorsHash cmn.HexBytes) (bool, cmn.HexBytes, error)

func (*BBCExecutor) QueryKeyWithProof

func (executor *BBCExecutor) QueryKeyWithProof(key []byte, height int64) (int64, []byte, []byte, []byte, error)

func (*BBCExecutor) QueryTendermintHeader

func (executor *BBCExecutor) QueryTendermintHeader(height int64) (*common.Header, error)

func (*BBCExecutor) SubmitEvidence

func (executor *BBCExecutor) SubmitEvidence(headers []*bsc.Header) (*coretypes.ResultBroadcastTx, error)

func (*BBCExecutor) SwitchBCClient

func (executor *BBCExecutor) SwitchBCClient()

func (*BBCExecutor) UpdateClients

func (executor *BBCExecutor) UpdateClients()

func (*BBCExecutor) VerifyValidatorSetChangeAtHeight

func (executor *BBCExecutor) VerifyValidatorSetChangeAtHeight(height int64) error

type BSCClient

type BSCClient struct {
	BSCClient     *ethclient.Client
	Provider      string
	CurrentHeight int64
	UpdatedAt     time.Time
}

type BSCExecutor

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

func NewBSCExecutor

func NewBSCExecutor(db *gorm.DB, bbcExecutor *BBCExecutor, cfg *config.Config) (*BSCExecutor, error)

func (*BSCExecutor) BatchRelayCrossChainPackages

func (executor *BSCExecutor) BatchRelayCrossChainPackages(channelID relayercommon.CrossChainChannelID, startSequence, endSequence, height uint64) ([]common.Hash, error)

func (*BSCExecutor) CallBuildInSystemContract

func (executor *BSCExecutor) CallBuildInSystemContract(channelID relayercommon.CrossChainChannelID, height, sequence uint64, msgBytes, proofBytes []byte, nonce uint64) (common.Hash, error)

func (*BSCExecutor) ClaimReward

func (executor *BSCExecutor) ClaimReward() (common.Hash, error)

func (*BSCExecutor) GetClient

func (executor *BSCExecutor) GetClient() *ethclient.Client

func (*BSCExecutor) GetLatestBlockHeight

func (executor *BSCExecutor) GetLatestBlockHeight(client *ethclient.Client) (int64, error)

func (*BSCExecutor) GetLightClientLatestHeight

func (executor *BSCExecutor) GetLightClientLatestHeight() (uint64, error)

func (*BSCExecutor) GetNextSequence

func (executor *BSCExecutor) GetNextSequence(channelID relayercommon.CrossChainChannelID) (uint64, error)

func (*BSCExecutor) GetPackage

func (executor *BSCExecutor) GetPackage(channelID relayercommon.CrossChainChannelID, sequence, height uint64) ([]byte, []byte, error)

func (*BSCExecutor) GetRelayerBalance

func (executor *BSCExecutor) GetRelayerBalance() (*big.Int, error)

func (*BSCExecutor) GetTxRecipient

func (executor *BSCExecutor) GetTxRecipient(txHash common.Hash) (*types.Receipt, error)

func (*BSCExecutor) IsRelayer

func (executor *BSCExecutor) IsRelayer() (bool, error)

func (*BSCExecutor) QueryReward

func (executor *BSCExecutor) QueryReward() (*big.Int, error)

func (*BSCExecutor) RegisterRelayer

func (executor *BSCExecutor) RegisterRelayer() (common.Hash, error)

func (*BSCExecutor) RelayCrossChainPackage

func (executor *BSCExecutor) RelayCrossChainPackage(channelID relayercommon.CrossChainChannelID, sequence, height uint64) (common.Hash, error)

func (*BSCExecutor) SwitchBSCClient

func (executor *BSCExecutor) SwitchBSCClient()

func (*BSCExecutor) SyncTendermintLightClientHeader

func (executor *BSCExecutor) SyncTendermintLightClientHeader(height uint64) (common.Hash, error)

func (*BSCExecutor) UpdateClients

func (executor *BSCExecutor) UpdateClients()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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