evm

package
v2.9.1-clf-20240315 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 40 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegistryServiceName = "AutomationRegistry"

	ErrLogReadFailure              = fmt.Errorf("failure reading logs")
	ErrHeadNotAvailable            = fmt.Errorf("head not available")
	ErrInitializationFailure       = fmt.Errorf("failed to initialize registry")
	ErrContextCancelled            = fmt.Errorf("context was cancelled")
	ErrABINotParsable              = fmt.Errorf("error parsing abi")
	ActiveUpkeepIDBatchSize  int64 = 1000
)
View Source
var (
	BlockSubscriberServiceName = "BlockSubscriber"
)

Functions

func NewOnchainKeyringV3Wrapper

func NewOnchainKeyringV3Wrapper(keyring types.OnchainKeyring) *onchainKeyringV3Wrapper

func NewPayloadBuilder

func NewPayloadBuilder(activeUpkeepList ActiveUpkeepList, recoverer logprovider.LogRecoverer, lggr logger.Logger) *payloadBuilder

func NewUpkeepProvider

func NewUpkeepProvider(activeUpkeeps ActiveUpkeepList, bs *BlockSubscriber, lp logpoller.LogPoller) *upkeepProvider

func RegistryUpkeepFilterName

func RegistryUpkeepFilterName(addr common.Address) string

Types

type ActiveUpkeepList

type ActiveUpkeepList interface {
	// Reset resets the list to the given IDs
	Reset(ids ...*big.Int)
	// Add adds new entries to the list
	Add(id ...*big.Int) int
	// Remove removes entries from the list
	Remove(id ...*big.Int) int
	// View returns the list of IDs of the given type
	View(...types.UpkeepType) []*big.Int
	// IsActive returns true if the given ID is of an active upkeep
	IsActive(id *big.Int) bool
	Size() int
}

ActiveUpkeepList is a list to manage active upkeep IDs

func NewActiveUpkeepList

func NewActiveUpkeepList() ActiveUpkeepList

NewActiveList creates a new ActiveList

type AutomationServices

type AutomationServices interface {
	Keyring() ocr3types.OnchainKeyring[plugin.AutomationReportInfo]
}

type BlockSubscriber

type BlockSubscriber struct {
	services.StateMachine
	// contains filtered or unexported fields
}

func NewBlockSubscriber

func NewBlockSubscriber(hb httypes.HeadBroadcaster, lp logpoller.LogPoller, finalityDepth uint32, lggr logger.Logger) *BlockSubscriber

func (*BlockSubscriber) Close

func (bs *BlockSubscriber) Close() error

func (*BlockSubscriber) LatestBlock

func (bs *BlockSubscriber) LatestBlock() *ocr2keepers.BlockKey

func (*BlockSubscriber) Start

func (bs *BlockSubscriber) Start(ctx context.Context) error

func (*BlockSubscriber) Subscribe

func (bs *BlockSubscriber) Subscribe() (int, chan ocr2keepers.BlockHistory, error)

func (*BlockSubscriber) Unsubscribe

func (bs *BlockSubscriber) Unsubscribe(subId int) error

type EvmRegistry

type EvmRegistry struct {
	services.StateMachine
	// contains filtered or unexported fields
}

func NewEvmRegistry

func NewEvmRegistry(
	lggr logger.Logger,
	addr common.Address,
	client legacyevm.Chain,
	registry *iregistry21.IKeeperRegistryMaster,
	mc *types.MercuryCredentials,
	al ActiveUpkeepList,
	logEventProvider logprovider.LogEventProvider,
	packer encoding.Packer,
	blockSub *BlockSubscriber,
	finalityDepth uint32,
) *EvmRegistry

func (*EvmRegistry) CheckUpkeeps

func (r *EvmRegistry) CheckUpkeeps(ctx context.Context, keys ...ocr2keepers.UpkeepPayload) ([]ocr2keepers.CheckResult, error)

func (*EvmRegistry) Close

func (r *EvmRegistry) Close() error

func (*EvmRegistry) HealthReport

func (r *EvmRegistry) HealthReport() map[string]error

func (*EvmRegistry) Name

func (r *EvmRegistry) Name() string

func (*EvmRegistry) Start

func (r *EvmRegistry) Start(ctx context.Context) error

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MercuryConfig

type MercuryConfig struct {
	Abi abi.ABI
	// AllowListCache stores the upkeeps privileges. In 2.1, this only includes a JSON bytes for allowed to use mercury
	AllowListCache *cache.Cache
	// contains filtered or unexported fields
}

func NewMercuryConfig

func NewMercuryConfig(credentials *types.MercuryCredentials, abi abi.ABI) *MercuryConfig

func (*MercuryConfig) Credentials

func (c *MercuryConfig) Credentials() *types.MercuryCredentials

func (*MercuryConfig) GetPluginRetry

func (c *MercuryConfig) GetPluginRetry(k string) (interface{}, bool)

func (*MercuryConfig) IsUpkeepAllowed

func (c *MercuryConfig) IsUpkeepAllowed(k string) (interface{}, bool)

func (*MercuryConfig) SetPluginRetry

func (c *MercuryConfig) SetPluginRetry(k string, v interface{}, d time.Duration)

func (*MercuryConfig) SetUpkeepAllowed

func (c *MercuryConfig) SetUpkeepAllowed(k string, v interface{}, d time.Duration)

type Registry

type Registry interface {
	GetUpkeep(opts *bind.CallOpts, id *big.Int) (encoding.UpkeepInfo, error)
	GetState(opts *bind.CallOpts) (iregistry21.GetState, error)
	GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error)
	GetUpkeepPrivilegeConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error)
	GetUpkeepTriggerConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error)
	CheckCallback(opts *bind.CallOpts, id *big.Int, values [][]byte, extraData []byte) (iregistry21.CheckCallback, error)
	ParseLog(log coreTypes.Log) (generated.AbigenLog, error)
}

Directories

Path Synopsis
v02
v03

Jump to

Keyboard shortcuts

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