Skip to content

Commit

Permalink
make gethGasLimit configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhwarrier committed Jul 10, 2024
1 parent bc1ca7d commit e4f5e38
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
23 changes: 11 additions & 12 deletions integration-tests/load/automationv2_1/automationv2_1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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(),
},
},
}))
Expand Down
18 changes: 11 additions & 7 deletions integration-tests/testconfig/automation/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit e4f5e38

Please sign in to comment.