Skip to content

Commit

Permalink
fix: updated default config values to support both 20 min and shorter…
Browse files Browse the repository at this point in the history
… 5 min epoch (#1209)

* fix: updated config default max, min values to support longer epoch

* fix: updated default config values in config.sh if builded from source
  • Loading branch information
Yashk767 authored May 14, 2024
1 parent 2a341b2 commit f6ee451
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions cmd/config-utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (*UtilsStruct) GetMultiplier() (float32, error) {
func (*UtilsStruct) GetBufferPercent() (int32, error) {
const (
MinBufferPercent = 0
MaxBufferPercent = 5
MaxBufferPercent = 30
)

bufferPercent, err := getConfigValue("buffer", "int32", core.DefaultBufferPercent, "buffer")
Expand Down Expand Up @@ -237,8 +237,8 @@ func (*UtilsStruct) GetBufferPercent() (int32, error) {
//This function returns the wait time
func (*UtilsStruct) GetWaitTime() (int32, error) {
const (
MinWaitTime = 1 // Minimum wait time in seconds
MaxWaitTime = 5 // Maximum wait time in seconds
MinWaitTime = 1 // Minimum wait time in seconds
MaxWaitTime = 30 // Maximum wait time in seconds
)

waitTime, err := getConfigValue("wait", "int32", core.DefaultWaitTime, "wait")
Expand Down Expand Up @@ -334,7 +334,7 @@ func (*UtilsStruct) GetGasLimitOverride() (uint64, error) {
func (*UtilsStruct) GetRPCTimeout() (int64, error) {
const (
MinRPCTimeout = 10 // Minimum RPC timeout in seconds
MaxRPCTimeout = 20 // Maximum RPC timeout in seconds
MaxRPCTimeout = 60 // Maximum RPC timeout in seconds
)

rpcTimeout, err := getConfigValue("rpcTimeout", "int64", core.DefaultRPCTimeout, "rpcTimeout")
Expand All @@ -356,7 +356,7 @@ func (*UtilsStruct) GetRPCTimeout() (int64, error) {
func (*UtilsStruct) GetHTTPTimeout() (int64, error) {
const (
MinHTTPTimeout = 10 // Minimum HTTP timeout in seconds
MaxHTTPTimeout = 20 // Maximum HTTP timeout in seconds
MaxHTTPTimeout = 60 // Maximum HTTP timeout in seconds
)

httpTimeout, err := getConfigValue("httpTimeout", "int64", core.DefaultHTTPTimeout, "httpTimeout")
Expand Down
8 changes: 4 additions & 4 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ then
GAS_MULTIPLIER=1.0
fi

read -rp "Buffer Percent: (0) " BUFFER
read -rp "Buffer Percent: (20) " BUFFER
if [ -z "$BUFFER" ];
then
BUFFER=0
BUFFER=20
fi

read -rp "Wait Time: (1) " WAIT_TIME
read -rp "Wait Time: (5) " WAIT_TIME
if [ -z "$WAIT_TIME" ]; then
WAIT_TIME=1
WAIT_TIME=5
fi

read -rp "Gas Price: (0) " GAS_PRICE
Expand Down
4 changes: 2 additions & 2 deletions core/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const BlockCompletionTimeout = 30
//Following are the default config values for all the config parameters
const (
DefaultGasMultiplier float32 = 1.0
DefaultBufferPercent int32 = 0
DefaultBufferPercent int32 = 20
DefaultGasPrice int32 = 0
DefaultWaitTime int32 = 1
DefaultWaitTime int32 = 5
DefaultGasLimit float32 = 2
DefaultGasLimitOverride uint64 = 30000000
DefaultRPCTimeout int64 = 10
Expand Down

0 comments on commit f6ee451

Please sign in to comment.