diff --git a/integration-tests/actions/keeper_helpers.go b/integration-tests/actions/keeper_helpers.go index 98c9a51e1c8..dfe2acbbed3 100644 --- a/integration-tests/actions/keeper_helpers.go +++ b/integration-tests/actions/keeper_helpers.go @@ -27,6 +27,7 @@ func CreateKeeperJobs( chainlinkNodes []*client.ChainlinkK8sClient, keeperRegistry contracts.KeeperRegistry, ocrConfig contracts.OCRv2Config, + evmChainID string, ) { // Send keeper jobs to registry and chainlink nodes primaryNode := chainlinkNodes[0] @@ -49,6 +50,7 @@ func CreateKeeperJobs( Name: fmt.Sprintf("keeper-test-%s", keeperRegistry.Address()), ContractAddress: keeperRegistry.Address(), FromAddress: chainlinkNodeAddress, + EVMChainID: evmChainID, MinIncomingConfirmations: 1, }) require.NoError(t, err, "Creating KeeperV2 Job shouldn't fail") @@ -61,6 +63,7 @@ func CreateKeeperJobsWithKeyIndex( keeperRegistry contracts.KeeperRegistry, keyIndex int, ocrConfig contracts.OCRv2Config, + evmChainID string, ) { // Send keeper jobs to registry and chainlink nodes primaryNode := chainlinkNodes[0] @@ -83,6 +86,7 @@ func CreateKeeperJobsWithKeyIndex( Name: fmt.Sprintf("keeper-test-%s", keeperRegistry.Address()), ContractAddress: keeperRegistry.Address(), FromAddress: chainlinkNodeAddress[keyIndex], + EVMChainID: evmChainID, MinIncomingConfirmations: 1, }) require.NoError(t, err, "Creating KeeperV2 Job shouldn't fail") diff --git a/integration-tests/actions/keeper_helpers_local.go b/integration-tests/actions/keeper_helpers_local.go index 6fc7ef43dbe..2596a816702 100644 --- a/integration-tests/actions/keeper_helpers_local.go +++ b/integration-tests/actions/keeper_helpers_local.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/rs/zerolog/log" + "github.com/smartcontractkit/chainlink/integration-tests/client" "github.com/smartcontractkit/chainlink/integration-tests/contracts" ) @@ -12,6 +13,7 @@ func CreateKeeperJobsLocal( chainlinkNodes []*client.ChainlinkClient, keeperRegistry contracts.KeeperRegistry, ocrConfig contracts.OCRv2Config, + evmChainID string, ) ([]*client.Job, error) { // Send keeper jobs to registry and chainlink nodes primaryNode := chainlinkNodes[0] @@ -43,10 +45,10 @@ func CreateKeeperJobsLocal( return nil, err } job, err := chainlinkNode.MustCreateJob(&client.KeeperJobSpec{ - Name: fmt.Sprintf("keeper-test-%s", keeperRegistry.Address()), - ContractAddress: keeperRegistry.Address(), - FromAddress: chainlinkNodeAddress, - MinIncomingConfirmations: 1, + Name: fmt.Sprintf("keeper-test-%s", keeperRegistry.Address()), + ContractAddress: keeperRegistry.Address(), + FromAddress: chainlinkNodeAddress, + EVMChainID: evmChainID, }) if err != nil { log.Error().Err(err).Msg("Creating KeeperV2 Job shouldn't fail") diff --git a/integration-tests/client/chainlink_models.go b/integration-tests/client/chainlink_models.go index 5b9998b29ea..473b86be1fa 100644 --- a/integration-tests/client/chainlink_models.go +++ b/integration-tests/client/chainlink_models.go @@ -789,6 +789,7 @@ observationSource = """ type FluxMonitorJobSpec struct { Name string `toml:"name"` ContractAddress string `toml:"contractAddress"` // Address of the Flux Monitor script + EVMChainID string `toml:"evmChainID"` // Not optional Precision int `toml:"precision"` // Optional Threshold float32 `toml:"threshold"` // Optional AbsoluteThreshold float32 `toml:"absoluteThreshold"` // Optional @@ -809,6 +810,7 @@ func (f *FluxMonitorJobSpec) String() (string, error) { schemaVersion = 1 name = "{{.Name}}" contractAddress = "{{.ContractAddress}}" +evmChainID = "{{.EVMChainID}}" precision ={{if not .Precision}} 0 {{else}} {{.Precision}} {{end}} threshold ={{if not .Threshold}} 0.5 {{else}} {{.Threshold}} {{end}} absoluteThreshold ={{if not .AbsoluteThreshold}} 0.1 {{else}} {{.AbsoluteThreshold}} {{end}} @@ -832,6 +834,7 @@ type KeeperJobSpec struct { Name string `toml:"name"` ContractAddress string `toml:"contractAddress"` FromAddress string `toml:"fromAddress"` // Hex representation of the from address + EVMChainID string `toml:"evmChainID"` // Not optional MinIncomingConfirmations int `toml:"minIncomingConfirmations"` } @@ -846,6 +849,7 @@ schemaVersion = 1 name = "{{.Name}}" contractAddress = "{{.ContractAddress}}" fromAddress = "{{.FromAddress}}" +evmChainID = "{{.EVMChainID}}" minIncomingConfirmations = {{.MinIncomingConfirmations}} ` return MarshallTemplate(k, "Keeper Job", keeperTemplateString) diff --git a/integration-tests/performance/flux_test.go b/integration-tests/performance/flux_test.go index bc914c329b9..47b2b22e1ad 100644 --- a/integration-tests/performance/flux_test.go +++ b/integration-tests/performance/flux_test.go @@ -100,6 +100,7 @@ func TestFluxPerformance(t *testing.T) { fluxSpec := &client.FluxMonitorJobSpec{ Name: fmt.Sprintf("flux-monitor-%s", adapterUUID), ContractAddress: fluxInstance.Address(), + EVMChainID: chainClient.GetChainID().String(), Threshold: 0, AbsoluteThreshold: 0, PollTimerPeriod: 15 * time.Second, // min 15s diff --git a/integration-tests/performance/keeper_test.go b/integration-tests/performance/keeper_test.go index 384729dfab3..5688a05aa6d 100644 --- a/integration-tests/performance/keeper_test.go +++ b/integration-tests/performance/keeper_test.go @@ -68,7 +68,7 @@ func TestKeeperPerformance(t *testing.T) { // Not the last node, hence not all nodes started profiling yet. return } - actions.CreateKeeperJobs(t, chainlinkNodes, registry, contracts.OCRv2Config{}) + actions.CreateKeeperJobs(t, chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) err := chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") diff --git a/integration-tests/smoke/flux_test.go b/integration-tests/smoke/flux_test.go index c4cd02b857d..385ed90034f 100644 --- a/integration-tests/smoke/flux_test.go +++ b/integration-tests/smoke/flux_test.go @@ -93,6 +93,7 @@ func TestFluxBasic(t *testing.T) { fluxSpec := &client.FluxMonitorJobSpec{ Name: fmt.Sprintf("flux-monitor-%s", adapterUUID), ContractAddress: fluxInstance.Address(), + EVMChainID: env.EVMClient.GetChainID().String(), Threshold: 0, AbsoluteThreshold: 0, PollTimerPeriod: 15 * time.Second, // min 15s diff --git a/integration-tests/smoke/keeper_test.go b/integration-tests/smoke/keeper_test.go index f07c42ab3d8..d0f8466e438 100644 --- a/integration-tests/smoke/keeper_test.go +++ b/integration-tests/smoke/keeper_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink-testing-framework/utils" + "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/integration-tests/actions" @@ -99,7 +100,7 @@ func TestKeeperBasicSmoke(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -174,7 +175,7 @@ func TestKeeperBlockCountPerTurn(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -280,7 +281,7 @@ func TestKeeperSimulation(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -351,7 +352,7 @@ func TestKeeperCheckPerformGasLimit(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -459,7 +460,7 @@ func TestKeeperRegisterUpkeep(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -546,7 +547,7 @@ func TestKeeperAddFunds(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -608,7 +609,7 @@ func TestKeeperRemove(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -684,7 +685,7 @@ func TestKeeperPauseRegistry(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -744,7 +745,7 @@ func TestKeeperMigrateRegistry(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -763,7 +764,7 @@ func TestKeeperMigrateRegistry(t *testing.T) { ) // Set the jobs for the second registry - _, err = actions.CreateKeeperJobsLocal(chainlinkNodes, secondRegistry, contracts.OCRv2Config{}) + _, err = actions.CreateKeeperJobsLocal(chainlinkNodes, secondRegistry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -834,7 +835,7 @@ func TestKeeperNodeDown(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - jobs, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + jobs, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -940,7 +941,7 @@ func TestKeeperPauseUnPauseUpkeep(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") @@ -1031,7 +1032,7 @@ func TestKeeperUpdateCheckData(t *testing.T) { ) gom := gomega.NewGomegaWithT(t) - _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}) + _, err := actions.CreateKeeperJobsLocal(chainlinkNodes, registry, contracts.OCRv2Config{}, chainClient.GetChainID().String()) require.NoError(t, err, "Error creating keeper jobs") err = chainClient.WaitForEvents() require.NoError(t, err, "Error creating keeper jobs") diff --git a/integration-tests/testsetups/keeper_benchmark.go b/integration-tests/testsetups/keeper_benchmark.go index 7e862467266..bdba3a67665 100644 --- a/integration-tests/testsetups/keeper_benchmark.go +++ b/integration-tests/testsetups/keeper_benchmark.go @@ -246,7 +246,7 @@ func (k *KeeperBenchmarkTest) Run(t *testing.T) { // Give time for OCR nodes to bootstrap time.Sleep(1 * time.Minute) } else { - actions.CreateKeeperJobsWithKeyIndex(t, k.chainlinkNodes, k.keeperRegistries[rIndex], txKeyId, ocrConfig) + actions.CreateKeeperJobsWithKeyIndex(t, k.chainlinkNodes, k.keeperRegistries[rIndex], txKeyId, ocrConfig, k.chainClient.GetChainID().String()) } err = k.chainClient.WaitForEvents() require.NoError(t, err, "Error waiting for registry setConfig")