logpoller

package
v0.0.0-...-692deea Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChaosPauses = []PauseData{}
View Source
var (
	DefaultOCRRegistryConfig = contracts.KeeperRegistrySettings{
		PaymentPremiumPPB:    uint32(200000000),
		FlatFeeMicroLINK:     uint32(0),
		BlockCountPerTurn:    big.NewInt(10),
		CheckGasLimit:        uint32(2500000),
		StalenessSeconds:     big.NewInt(90000),
		GasCeilingMultiplier: uint16(1),
		MinUpkeepSpend:       big.NewInt(0),
		MaxPerformGas:        uint32(5000000),
		FallbackGasPrice:     big.NewInt(2e11),
		FallbackLinkPrice:    big.NewInt(2e18),
		MaxCheckDataSize:     uint32(5000),
		MaxPerformDataSize:   uint32(5000),
	}
)
View Source
var (
	EmitterABI, _ = abi.JSON(strings.NewReader(le.LogEmitterABI))
)

Functions

func AssertContractAddressUniquneness

func AssertContractAddressUniquneness(logEmitters []*contracts.LogEmitter) error

AssertContractAddressUniquneness asserts that the provided contract addresses are unique

func AssertUpkeepIdsUniqueness

func AssertUpkeepIdsUniqueness(upkeepIDs []*big.Int) error

AssertUpkeepIdsUniqueness asserts that the provided upkeep IDs are unique

func ClNodesHaveExpectedLogCount

func ClNodesHaveExpectedLogCount(startBlock, endBlock int64, chainID *big.Int, expectedLogCount int, expectedFilters []ExpectedFilter, l zerolog.Logger, coreLogger core_logger.SugaredLogger, nodes *test_env.ClCluster) (bool, error)

ClNodesHaveExpectedLogCount returns true if all CL nodes have the expected log count in the provided block range and matching the provided filters

func ExecuteChaosExperiment

func ExecuteChaosExperiment(l zerolog.Logger, testEnv *test_env.CLClusterTestEnv, testConfig *tc.TestConfig, errorCh chan error)

ExecuteChaosExperiment executes the configured chaos experiment, which consist of pausing CL node or Postgres containers

func ExecuteGenerator

func ExecuteGenerator(t *testing.T, cfg *lp_config.Config, logEmitters []*contracts.LogEmitter) (int, error)

ExecuteGenerator executes the configured generator and returns the total number of logs emitted

func FluentlyCheckIfAllNodesHaveLogCount

func FluentlyCheckIfAllNodesHaveLogCount(duration string, startBlock, endBlock int64, expectedLogCount int, expectedFilters []ExpectedFilter, l zerolog.Logger, coreLogger core_logger.SugaredLogger, testEnv *test_env.CLClusterTestEnv, chainId int64) (bool, error)

FluentlyCheckIfAllNodesHaveLogCount checks if all CL nodes have the expected log count for the provided block range and expected filters It will retry until the provided duration is reached or until all nodes have the expected log count

func GetEndBlockToWaitFor

func GetEndBlockToWaitFor(endBlock, chainId int64, cfg *lp_config.Config) (int64, error)

GetEndBlockToWaitFor returns the end block to wait for based on chain id and finality tag provided in config

func GetExpectedLogCount

func GetExpectedLogCount(cfg *lp_config.Config) int64

GetExpectedLogCount returns the expected number of logs to be emitted based on the provided config

func GetFinalityDepth

func GetFinalityDepth(chainId int64) (int64, error)

GetFinalityDepth returns the finality depth for the provided chain ID

func LogPollerHasFinalisedEndBlock

func LogPollerHasFinalisedEndBlock(endBlock int64, chainID *big.Int, l zerolog.Logger, coreLogger core_logger.SugaredLogger, nodes *test_env.ClCluster) (bool, error)

LogPollerHasFinalisedEndBlock returns true if all CL nodes have finalised processing the provided end block

func NewORM

func NewORM(logger core_logger.SugaredLogger, chainID *big.Int, postgresDb *ctf_test_env.PostgresDb) (logpoller.ORM, *sqlx.DB, error)

NewORM returns a new logpoller.orm instance

func NodeHasExpectedFilters

func NodeHasExpectedFilters(ctx context.Context, expectedFilters []ExpectedFilter, logger core_logger.SugaredLogger, chainID *big.Int, postgresDb *ctf_test_env.PostgresDb) (bool, string, error)

NodeHasExpectedFilters returns true if the provided node has all the expected filters registered

func PrintMissingLogsInfo

func PrintMissingLogsInfo(missingLogs map[string][]geth_types.Log, l zerolog.Logger, cfg *lp_config.Config)

PrintMissingLogsInfo prints various useful information about the missing logs

func RegisterFiltersAndAssertUniquness

func RegisterFiltersAndAssertUniquness(l zerolog.Logger, registry contracts.KeeperRegistry, upkeepIDs []*big.Int, logEmitters []*contracts.LogEmitter, cfg *lp_config.Config, upKeepsNeeded int) error

RegisterFiltersAndAssertUniquness registers the configured log filters and asserts that the filters are unique meaning that for each log emitter address and topic there is only one filter

func SetupLogPollerTestDocker

func SetupLogPollerTestDocker(
	t *testing.T,
	registryVersion ethereum.KeeperRegistryVersion,
	registryConfig contracts.KeeperRegistrySettings,
	upkeepsNeeded int,
	lpPollingInterval time.Duration,
	backupPollingInterval uint64,
	finalityTagEnabled bool,
	testConfig *tc.TestConfig,
) (
	blockchain.EVMClient,
	[]*client.ChainlinkClient,
	contracts.ContractDeployer,
	contracts.LinkToken,
	contracts.KeeperRegistry,
	contracts.KeeperRegistrar,
	*test_env.CLClusterTestEnv,
)

SetupLogPollerTestDocker starts the DON and private Ethereum network

func UploadLogEmitterContractsAndWaitForFinalisation

func UploadLogEmitterContractsAndWaitForFinalisation(l zerolog.Logger, t *testing.T, testEnv *test_env.CLClusterTestEnv, testConfig *tc.TestConfig) []*contracts.LogEmitter

UploadLogEmitterContractsAndWaitForFinalisation uploads the configured number of log emitter contracts and waits for the upload blocks to be finalised

Types

type ChaosPauseData

type ChaosPauseData struct {
	Err       error
	PauseData PauseData
}

type Counter

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

type ExpectedFilter

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

func GetExpectedFilters

func GetExpectedFilters(logEmitters []*contracts.LogEmitter, cfg *lp_config.Config) []ExpectedFilter

GetExpectedFilters returns a slice of ExpectedFilter structs based on the provided log emitters and config

type LogEmitterChannel

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

type LogEmitterGun

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

LogEmitterGun is a gun that constantly emits logs from a contract

func NewLogEmitterGun

func NewLogEmitterGun(
	contract *contracts.LogEmitter,
	eventsToEmit []abi.Event,
	eventsPerTx int,
	logger zerolog.Logger,
) *LogEmitterGun

func (*LogEmitterGun) Call

func (m *LogEmitterGun) Call(l *wasp.Generator) *wasp.Response

type MissingLogs

type MissingLogs map[string][]geth_types.Log

func GetMissingLogs

func GetMissingLogs(startBlock, endBlock int64, logEmitters []*contracts.LogEmitter, evmClient blockchain.EVMClient, clnodeCluster *test_env.ClCluster, l zerolog.Logger, coreLogger core_logger.SugaredLogger, cfg *lp_config.Config) (MissingLogs, error)

GetMissingLogs returns a map of CL node name to missing logs in that node compared to EVM node to which the provided evm client is connected

func (*MissingLogs) IsEmpty

func (m *MissingLogs) IsEmpty() bool

IsEmpty returns true if there are no missing logs

type PauseData

type PauseData struct {
	StartBlock      uint64
	EndBlock        uint64
	TargetComponent string
	ContaineName    string
}

Jump to

Keyboard shortcuts

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