evm

package
v2.5.1-celo-20230921 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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
	FetchUpkeepConfigBatchSize       = 10
)

Functions

func NewOnchainKeyringV3Wrapper added in v2.5.0

func NewOnchainKeyringV3Wrapper(keyring types.OnchainKeyring) *onchainKeyringV3Wrapper

func NewPayloadBuilder added in v2.5.0

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

func NewUpkeepProvider added in v2.5.0

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

func RegistryUpkeepFilterName added in v2.5.0

func RegistryUpkeepFilterName(addr common.Address) string

func TransmitEventProviderFilterName added in v2.4.0

func TransmitEventProviderFilterName(addr common.Address) string

Types

type ActiveUpkeepList added in v2.5.0

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(...ocr2keepers.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 added in v2.5.0

func NewActiveUpkeepList() ActiveUpkeepList

NewActiveList creates a new ActiveList

type AutomationServices added in v2.5.0

type AutomationServices interface {
	Registry() *EvmRegistry
	Encoder() ocr2keepers.Encoder
	TransmitEventProvider() *TransmitEventProvider
	BlockSubscriber() *BlockSubscriber
	PayloadBuilder() ocr2keepers.PayloadBuilder
	UpkeepStateStore() upkeepstate.UpkeepStateStore
	LogEventProvider() logprovider.LogEventProvider
	LogRecoverer() logprovider.LogRecoverer
	UpkeepProvider() ocr2keepers.ConditionalUpkeepProvider
	Keyring() ocr3types.OnchainKeyring[plugin.AutomationReportInfo]
}

func New added in v2.5.0

type BlockSubscriber added in v2.4.0

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

func NewBlockSubscriber added in v2.4.0

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

func (*BlockSubscriber) Close added in v2.4.0

func (bs *BlockSubscriber) Close() error

func (*BlockSubscriber) Start added in v2.4.0

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

func (*BlockSubscriber) Subscribe added in v2.4.0

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

func (*BlockSubscriber) Unsubscribe added in v2.4.0

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

type EvmRegistry

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

func NewEvmRegistry added in v2.5.0

func NewEvmRegistry(
	lggr logger.Logger,
	addr common.Address,
	client evm.Chain,
	feedLookupCompatibleABI, keeperRegistryABI abi.ABI,
	registry *iregistry21.IKeeperRegistryMaster,
	mc *models.MercuryCredentials,
	al ActiveUpkeepList,
	logEventProvider logprovider.LogEventProvider,
	packer encoding.Packer,
	blockSub *BlockSubscriber,
) *EvmRegistry

func (*EvmRegistry) CheckUpkeeps added in v2.4.0

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

func (r *EvmRegistry) Ready() error

func (*EvmRegistry) Start

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

type FeedLookup

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

type HttpClient

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

type MercuryConfig

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

type MercuryData added in v2.5.0

type MercuryData struct {
	Index     int
	Error     error
	Retryable bool
	Bytes     [][]byte
	State     encoding.PipelineExecutionState
}

type MercuryV02Response added in v2.5.0

type MercuryV02Response struct {
	ChainlinkBlob string `json:"chainlinkBlob"`
}

MercuryV02Response represents a JSON structure used by Mercury v0.2

type MercuryV03Report added in v2.5.0

type MercuryV03Report struct {
	FeedID                string `json:"feedID"` // feed id in hex
	ValidFromTimestamp    string `json:"validFromTimestamp"`
	ObservationsTimestamp string `json:"observationsTimestamp"`
	FullReport            string `json:"fullReport"` // the actual mercury report of this feed, can be sent to verifier
}

type MercuryV03Response added in v2.5.0

type MercuryV03Response struct {
	Reports []MercuryV03Report `json:"reports"`
}

MercuryV03Response represents a JSON structure used by Mercury v0.3

type MercuryVersion

type MercuryVersion string

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.TransactOpts, id *big.Int, values [][]byte, extraData []byte) (*coreTypes.Transaction, error)
	ParseLog(log coreTypes.Log) (generated.AbigenLog, error)
}

type TransmitEventProvider added in v2.4.0

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

func NewTransmitEventProvider added in v2.4.0

func NewTransmitEventProvider(
	logger logger.Logger,
	logPoller logpoller.LogPoller,
	registryAddress common.Address,
	client evmclient.Client,
	lookbackBlocks int64,
) (*TransmitEventProvider, error)

func (*TransmitEventProvider) Close added in v2.4.0

func (c *TransmitEventProvider) Close() error

func (*TransmitEventProvider) GetLatestEvents added in v2.5.0

func (c *TransmitEventProvider) GetLatestEvents(ctx context.Context) ([]ocr2keepers.TransmitEvent, error)

func (*TransmitEventProvider) HealthReport added in v2.4.0

func (c *TransmitEventProvider) HealthReport() map[string]error

func (*TransmitEventProvider) Name added in v2.4.0

func (c *TransmitEventProvider) Name() string

func (*TransmitEventProvider) Ready added in v2.4.0

func (c *TransmitEventProvider) Ready() error

func (*TransmitEventProvider) Start added in v2.4.0

type UpkeepPrivilegeConfig added in v2.5.0

type UpkeepPrivilegeConfig struct {
	MercuryEnabled bool `json:"mercuryEnabled"`
}

UpkeepPrivilegeConfig represents the administrative offchain config for each upkeep. It can be set by s_upkeepManager role on the registry. Upkeeps allowed to use Mercury server will have this set to true.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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