Skip to content

Commit

Permalink
Merge branch 'develop' into chore/ocr3-data-feeds-telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
austinborn authored Sep 18, 2024
2 parents 375a068 + aa04bfa commit 5c3f755
Show file tree
Hide file tree
Showing 33 changed files with 586 additions and 476 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-crabs-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#added Adds the ability to use out of order execution transactions in CCIP E2E tests
5 changes: 5 additions & 0 deletions .changeset/silly-boxes-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

bump chainlink-ccip #updated
4 changes: 2 additions & 2 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ runner-test-matrix:
test_env_vars:
TEST_SUITE: chaos

- id: benchmark/keeper_test.go:^TestAutomationBenchmark$
path: integration-tests/benchmark/keeper_test.go
- id: benchmark/automation_test.go:^TestAutomationBenchmark$
path: integration-tests/benchmark/automation_test.go
test_env_type: k8s-remote-runner
remote_runner_memory: 4Gi
runs_on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/smartcontractkit/chain-selectors v1.0.23 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240916150615-85b8aa5fa7e6 // indirect
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240917180332-5a68498d1612 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,8 @@ github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnj
github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8=
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240916150615-85b8aa5fa7e6 h1:cbHlV2CSphQ+ghDye21M8ym0aAO/Y649H2Mg60M2AuE=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240916150615-85b8aa5fa7e6/go.mod h1:Lv77O13ZxOdmlvnu2vaUC0Lg+t3JAL+N+9K8dRsgmDI=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240917180332-5a68498d1612 h1:xPEM9XbfZmv8N3NjZ7AX5salonll/LdXrbb8JCbA4FE=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240917180332-5a68498d1612/go.mod h1:Lv77O13ZxOdmlvnu2vaUC0Lg+t3JAL+N+9K8dRsgmDI=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240916150342-36cb47701edf h1:1AlTUkT5D8HmvU9bwDoIN54/EFyOnRBl7gnXZVrYXEA=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240916150342-36cb47701edf/go.mod h1:l8NTByXUdGGJX+vyKYI6yX1/HIpM14F8Wm9BkU3Q4Qo=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q=
Expand Down
2 changes: 2 additions & 0 deletions core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@ func NewExecOffchainConfig(
RelativeBoostPerWaitHour float64,
InflightCacheExpiry config.Duration,
RootSnoozeTime config.Duration,
BatchingStrategyID uint32,
) ExecOffchainConfig {
return ExecOffchainConfig{v1_2_0.JSONExecOffchainConfig{
DestOptimisticConfirmations: DestOptimisticConfirmations,
BatchGasLimit: BatchGasLimit,
RelativeBoostPerWaitHour: RelativeBoostPerWaitHour,
InflightCacheExpiry: InflightCacheExpiry,
RootSnoozeTime: RootSnoozeTime,
BatchingStrategyID: BatchingStrategyID,
}}
}

Expand Down
1 change: 1 addition & 0 deletions core/services/ocr2/plugins/ccip/testhelpers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (c *CCIPContracts) createExecOffchainConfig(t *testing.T, inflightCacheExpi
0.07,
*config.MustNewDuration(inflightCacheExpiry),
*config.MustNewDuration(rootSnoozeTime),
uint32(0),
).Encode()
require.NoError(t, err)
return config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ func NewExecOffchainConfig(
RelativeBoostPerWaitHour float64,
InflightCacheExpiry config.Duration,
RootSnoozeTime config.Duration,
BatchingStrategyID uint32,
) ExecOffchainConfig {
return ExecOffchainConfig{v1_2_0.JSONExecOffchainConfig{
DestOptimisticConfirmations: DestOptimisticConfirmations,
BatchGasLimit: BatchGasLimit,
RelativeBoostPerWaitHour: RelativeBoostPerWaitHour,
InflightCacheExpiry: InflightCacheExpiry,
RootSnoozeTime: RootSnoozeTime,
BatchingStrategyID: BatchingStrategyID,
}}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (c *CCIPContracts) createExecOffchainConfig(t *testing.T, inflightCacheExpi
0.07,
*config.MustNewDuration(inflightCacheExpiry),
*config.MustNewDuration(rootSnoozeTime),
uint32(0),
).Encode()
require.NoError(t, err)
return config
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.23
github.com/smartcontractkit/chainlink-automation v1.0.4
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240916150615-85b8aa5fa7e6
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240917180332-5a68498d1612
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240916150342-36cb47701edf
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,8 @@ github.com/smartcontractkit/chain-selectors v1.0.23 h1:D2Eaex4Cw/O7Lg3tX6WklOqnj
github.com/smartcontractkit/chain-selectors v1.0.23/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8umfIfVVlwC7+n5izbLSFgjw8=
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240916150615-85b8aa5fa7e6 h1:cbHlV2CSphQ+ghDye21M8ym0aAO/Y649H2Mg60M2AuE=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240916150615-85b8aa5fa7e6/go.mod h1:Lv77O13ZxOdmlvnu2vaUC0Lg+t3JAL+N+9K8dRsgmDI=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240917180332-5a68498d1612 h1:xPEM9XbfZmv8N3NjZ7AX5salonll/LdXrbb8JCbA4FE=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240917180332-5a68498d1612/go.mod h1:Lv77O13ZxOdmlvnu2vaUC0Lg+t3JAL+N+9K8dRsgmDI=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240916150342-36cb47701edf h1:1AlTUkT5D8HmvU9bwDoIN54/EFyOnRBl7gnXZVrYXEA=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240916150342-36cb47701edf/go.mod h1:l8NTByXUdGGJX+vyKYI6yX1/HIpM14F8Wm9BkU3Q4Qo=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q=
Expand Down
12 changes: 11 additions & 1 deletion integration-tests/actions/automationv2/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,14 @@ func (a *AutomationTest) SetupMercuryMock(t *testing.T, imposters []ctfTestEnv.K
}

func (a *AutomationTest) SetupAutomationDeployment(t *testing.T) {
a.setupDeployment(t, true)
}

func (a *AutomationTest) SetupAutomationDeploymentWithoutJobs(t *testing.T) {
a.setupDeployment(t, false)
}

func (a *AutomationTest) setupDeployment(t *testing.T, addJobs bool) {
l := logging.GetTestLogger(t)
err := a.CollectNodeDetails()
require.NoError(t, err, "Error collecting node details")
Expand Down Expand Up @@ -891,7 +899,9 @@ func (a *AutomationTest) SetupAutomationDeployment(t *testing.T) {
err = a.DeployRegistrar()
require.NoError(t, err, "Error deploying registrar contract")

a.AddJobsAndSetConfig(t)
if addJobs {
a.AddJobsAndSetConfig(t)
}
}

func (a *AutomationTest) LoadAutomationDeployment(t *testing.T, linkTokenAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ func TestAutomationBenchmark(t *testing.T) {
testType, err := tc.GetConfigurationNameFromEnv()
require.NoError(t, err, "Error getting test type")

config, err := tc.GetConfig([]string{testType}, tc.Keeper)
config, err := tc.GetConfig([]string{testType}, tc.Automation)
require.NoError(t, err, "Error getting test config")

testEnvironment, benchmarkNetwork := SetupAutomationBenchmarkEnv(t, &config)
if testEnvironment.WillUseRemoteRunner() {
return
}
networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "")
testName := fmt.Sprintf("%s%s", networkName, *config.Keeper.Common.RegistryToTest)
testName := fmt.Sprintf("%s%s", networkName, *config.Automation.Benchmark.RegistryToTest)
l.Info().Str("Test Name", testName).Msg("Running Benchmark Test")
benchmarkTestNetwork := getNetworkConfig(&config)

Expand All @@ -105,7 +105,7 @@ func TestAutomationBenchmark(t *testing.T) {
CheckGasLimit: uint32(45_000_000), //45M
StalenessSeconds: big.NewInt(90_000),
GasCeilingMultiplier: uint16(2),
MaxPerformGas: uint32(*config.Keeper.Common.MaxPerformGas),
MaxPerformGas: uint32(*config.Automation.Benchmark.MaxPerformGas),
MinUpkeepSpend: big.NewInt(0),
FallbackGasPrice: big.NewInt(2e11),
FallbackLinkPrice: big.NewInt(2e18),
Expand All @@ -114,27 +114,20 @@ func TestAutomationBenchmark(t *testing.T) {
MaxRevertDataSize: uint32(5_000),
},
Upkeeps: &testsetups.UpkeepConfig{
NumberOfUpkeeps: *config.Keeper.Common.NumberOfUpkeeps,
CheckGasToBurn: *config.Keeper.Common.CheckGasToBurn,
PerformGasToBurn: *config.Keeper.Common.PerformGasToBurn,
BlockRange: *config.Keeper.Common.BlockRange,
BlockInterval: *config.Keeper.Common.BlockInterval,
UpkeepGasLimit: *config.Keeper.Common.UpkeepGasLimit,
NumberOfUpkeeps: *config.Automation.Benchmark.NumberOfUpkeeps,
CheckGasToBurn: *config.Automation.Benchmark.CheckGasToBurn,
PerformGasToBurn: *config.Automation.Benchmark.PerformGasToBurn,
BlockRange: *config.Automation.Benchmark.BlockRange,
BlockInterval: *config.Automation.Benchmark.BlockInterval,
UpkeepGasLimit: *config.Automation.Benchmark.UpkeepGasLimit,
FirstEligibleBuffer: 1,
},
Contracts: &testsetups.PreDeployedContracts{
RegistrarAddress: *config.Keeper.Common.RegistrarAddress,
RegistryAddress: *config.Keeper.Common.RegistryAddress,
LinkTokenAddress: *config.Keeper.Common.LinkTokenAddress,
EthFeedAddress: *config.Keeper.Common.EthFeedAddress,
GasFeedAddress: *config.Keeper.Common.GasFeedAddress,
},
ChainlinkNodeFunding: benchmarkTestNetwork.funding,
UpkeepSLA: benchmarkTestNetwork.upkeepSLA,
BlockTime: benchmarkTestNetwork.blockTime,
DeltaStage: benchmarkTestNetwork.deltaStage,
ForceSingleTxnKey: *config.Keeper.Common.ForceSingleTxKey,
DeleteJobsOnEnd: *config.Keeper.Common.DeleteJobsOnEnd,
ForceSingleTxnKey: *config.Automation.Benchmark.ForceSingleTxKey,
DeleteJobsOnEnd: *config.Automation.Benchmark.DeleteJobsOnEnd,
},
)
t.Cleanup(func() {
Expand All @@ -152,13 +145,7 @@ func TestAutomationBenchmark(t *testing.T) {
}

func addRegistry(config *tc.TestConfig) []ethcontracts.KeeperRegistryVersion {
switch *config.Keeper.Common.RegistryToTest {
case "1_1":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_1_1}
case "1_2":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_1_2}
case "1_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_1_3}
switch *config.Automation.Benchmark.RegistryToTest {
case "2_0":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0}
case "2_1":
Expand All @@ -167,19 +154,14 @@ func addRegistry(config *tc.TestConfig) []ethcontracts.KeeperRegistryVersion {
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_2}
case "2_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_3}
case "2_0-1_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0, ethcontracts.RegistryVersion_1_3}
case "2_1-2_0-1_3":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_1,
ethcontracts.RegistryVersion_2_0, ethcontracts.RegistryVersion_1_3}
case "2_2-2_1":
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_2, ethcontracts.RegistryVersion_2_1}
case "2_0-Multiple":
return repeatRegistries(ethcontracts.RegistryVersion_2_0, *config.Keeper.Common.NumberOfRegistries)
return repeatRegistries(ethcontracts.RegistryVersion_2_0, *config.Automation.Benchmark.NumberOfRegistries)
case "2_1-Multiple":
return repeatRegistries(ethcontracts.RegistryVersion_2_1, *config.Keeper.Common.NumberOfRegistries)
return repeatRegistries(ethcontracts.RegistryVersion_2_1, *config.Automation.Benchmark.NumberOfRegistries)
case "2_2-Multiple":
return repeatRegistries(ethcontracts.RegistryVersion_2_2, *config.Keeper.Common.NumberOfRegistries)
return repeatRegistries(ethcontracts.RegistryVersion_2_2, *config.Automation.Benchmark.NumberOfRegistries)
default:
return []ethcontracts.KeeperRegistryVersion{ethcontracts.RegistryVersion_2_0}
}
Expand Down Expand Up @@ -275,13 +257,13 @@ var networkConfig = map[string]NetworkConfig{
},
}

func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) {
func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.AutomationBenchmarkTestConfig) (*environment.Environment, blockchain.EVMNetwork) {
l := logging.GetTestLogger(t)
testNetwork := networks.MustGetSelectedNetworkConfig(keeperTestConfig.GetNetworkConfig())[0] // Environment currently being used to run benchmark test on
blockTime := "1"
numberOfNodes := *keeperTestConfig.GetKeeperConfig().Common.NumberOfNodes
numberOfNodes := *keeperTestConfig.GetAutomationConfig().General.NumberOfNodes

if strings.Contains(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest, "2_") {
if strings.Contains(*keeperTestConfig.GetAutomationConfig().Benchmark.RegistryToTest, "2_") {
numberOfNodes++
}

Expand All @@ -295,7 +277,7 @@ func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenc
"automation-%s-%s-%s",
strings.ToLower(strings.Join(keeperTestConfig.GetConfigurationNames(), "")),
strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"),
strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest), "_", "-"),
strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetAutomationConfig().Benchmark.RegistryToTest), "_", "-"),
),
Test: t,
PreventPodEviction: true,
Expand Down
Loading

0 comments on commit 5c3f755

Please sign in to comment.