governor

package
v0.0.0-...-7be3494 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckQuery

func CheckQuery(logger *zap.Logger) error

CheckQuery is a free function used to test that the CoinGecko query still works after the mainnet token list has been updated.

Types

type ChainGovernor

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

func NewChainGovernor

func NewChainGovernor(
	logger *zap.Logger,
	db db.GovernorDB,
	env common.Environment,
) *ChainGovernor

func (*ChainGovernor) CheckPending

func (gov *ChainGovernor) CheckPending() ([]*common.MessagePublication, error)

func (*ChainGovernor) CheckPendingForTime

func (gov *ChainGovernor) CheckPendingForTime(now time.Time) ([]*common.MessagePublication, error)

func (*ChainGovernor) CollectMetrics

func (gov *ChainGovernor) CollectMetrics(hb *gossipv1.Heartbeat, sendC chan<- []byte, gk *ecdsa.PrivateKey, ourAddr ethCommon.Address)

func (*ChainGovernor) DropPendingVAA

func (gov *ChainGovernor) DropPendingVAA(vaaId string) (string, error)

Admin command to remove a VAA from the pending list and discard it.

func (*ChainGovernor) GetAvailableNotionalByChain

func (gov *ChainGovernor) GetAvailableNotionalByChain() []*publicrpcv1.GovernorGetAvailableNotionalByChainResponse_Entry

REST query to get the current available notional value per chain.

func (*ChainGovernor) GetEnqueuedVAAs

REST query to get the list of enqueued VAAs.

func (*ChainGovernor) GetTokenList

REST query to get the list of tokens being monitored by the governor.

func (*ChainGovernor) HashFromMsg

func (gov *ChainGovernor) HashFromMsg(msg *common.MessagePublication) string

func (*ChainGovernor) IsGovernedMsg

func (gov *ChainGovernor) IsGovernedMsg(msg *common.MessagePublication) (msgIsGoverned bool, err error)

IsGovernedMsg determines if the message applies to the governor. It grabs the lock.

func (*ChainGovernor) IsVAAEnqueued

func (gov *ChainGovernor) IsVAAEnqueued(msgId *publicrpcv1.MessageID) (bool, error)

REST query to see if a VAA is enqueued.

func (*ChainGovernor) PriceQuery

func (gov *ChainGovernor) PriceQuery(ctx context.Context) error

PriceQuery is the entry point for the routine that periodically queries CoinGecko for prices.

func (*ChainGovernor) ProcessMsg

func (gov *ChainGovernor) ProcessMsg(msg *common.MessagePublication) bool

Returns true if the message can be published, false if it has been added to the pending list.

func (*ChainGovernor) ProcessMsgForTime

func (gov *ChainGovernor) ProcessMsgForTime(msg *common.MessagePublication, now time.Time) (bool, error)

func (*ChainGovernor) ReleasePendingVAA

func (gov *ChainGovernor) ReleasePendingVAA(vaaId string) (string, error)

Admin command to remove a VAA from the pending list and publish it without regard to (or impact on) the daily limit.

func (*ChainGovernor) Reload

func (gov *ChainGovernor) Reload() (string, error)

Admin command to reload the governor state from the database.

func (*ChainGovernor) ResetReleaseTimer

func (gov *ChainGovernor) ResetReleaseTimer(vaaId string) (string, error)

Admin command to reset the release timer for a pending VAA, extending it to the configured limit.

func (*ChainGovernor) Run

func (gov *ChainGovernor) Run(ctx context.Context) error

func (*ChainGovernor) Status

func (gov *ChainGovernor) Status() string

Admin command to display status to the log.

func (*ChainGovernor) TrimAndSumValue

func (gov *ChainGovernor) TrimAndSumValue(transfers []*db.Transfer, startTime time.Time) (uint64, []*db.Transfer, error)

func (*ChainGovernor) TrimAndSumValueForChain

func (gov *ChainGovernor) TrimAndSumValueForChain(ce *chainEntry, startTime time.Time) (sum uint64, err error)

Jump to

Keyboard shortcuts

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