From e4f5e3881d9f55267bfe970e1209a1153dd118b3 Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:56:09 +0400 Subject: [PATCH] make gethGasLimit configurable --- .../automationv2_1/automationv2_1_test.go | 23 +++++++++---------- .../testconfig/automation/config.go | 18 +++++++++------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index b0555cdd3f8..b6981735a3b 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -174,22 +174,22 @@ func TestLogTrigger(t *testing.T) { Str("Tag", version). Msg("Test Config") - testConfigFormat := `Number of Nodes: %d -Duration: %d -Block Time: %d -Spec Type: %s -Log Level: %s -Image: %s + testConfigFormat := `Image: %s Tag: %s +General Config: +%s + Load Config: %s` prettyLoadConfig, err := toml.Marshal(loadedTestConfig.Automation.Load) require.NoError(t, err, "Error marshalling load config") - testConfig := fmt.Sprintf(testConfigFormat, *loadedTestConfig.Automation.General.NumberOfNodes, *loadedTestConfig.Automation.General.Duration, - *loadedTestConfig.Automation.General.BlockTime, *loadedTestConfig.Automation.General.SpecType, *loadedTestConfig.Automation.General.ChainlinkNodeLogLevel, image, version, string(prettyLoadConfig)) + prettyGeneralConfig, err := toml.Marshal(loadedTestConfig.Automation.General) + require.NoError(t, err, "Error marshalling load config") + + testConfig := fmt.Sprintf(testConfigFormat, image, version, string(prettyGeneralConfig), string(prettyLoadConfig)) l.Info().Str("testConfig", testConfig).Msg("Test Config") testNetwork := networks.MustGetSelectedNetworkConfig(loadedTestConfig.Network)[0] @@ -216,10 +216,9 @@ Load Config: Values: map[string]interface{}{ "resources": gethNodeSpec, "geth": map[string]interface{}{ - "blocktime": *loadedTestConfig.Automation.General.BlockTime, - "capacity": "20Gi", - "startGaslimit": "20000000", - "targetGasLimit": "30000000", + "blocktime": *loadedTestConfig.Automation.General.BlockTime, + "capacity": "20Gi", + "startGaslimit": loadedTestConfig.Automation.General.GethGasLimit.String(), }, }, })) diff --git a/integration-tests/testconfig/automation/config.go b/integration-tests/testconfig/automation/config.go index bde989f544b..65799010b23 100644 --- a/integration-tests/testconfig/automation/config.go +++ b/integration-tests/testconfig/automation/config.go @@ -42,13 +42,14 @@ func (c *Config) Validate() error { // General is a common configuration for all automation performance tests type General struct { - NumberOfNodes *int `toml:"number_of_nodes"` - Duration *int `toml:"duration"` - BlockTime *int `toml:"block_time"` - SpecType *string `toml:"spec_type"` - ChainlinkNodeLogLevel *string `toml:"chainlink_node_log_level"` - UsePrometheus *bool `toml:"use_prometheus"` - RemoveNamespace *bool `toml:"remove_namespace"` + NumberOfNodes *int `toml:"number_of_nodes"` + Duration *int `toml:"duration"` + BlockTime *int `toml:"block_time"` + GethGasLimit *big.Int `toml:"gethGasLimit"` + SpecType *string `toml:"spec_type"` + ChainlinkNodeLogLevel *string `toml:"chainlink_node_log_level"` + UsePrometheus *bool `toml:"use_prometheus"` + RemoveNamespace *bool `toml:"remove_namespace"` } func (c *General) Validate() error { @@ -73,6 +74,9 @@ func (c *General) Validate() error { if c.RemoveNamespace == nil { return errors.New("remove_namespace must be set") } + if c.GethGasLimit == nil || c.GethGasLimit.Cmp(big.NewInt(0)) < 0 { + c.GethGasLimit = big.NewInt(20000000) + } return nil }