Skip to content
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
18 changes: 9 additions & 9 deletions beacon_chain/conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ type
name: "era-dir" .}: Option[InputDir]

web3ForcePolling* {.
hidden
obsolete
name: "web3-force-polling" .}: Option[bool]

web3Urls* {.
Expand All @@ -211,12 +211,12 @@ type
name: "no-el" .}: bool

optimistic* {.
hidden # deprecated > 22.12
obsolete # deprecated > 22.12
desc: "Run the node in optimistic mode, allowing it to optimistically sync without an execution client (flag deprecated, always on)"
name: "optimistic".}: Option[bool]

requireEngineAPI* {.
hidden # Deprecated > 22.9
obsolete # Deprecated > 22.9
desc: "Require Nimbus to be configured with an Engine API end-point after the Bellatrix fork epoch"
name: "require-engine-api-in-bellatrix" .}: Option[bool]

Expand Down Expand Up @@ -370,11 +370,11 @@ type
name: "genesis-state-url" .}: Option[Uri]

finalizedDepositTreeSnapshot* {.
hidden
obsolete
name: "finalized-deposit-tree-snapshot" .}: Option[InputFile]

finalizedCheckpointBlock* {.
hidden
obsolete
desc: "SSZ file specifying a recent finalized block"
name: "finalized-checkpoint-block" .}: Option[InputFile]

Expand Down Expand Up @@ -562,7 +562,7 @@ type
name: "debug-long-range-sync".}: LongRangeSyncMode

inProcessValidators* {.
hidden
obsolete
desc: "Deprecated for removal"
name: "in-process-validators" .}: Option[bool]

Expand Down Expand Up @@ -619,7 +619,7 @@ type
name: "sync-horizon" .}: Option[uint64]

terminalTotalDifficultyOverride* {.
hidden
obsolete
desc: "Deprecated for removal"
name: "terminal-total-difficulty-override" .}: Option[string]

Expand All @@ -638,13 +638,13 @@ type
name: "validator-monitor-details" .}: bool

validatorMonitorTotals* {.
hidden
obsolete: "Use --validator-monitor-details instead"
desc: "Deprecated in favour of --validator-monitor-details"
name: "validator-monitor-totals" .}: Option[bool]

safeSlotsToImportOptimistically* {.
# Never unhidden or documented, and deprecated > 22.9.1
hidden
obsolete
desc: "Deprecated for removal"
name: "safe-slots-to-import-optimistically" .}: Option[uint16]

Expand Down
19 changes: 3 additions & 16 deletions beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2862,20 +2862,6 @@ proc doRunBeaconNode(
if config.rpcEnabled.isSome:
warn "Nimbus's JSON-RPC server has been removed. This includes the --rpc, --rpc-port, and --rpc-address configuration options. https://nimbus.guide/rest-api.html shows how to enable and configure the REST Beacon API server which replaces it."

template ignoreDeprecatedOption(option: untyped): untyped =
if config.option.isSome:
warn "Ignoring deprecated configuration option", option = config.option.get

ignoreDeprecatedOption requireEngineAPI
ignoreDeprecatedOption safeSlotsToImportOptimistically
ignoreDeprecatedOption terminalTotalDifficultyOverride
ignoreDeprecatedOption optimistic
ignoreDeprecatedOption validatorMonitorTotals
ignoreDeprecatedOption web3ForcePolling
ignoreDeprecatedOption finalizedDepositTreeSnapshot
ignoreDeprecatedOption finalizedCheckpointBlock
ignoreDeprecatedOption inProcessValidators

# Trusted setup is needed for Cancun+ blocks and is shared between threads,
# so it needs to be initalized from the main thread before anything else tries
# to use it
Expand Down Expand Up @@ -3040,11 +3026,12 @@ proc main*() {.noinline, raises: [CatchableError].} =
const copyright =
"Copyright (c) 2019-" & compileYear & " Status Research & Development GmbH"

var config = BeaconNodeConf.loadWithBanners(clientId, copyright, [specBanner]).valueOr:
var config = BeaconNodeConf.loadWithBanners(
clientId, copyright, [specBanner], setupLogger = true
).valueOr:
writePanicLine error # Logging not yet set up
quit QuitFailure

setupLogging(config.logLevel, config.logStdout, config.logFile)
setupFileLimits()

if not (checkAndCreateDataDir(string(config.dataDir))):
Expand Down
12 changes: 12 additions & 0 deletions beacon_chain/nimbus_binary_common.nim
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,23 @@ proc setupTaskpool*(numThreads: int): Taskpool =

taskpool

proc obsoleteCmdOpt*(ConfType: type object, opt, msg: string) =
if msg.len == 0:
warn "Ignoring deprecated configuration option", opt
else:
warn "Ignoring deprecated configuration option", opt, msg

template loggerSetup(ConfType: type): untyped =
proc (config: ConfType) {.raises: [], gcsafe.} =
setupLogging(config.logLevel, config.logStdout, config.logFile)

proc loadWithBanners*(
ConfType: type,
helpBanner, copyright: string,
versions: openArray[string],
ignoreUnknown = false,
environment: openArray[string] = [],
setupLogger = false
): Result[ConfType, string] =
let
version =
Expand Down Expand Up @@ -227,6 +238,7 @@ proc loadWithBanners*(
if config.configFile.isSome:
sources.addConfigFile(Toml, config.configFile.get)
,
loggerSetup = if setupLogger: loggerSetup(ConfType) else: nil
)
except CatchableError as exc:
# Logging not configured yet!
Expand Down
6 changes: 3 additions & 3 deletions beacon_chain/nimbus_light_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ proc main() {.noinline, raises: [CatchableError].} =
copyright =
"Copyright (c) 2022-" & compileYear & " Status Research & Development GmbH"

var config = LightClientConf.loadWithBanners(banner, copyright, [specBanner]).valueOr:
var config = LightClientConf.loadWithBanners(
banner, copyright, [specBanner], setupLogger = true
).valueOr:
writePanicLine error # Logging not yet set up
quit QuitFailure

setupLogging(config.logLevel, config.logStdout, config.logFile)

notice "Launching light client",
version = fullVersionStr, cmdParams = commandLineParams(), config

Expand Down
6 changes: 3 additions & 3 deletions beacon_chain/nimbus_signing_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,12 @@ proc main() {.noinline, raises: [CatchableError].} =
copyright =
"Copyright (c) 2021-" & compileYear & " Status Research & Development GmbH"

let config = SigningNodeConf.loadWithBanners(banner, copyright, [specBanner]).valueOr:
let config = SigningNodeConf.loadWithBanners(
banner, copyright, [specBanner], setupLogger = true
).valueOr:
writePanicLine error # Logging not yet set up
quit QuitFailure

setupLogging(config.logLevel, config.logStdout, config.logFile)

waitFor runSigningNode(config)

when isMainModule:
Expand Down
5 changes: 3 additions & 2 deletions beacon_chain/nimbus_validator_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -646,15 +646,16 @@ proc main() {.noinline, raises: [CatchableError].} =
"Copyright (c) 2020-" & compileYear & " Status Research & Development GmbH"

let
config = ValidatorClientConf.loadWithBanners(banner, copyright, [specBanner]).valueOr:
config = ValidatorClientConf.loadWithBanners(
banner, copyright, [specBanner], setupLogger = true
).valueOr:
writePanicLine error # Logging not yet set up
quit QuitFailure

# Single RNG instance for the application - will be seeded on construction
# and avoid using system resources (such as urandom) after that
rng = HmacDrbgContext.new()

setupLogging(config.logLevel, config.logStdout, config.logFile)
setupFileLimits()

waitFor runValidatorClient(config, rng)
Expand Down
8 changes: 4 additions & 4 deletions beacon_chain/winservice.nim
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ when defined(windows):
reportServiceStatus(SERVICE_STOPPED, ERROR_INVALID_PARAMETER, 0)
quit QuitFailure

var config = loadWithBanners(argConfigType, argHelpBanner, argCopyright,
argVersions, false, environment).valueOr:
var config = loadWithBanners(
argConfigType, argHelpBanner, argCopyright,
argVersions, false, environment, setupLogger = true
).valueOr:
reportServiceStatus(SERVICE_STOPPED, ERROR_BAD_CONFIGURATION, 0)
quit QuitFailure

setupLogging(config.logLevel, config.logStdout, config.logFile)

try:
argEntryPoint(config)
info "Service thread stopped"
Expand Down
2 changes: 2 additions & 0 deletions docs/the_nimbus_book/src/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ nimbus_beacon_node [OPTIONS]... command

The following options are available:

--help Show this help message and exit.
--version Show program's version and exit.
--config-file Loads the configuration from a TOML file.
--log-level Sets the log level for process and topics (e.g. "DEBUG; TRACE:discv5,libp2p;
REQUIRED:none; DISABLED:none") [=INFO].
Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-confutils
Submodule nim-confutils updated 51 files
+2 −0 .gitignore
+265 −261 README.md
+303 −117 confutils.nim
+3 −2 confutils.nimble
+3 −0 confutils/defs.nim
+7 −9 confutils/shell_completion.nim
+9 −1 tests/config_files/nested_cmd.toml
+1 −0 tests/help/.gitignore
+5 −1 tests/help/snapshots/test_argument.txt
+1 −0 tests/help/snapshots/test_argument_abbr.txt
+17 −0 tests/help/snapshots/test_builtins.txt
+10 −0 tests/help/snapshots/test_builtins_lvl1Cmd1.txt
+1 −0 tests/help/snapshots/test_case_opt.txt
+1 −0 tests/help/snapshots/test_case_opt_cmdBlockProcessing.txt
+10 −0 tests/help/snapshots/test_cli_example.txt
+10 −0 tests/help/snapshots/test_cli_example_nims.txt
+16 −0 tests/help/snapshots/test_debug.txt
+18 −0 tests/help/snapshots/test_debug_debug.txt
+11 −0 tests/help/snapshots/test_debug_lvl1Cmd1_debug.txt
+20 −0 tests/help/snapshots/test_default_cmd_desc.txt
+10 −0 tests/help/snapshots/test_default_cmd_desc_exportCommand.txt
+10 −0 tests/help/snapshots/test_default_cmd_desc_printCommand.txt
+1 −0 tests/help/snapshots/test_default_value_desc.txt
+11 −0 tests/help/snapshots/test_dispatch.txt
+1 −0 tests/help/snapshots/test_longdesc.txt
+1 −0 tests/help/snapshots/test_longdesc_lvl1Cmd1.txt
+21 −0 tests/help/snapshots/test_multi_case_values.txt
+1 −0 tests/help/snapshots/test_nested_cmd.txt
+1 −0 tests/help/snapshots/test_nested_cmd_lvl1Cmd1.txt
+1 −0 tests/help/snapshots/test_nested_cmd_lvl1Cmd1_lvl2Cmd2.txt
+1 −0 tests/help/snapshots/test_separator.txt
+30 −0 tests/help/test_builtins.nim
+7 −0 tests/help/test_cli_example.nim
+1 −0 tests/help/test_cli_example.nims
+49 −0 tests/help/test_debug.nim
+34 −0 tests/help/test_default_cmd_desc.nim
+16 −0 tests/help/test_dispatch.nim
+25 −0 tests/help/test_multi_case_values.nim
+9 −2 tests/test_all.nim
+26 −9 tests/test_config_file.nim
+134 −0 tests/test_dispatch.nim
+43 −3 tests/test_duplicates.nim
+40 −0 tests/test_envvar.nim
+74 −30 tests/test_help.nim
+56 −0 tests/test_multi_case_values.nim
+26 −1 tests/test_nested_cmd.nim
+107 −0 tests/test_obsolete.nim
+26 −0 tests/test_obsolete_overload.nim
+8 −0 tests/test_obsolete_overload_def.nim
+33 −8 tests/test_parsecmdarg.nim
+79 −0 tests/test_results_opt.nim
Loading