From 3a6d0071c09d1565b9665e0e2ce36658e12046a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 14 May 2026 15:20:59 +0200 Subject: [PATCH] fix network argument to be a string and not a list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tried using TOML config format and encountered this unexpected error: Failed to load secondary sources: 'nimbus-execution-client.toml(17, 11) expected '"["'' Signed-off-by: Jakub SokoĊ‚owski --- execution_chain/conf.nim | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/execution_chain/conf.nim b/execution_chain/conf.nim index 2ae6c65121..b2fa6b95d7 100644 --- a/execution_chain/conf.nim +++ b/execution_chain/conf.nim @@ -138,12 +138,11 @@ type "- mainnet/1 : Ethereum main network\n" & "- sepolia/11155111: Testnet for smart contract testing\n" & "- hoodi/560048 : Testnet for staking and hard forks\n" & - "- custom/path : /path/to/genesis-or-network-configuration.json\n" & - "Both --network: name/path --network:id can be set at the same time to override network id number" - defaultValue: @[] # the default value is set in makeConfig + "- custom/path : /path/to/genesis-or-network-configuration.json" + defaultValue: none(string) # the default value is set in makeConfig defaultValueDesc: "mainnet(1)" abbr: "i" - name: "network" .}: seq[string] + name: "network" .}: Option[string] customNetwork {. ignore @@ -663,7 +662,7 @@ proc parseNetworkParams(network: string): (NetworkParams, bool) = (params, true) proc processNetworkParamsAndNetworkId(config: var ExecutionClientConf) = - if config.network.len == 0 and config.customNetwork.isNone: + if config.network.isNone and config.customNetwork.isNone: # Default value if none is set config.networkId = MainNet config.networkParams = networkParams(MainNet) @@ -674,16 +673,11 @@ proc processNetworkParamsAndNetworkId(config: var ExecutionClientConf) = id: Opt[NetworkId] simulatedCustomNetwork = false - for network in config.network: + if config.network.isSome: + let network = config.network.get if decOrHex(network): - if id.isSome: - warn "Network ID already set, ignore new value", id=network - continue id = Opt.some parseNetworkId(network) else: - if params.isSome: - warn "Network configuration already set, ignore new value", network - continue let (parsedParams, custom) = parseNetworkParams(network) params = Opt.some parsedParams # Simulate --custom-network while it is still not disabled.