Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

refactor(server): remove block time configuration from config and server params #1363

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions command/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Config struct {
TxPool *TxPool `json:"tx_pool" yaml:"tx_pool"`
LogLevel string `json:"log_level" yaml:"log_level"`
RestoreFile string `json:"restore_file" yaml:"restore_file"`
BlockTime uint64 `json:"block_time_s" yaml:"block_time_s"`
Headers *Headers `json:"headers" yaml:"headers"`
LogFilePath string `json:"log_to" yaml:"log_to"`
JSONRPCBatchRequestLimit uint64 `json:"json_rpc_batch_request_limit" yaml:"json_rpc_batch_request_limit"`
Expand Down Expand Up @@ -111,7 +110,6 @@ func DefaultConfig() *Config {
},
LogLevel: "INFO",
RestoreFile: "",
BlockTime: DefaultBlockTime,
Headers: &Headers{
AccessControlAllowOrigins: []string{"*"},
},
Expand Down
13 changes: 0 additions & 13 deletions command/server/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
)

var (
errInvalidBlockTime = errors.New("invalid block time specified")
errDataDirectoryUndefined = errors.New("data directory not defined")
)

Expand Down Expand Up @@ -50,10 +49,6 @@ func (p *serverParams) initRawParams() error {
return err
}

if err := p.initBlockTime(); err != nil {
return err
}

if p.isDevMode {
p.initDevMode()
}
Expand All @@ -66,14 +61,6 @@ func (p *serverParams) initRawParams() error {
return p.initAddresses()
}

func (p *serverParams) initBlockTime() error {
if p.rawConfig.BlockTime < 1 {
return errInvalidBlockTime
}

return nil
}

func (p *serverParams) initDataDirLocation() error {
if p.rawConfig.DataDir == "" {
return errDataDirectoryUndefined
Expand Down
2 changes: 0 additions & 2 deletions command/server/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const (
blockGasTargetFlag = "block-gas-target"
secretsConfigFlag = "secrets-config"
restoreFlag = "restore"
blockTimeFlag = "block-time"
devIntervalFlag = "dev-interval"
devFlag = "dev"
corsOriginFlag = "access-control-allow-origins"
Expand Down Expand Up @@ -179,7 +178,6 @@ func (p *serverParams) generateConfig() *server.Config {
MaxAccountEnqueued: p.rawConfig.TxPool.MaxAccountEnqueued,
SecretsManager: p.secretsConfig,
RestoreFile: p.getRestoreFilePath(),
BlockTime: p.rawConfig.BlockTime,
LogLevel: hclog.LevelFromString(p.rawConfig.LogLevel),
JSONLogFormat: p.rawConfig.JSONLogFormat,
LogFilePath: p.logFileLocation,
Expand Down
7 changes: 0 additions & 7 deletions command/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,6 @@ func setFlags(cmd *cobra.Command) {
"maximum number of enqueued transactions per account",
)

cmd.Flags().Uint64Var(
&params.rawConfig.BlockTime,
blockTimeFlag,
defaultConfig.BlockTime,
"minimum block time in seconds (at least 1s)",
)

cmd.Flags().StringArrayVar(
&params.corsAllowedOrigins,
corsOriginFlag,
Expand Down